Skip to content

Commit

Permalink
refactor(core): Remove trailing spaces in code (open62541#5221)
Browse files Browse the repository at this point in the history
  • Loading branch information
keba-estr authored Jun 24, 2022
1 parent e47a104 commit 13af9b8
Show file tree
Hide file tree
Showing 137 changed files with 1,284 additions and 1,284 deletions.
2 changes: 1 addition & 1 deletion arch/common/ua_timer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2017, 2018, 2021 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down
2 changes: 1 addition & 1 deletion arch/common/ua_timer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2017, 2018, 2021 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down
2 changes: 1 addition & 1 deletion arch/eCos/ua_clock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2018 (c) Jose Cabral, fortiss GmbH
*/
Expand Down
2 changes: 1 addition & 1 deletion arch/eventloop_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ UA_EventLoop_new_POSIX(const UA_Logger *logger) {
el->eventLoop.removeCyclicCallback = UA_EventLoopPOSIX_removeCyclicCallback;
el->eventLoop.addTimedCallback = UA_EventLoopPOSIX_addTimedCallback;
el->eventLoop.addDelayedCallback = UA_EventLoopPOSIX_addDelayedCallback;

el->eventLoop.registerEventSource =
(UA_StatusCode (*)(UA_EventLoop*, UA_EventSource*))
UA_EventLoopPOSIX_registerEventSource;
Expand Down
6 changes: 3 additions & 3 deletions arch/eventloop_posix_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UA_EventLoopPOSIX_registerFD(UA_EventLoopPOSIX *el, UA_RegisteredFD *rfd) {
event.events |= EPOLLIN;
if(rfd->listenEvents & UA_FDEVENT_OUT)
event.events |= EPOLLOUT;

int err = epoll_ctl(el->epollfd, EPOLL_CTL_ADD, rfd->fd, &event);
if(err != 0) {
UA_LOG_SOCKET_ERRNO_WRAP(
Expand All @@ -40,7 +40,7 @@ UA_EventLoopPOSIX_modifyFD(UA_EventLoopPOSIX *el, UA_RegisteredFD *rfd) {
event.events |= EPOLLIN;
if(rfd->listenEvents & UA_FDEVENT_OUT)
event.events |= EPOLLOUT;

int err = epoll_ctl(el->epollfd, EPOLL_CTL_MOD, rfd->fd, &event);
if(err != 0) {
UA_LOG_SOCKET_ERRNO_WRAP(
Expand Down Expand Up @@ -107,7 +107,7 @@ UA_EventLoopPOSIX_pollFDs(UA_EventLoopPOSIX *el, UA_DateTime listenTimeout) {
} else {
revent = UA_FDEVENT_ERR;
}

UA_UNLOCK(&el->elMutex);
rfd->callback(rfd->es, rfd, revent);
UA_LOCK(&el->elMutex);
Expand Down
4 changes: 2 additions & 2 deletions arch/eventloop_posix_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ deactivateSignal(UA_RegisteredSignal *rs) {
if(!rs->active)
return;
rs->active = false;

/* Stop receiving the signal on the FD */
UA_EventLoopPOSIX *el = (UA_EventLoopPOSIX *)rs->rfd.es->eventLoop;
UA_EventLoopPOSIX_deregisterFD(el, &rs->rfd);
Expand Down Expand Up @@ -285,7 +285,7 @@ registerPOSIXInterrupt(UA_InterruptManager *im, uintptr_t interruptHandle,
/* Activate if we are already running */
if(pim->im.eventSource.state == UA_EVENTSOURCESTATE_STARTED)
activateSignal(rs);

return UA_STATUSCODE_GOOD;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/eventloop_posix_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ UA_EventLoopPOSIX_deregisterFD(UA_EventLoopPOSIX *el, UA_RegisteredFD *rfd) {
el->fds[i] = el->fds[el->fdsSize];
UA_RegisteredFD **fds_tmp = (UA_RegisteredFD**)
UA_realloc(el->fds, sizeof(UA_RegisteredFD*) * el->fdsSize);
/* if realloc fails the fds are still in a correct state with
/* if realloc fails the fds are still in a correct state with
* possibly lost memory, so failing silently here is ok */
if(fds_tmp)
el->fds = fds_tmp;
Expand Down Expand Up @@ -154,7 +154,7 @@ UA_EventLoopPOSIX_pollFDs(UA_EventLoopPOSIX *el, UA_DateTime listenTimeout) {
} else {
continue;
}

UA_LOG_DEBUG(el->eventLoop.logger, UA_LOGCATEGORY_EVENTLOOP,
"Processing event %u on fd %u", (unsigned)event, (unsigned)fd);

Expand Down
4 changes: 2 additions & 2 deletions arch/eventloop_posix_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ TCP_registerListenSocket(UA_ConnectionManager *cm, struct addrinfo *ai,
"TCP\t| getnameinfo(...) could not resolve the "
"hostname (%s)", errno_str));
}

/* Create the server socket */
UA_FD listenSocket = UA_socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if(listenSocket == UA_INVALID_FD) {
Expand Down Expand Up @@ -907,7 +907,7 @@ TCP_eventSourceStart(UA_ConnectionManager *cm) {
UA_StatusCode res = UA_ByteString_allocBuffer(&tcm->rxBuffer, rxBufSize);
if(res != UA_STATUSCODE_GOOD)
return res;

/* Set the EventSource to the started state */
cm->eventSource.state = UA_EVENTSOURCESTATE_STARTED;

Expand Down
6 changes: 3 additions & 3 deletions arch/eventloop_posix_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ UDP_registerListenSocket(UA_ConnectionManager *cm, UA_UInt16 port,
"UDP\t| getnameinfo(...) could not resolve the hostname (%s)",
errno_str));
}

/* Create the server socket */
UA_FD listenSocket = UA_socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if(listenSocket == UA_INVALID_FD) {
Expand Down Expand Up @@ -739,7 +739,7 @@ UDP_openReceiveConnection(UA_ConnectionManager *cm,
return UDP_registerListenSockets(cm, NULL, *port, application,
context, connectionCallback);
}

/* Iterate over the configured hostnames */
UA_String *hostStrings = (UA_String*)hostNames->data;
for(size_t i = 0; i < hostNames->arrayLength; i++) {
Expand Down Expand Up @@ -800,7 +800,7 @@ UDP_eventSourceStart(UA_ConnectionManager *cm) {
UA_StatusCode res = UA_ByteString_allocBuffer(&ucm->rxBuffer, rxBufSize);
if(res != UA_STATUSCODE_GOOD)
return res;

/* Set the EventSource to the started state */
cm->eventSource.state = UA_EVENTSOURCESTATE_STARTED;

Expand Down
2 changes: 1 addition & 1 deletion arch/freertosLWIP/ua_clock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down
4 changes: 2 additions & 2 deletions arch/network_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int
callback_opcua(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in,
size_t len) {
struct SessionData *pss = (struct SessionData *)user;
struct VHostData *vhd =
struct VHostData *vhd =
(struct VHostData *)lws_protocol_vh_priv_get(lws_get_vhost(wsi),
lws_get_protocol(wsi));

Expand Down Expand Up @@ -301,7 +301,7 @@ ServerNetworkLayerWS_start(UA_ServerNetworkLayer *nl, const UA_Logger *logger,
info.server_ssl_cert_mem_len = (unsigned int)layer->certificate.length;
info.server_ssl_private_key_mem = layer->privateKey.data;
info.server_ssl_private_key_mem_len = (unsigned int)layer->privateKey.length;

info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK,
"Websocket network layer listening using WSS");
Expand Down
2 changes: 1 addition & 1 deletion arch/posix/ua_clock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2016-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down
2 changes: 1 addition & 1 deletion arch/vxworks/ua_clock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down
4 changes: 2 additions & 2 deletions arch/win32/ua_clock.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB
* Copyright 2017 (c) Stefan Profanter, fortiss GmbH
Expand Down Expand Up @@ -50,7 +50,7 @@ UA_Int64 UA_DateTime_localTimeUtcOffset(void) {
gmtime_s(&rawtime, &ptm);
#else
gmtime_s(&ptm, &rawtime);
#endif
#endif
// Request that mktime() looksup dst in timezone database
ptm.tm_isdst = -1;
gmt = mktime(&ptm);
Expand Down
2 changes: 1 addition & 1 deletion examples/client_method_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ methodCalled(UA_Client *client, void *userdata, UA_UInt32 requestId,
"---Method call was successful, returned %lu values.\n",
(unsigned long)response->results[i].outputArgumentsSize);
}

/* We initiate the MultiCall (2 methods within one CallRequest) */
InitCallMulti(client);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ writeFile(const char* const path, const UA_ByteString buffer) {
FILE *fp = NULL;

fp = fopen(path, "wb");
if(fp == NULL)
if(fp == NULL)
return UA_STATUSCODE_BADINTERNALERROR;

for(UA_UInt32 bufIndex = 0; bufIndex < buffer.length; bufIndex++) {
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_datatype/client_types_custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ int main(void) {
UA_Client_delete(client);
return (int)retval;
}

UA_Variant value; /* Variants can hold scalar values and arrays of any type */
UA_Variant_init(&value);

UA_NodeId nodeId =
UA_NODEID_STRING(1, "3D.Point");

retval = UA_Client_readValueAttribute(client, nodeId, &value);

if(retval == UA_STATUSCODE_GOOD) {
Point *p = (Point *)value.data;
printf("Point = %f, %f, %f \n", p->x, p->y, p->z);
Expand Down
2 changes: 1 addition & 1 deletion examples/encryption/client_encryption.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) {
UA_Client_delete(client);
return EXIT_FAILURE;
}

UA_ByteString_clear(&certificate);
UA_ByteString_clear(&privateKey);
for(size_t deleteCount = 0; deleteCount < trustListSize; deleteCount++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/nodeset/server_nodeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void stopHandler(int sign) {
int main(int argc, char** argv) {
signal(SIGINT, stopHandler);
signal(SIGTERM, stopHandler);

UA_Server *server = UA_Server_new();
UA_ServerConfig_setDefault(UA_Server_getConfig(server));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */

/**
* This example can be used to receive and display values that are published
* by tutorial_pubsub_publish example in the TargetVariables of Subscriber
* This example can be used to receive and display values that are published
* by tutorial_pubsub_publish example in the TargetVariables of Subscriber
* Information Model.
*
*
* Additionally this example shows the usage of the PubSub monitoring implementation.
* The application can provide the pubsubStateChangeCallback to get notifications
* about specific PubSub state changes or timeouts. Currently only the
* The application can provide the pubsubStateChangeCallback to get notifications
* about specific PubSub state changes or timeouts. Currently only the
* MessageReceiveTimeout handling of a DataSetReader is implemented.
* Stop the tutorial_pubsub_publish example during operation to trigger the
* Stop the tutorial_pubsub_publish example during operation to trigger the
* MessageReceiveTimeout and check the callback invocation.
*
*
* Per default the monitoring backend is provided by the open62541 sdk.
* An application can provide it's own monitoring backend (e.g. linux timers),
* by setting the monitoring callbacks. This option can be tested with
Expand Down Expand Up @@ -55,9 +55,9 @@ typedef struct MonitoringParams {
UA_ServerCallback callback;
} TMonitoringParams;

/* In this example we only configure 1 DataSetReader and therefore only provide 1
/* In this example we only configure 1 DataSetReader and therefore only provide 1
data structure for monitoring params. This example only works with 1 DataSetReader for simplicity's sake.
If more DataSetReaders shall be configured one can create a new data structure at every pubSubComponent_createMonitoring() call and
If more DataSetReaders shall be configured one can create a new data structure at every pubSubComponent_createMonitoring() call and
administer them with a list/map/vector .... */
TMonitoringParams monitoringParams;

Expand Down Expand Up @@ -259,7 +259,7 @@ static void stopHandler(int sign) {

/* Provide a callback to get notifications about specific PubSub state changes or timeouts.
Currently only the MessageReceiveTimeout of the subscriber is supported.
Stop the tutorial_pubsub_publish example during operation to trigger the MessageReceiveTimeout and
Stop the tutorial_pubsub_publish example during operation to trigger the MessageReceiveTimeout and
check the callback invocation here */
static void
pubsubStateChangeCallback(UA_Server *server,
Expand All @@ -271,7 +271,7 @@ pubsubStateChangeCallback(UA_Server *server,
UA_ServerConfig *config = UA_Server_getConfig(server);
UA_UInt32 *stateChangeCnt = (UA_UInt32 *)config->context;
(*stateChangeCnt)++;

if (pubsubComponentId == 0) {
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "pubsubStateChangeCallback(): Null pointer error. Internal error");
return;
Expand All @@ -295,7 +295,7 @@ monitoringCallbackHandler(union sigval val)

/* Custom monitoring backend implementation: only 1 DataSetReader is supported */
static UA_StatusCode
pubSubComponent_createMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
pubSubComponent_createMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
UA_PubSubMonitoringType eMonitoringType, void *data, UA_ServerCallback callback) {
if ((!server) || (!data)) {
return UA_STATUSCODE_BADINVALIDARGUMENT;
Expand Down Expand Up @@ -326,7 +326,7 @@ pubSubComponent_createMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubCompo
}

static UA_StatusCode
pubSubComponent_startMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
pubSubComponent_startMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
UA_PubSubMonitoringType eMonitoringType, void *data) {
if ((!server) || (!data)) {
return UA_STATUSCODE_BADINVALIDARGUMENT;
Expand All @@ -352,7 +352,7 @@ pubSubComponent_startMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubCompon
}

static UA_StatusCode
pubSubComponent_stopMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
pubSubComponent_stopMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
UA_PubSubMonitoringType eMonitoringType, void *data) {
if ((!server) || (!data)) {
return UA_STATUSCODE_BADINVALIDARGUMENT;
Expand All @@ -378,7 +378,7 @@ pubSubComponent_stopMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubCompone
}

static UA_StatusCode
pubSubComponent_updateMonitoringInterval(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
pubSubComponent_updateMonitoringInterval(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
UA_PubSubMonitoringType eMonitoringType, void *data)
{
if ((!server) || (!data)) {
Expand Down Expand Up @@ -413,7 +413,7 @@ pubSubComponent_updateMonitoringInterval(UA_Server *server, UA_NodeId Id, UA_Pub
}

static UA_StatusCode
pubSubComponent_deleteMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
pubSubComponent_deleteMonitoring(UA_Server *server, UA_NodeId Id, UA_PubSubComponentEnumType eComponentType,
UA_PubSubMonitoringType eMonitoringType, void *data) {
if ((!server) || (!data)) {
return UA_STATUSCODE_BADINVALIDARGUMENT;
Expand Down
2 changes: 1 addition & 1 deletion examples/pubsub/pubsub_subscribe_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ int main(int argc, char **argv) {
retval = subscriberListen(psc);

psc->close(psc);

return 0;
}
10 changes: 5 additions & 5 deletions examples/pubsub/server_pubsub_file_configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char** argv) {
break;

default:
usage_info();
usage_info();
}

/* 2. Initialize Server */
Expand All @@ -58,7 +58,7 @@ int main(int argc, char** argv) {
UA_VariableAttributes attr;
UA_NodeId parentReferenceNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES);
UA_NodeId pubSubVariableObjectId = UA_NODEID_STRING(1, "PubSubObject");

UA_ObjectAttributes oAttr = UA_ObjectAttributes_default;
oAttr.displayName = UA_LOCALIZEDTEXT("en-US", "PubSubVariables");
UA_Server_addObjectNode(server, pubSubVariableObjectId,
Expand Down Expand Up @@ -138,10 +138,10 @@ int main(int argc, char** argv) {
statusCode = UA_PubSubManager_getEncodedPubSubConfiguration(server, &buffer);
if(statusCode == UA_STATUSCODE_GOOD)
statusCode = writeFile(argv[2], buffer);
if(statusCode != UA_STATUSCODE_GOOD)

if(statusCode != UA_STATUSCODE_GOOD)
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Saving PubSub configuration to file failed. StatusCode: 0x%x\n", statusCode);

UA_ByteString_clear(&buffer);
}

Expand Down
Loading

0 comments on commit 13af9b8

Please sign in to comment.