diff --git a/core/observe.c b/core/observe.c index f5ee9a4f1..31370decd 100644 --- a/core/observe.c +++ b/core/observe.c @@ -746,15 +746,12 @@ void observe_step(lwm2m_context_t * contextP, { LOG_ARG("Checking minimal period (%d s)", watcherP->parameters->minPeriod); - if ((time_t)(watcherP->lastTime + watcherP->parameters->minPeriod) > currentTime) - { + if ((time_t)(watcherP->lastTime + watcherP->parameters->minPeriod) > currentTime) { // Minimum Period did not elapse yet interval = watcherP->lastTime + watcherP->parameters->minPeriod - currentTime; if (*timeoutP > interval) *timeoutP = interval; notify = false; - } - else - { + } else { LOG("Notify on minimal period"); notify = true; } @@ -768,8 +765,7 @@ void observe_step(lwm2m_context_t * contextP, { LOG_ARG("Checking maximal period (%d s)", watcherP->parameters->maxPeriod); - if ((time_t)(watcherP->lastTime + watcherP->parameters->maxPeriod) <= currentTime) - { + if ((time_t)(watcherP->lastTime + watcherP->parameters->maxPeriod) <= currentTime) { LOG("Notify on maximal period"); notify = true; } diff --git a/examples/bootstrap_server/bootstrap_info.c b/examples/bootstrap_server/bootstrap_info.c index 4e3c12306..80cbf89b7 100644 --- a/examples/bootstrap_server/bootstrap_info.c +++ b/examples/bootstrap_server/bootstrap_info.c @@ -47,9 +47,7 @@ typedef struct #endif } read_server_t; -static int prv_find_next_section(FILE * fd, - const char * tag) -{ +static int prv_find_next_section(FILE *fd, const char *tag) { char * line; size_t length; int found; diff --git a/examples/bootstrap_server/bootstrap_server.c b/examples/bootstrap_server/bootstrap_server.c index 5a8a165ea..fb40e207f 100644 --- a/examples/bootstrap_server/bootstrap_server.c +++ b/examples/bootstrap_server/bootstrap_server.c @@ -80,9 +80,7 @@ void handle_sigint(int signum) prv_quit(NULL, NULL, NULL); } -void print_usage(const char * filename, - const char * port) -{ +void print_usage(const char *filename, const char *port) { fprintf(stdout, "Usage: bootstap_server [OPTION]\r\n"); fprintf(stderr, "Launch a LWM2M Bootstrap Server.\r\n\n"); fprintf(stdout, "Options:\r\n"); @@ -486,7 +484,7 @@ static void prv_bootstrap_client(lwm2m_context_t *lwm2mH, { internal_data_t * dataP = (internal_data_t *)user_data; char * uri; - const char * name = ""; + const char *name = ""; char * end = NULL; char * host; char * port; @@ -558,9 +556,9 @@ int main(int argc, char *argv[]) fd_set readfds; struct timeval tv; int result; - const char * port = "5685"; + const char *port = "5685"; internal_data_t data; - const char * filename = "bootstrap_server.ini"; + const char *filename = "bootstrap_server.ini"; int opt; FILE * fd; lwm2m_context_t * lwm2mH; diff --git a/examples/client/lwm2mclient.c b/examples/client/lwm2mclient.c index cfd2ac855..22111c8f5 100644 --- a/examples/client/lwm2mclient.c +++ b/examples/client/lwm2mclient.c @@ -869,7 +869,7 @@ int main(int argc, char *argv[]) const char * localPort = "56830"; const char * server = NULL; const char * serverPort = LWM2M_STANDARD_PORT_STR; - const char * name = "testlwm2mclient"; + const char *name = "testlwm2mclient"; int lifetime = 300; int batterylevelchanging = 0; time_t reboot_time = 0; diff --git a/examples/lightclient/lightclient.c b/examples/lightclient/lightclient.c index 8dbd7e799..bad379245 100644 --- a/examples/lightclient/lightclient.c +++ b/examples/lightclient/lightclient.c @@ -329,7 +329,7 @@ int main(int argc, char *argv[]) lwm2m_object_t * objArray[OBJ_COUNT]; const char * localPort = "56830"; - const char * name = "testlwm2mclient"; + const char *name = "testlwm2mclient"; int result; int opt; diff --git a/examples/lightclient/object_security.c b/examples/lightclient/object_security.c index 6f01eabba..2c52fab22 100644 --- a/examples/lightclient/object_security.c +++ b/examples/lightclient/object_security.c @@ -110,7 +110,7 @@ static uint8_t prv_get_value(lwm2m_data_t * dataP, case LWM2M_SECURITY_SMS_KEY_PARAM_ID: // Here we return an opaque of 6 bytes containing a buggy value { - const char * value = "12345"; + const char *value = "12345"; lwm2m_data_encode_opaque((uint8_t *)value, 6, dataP); } return COAP_205_CONTENT; @@ -118,7 +118,7 @@ static uint8_t prv_get_value(lwm2m_data_t * dataP, case LWM2M_SECURITY_SMS_SECRET_KEY_ID: // Here we return an opaque of 32 bytes containing a buggy value { - const char * value = "1234567890abcdefghijklmnopqrstu"; + const char *value = "1234567890abcdefghijklmnopqrstu"; lwm2m_data_encode_opaque((uint8_t *)value, 32, dataP); } return COAP_205_CONTENT; diff --git a/examples/shared/commandline.h b/examples/shared/commandline.h index 68f0dd794..e5f491d8f 100644 --- a/examples/shared/commandline.h +++ b/examples/shared/commandline.h @@ -23,9 +23,9 @@ typedef void (*command_handler_t) (lwm2m_context_t *lwm2mH, char * args, void * typedef struct { - const char * name; - const char * shortDesc; - const char * longDesc; + const char *name; + const char *shortDesc; + const char *longDesc; command_handler_t callback; void * userData; } command_desc_t; diff --git a/examples/shared/dtlsconnection.c b/examples/shared/dtlsconnection.c index 0a6c9d249..0d9b7cac5 100644 --- a/examples/shared/dtlsconnection.c +++ b/examples/shared/dtlsconnection.c @@ -35,7 +35,8 @@ typedef struct _dtls_app_context_ } dtls_app_context_t; /********************* Security Obj Helpers **********************/ -char * security_get_uri(lwm2m_context_t * lwm2mH, lwm2m_object_t * obj, int instanceId, char * uriBuffer, size_t bufferSize){ +char *security_get_uri(lwm2m_context_t *lwm2mH, lwm2m_object_t *obj, int instanceId, char *uriBuffer, + size_t bufferSize) { int size = 1; lwm2m_data_t * dataP = lwm2m_data_new(size); dataP->id = 0; // security server uri @@ -74,7 +75,7 @@ int64_t security_get_mode(lwm2m_context_t * lwm2mH, lwm2m_object_t * obj, int in return LWM2M_SECURITY_MODE_NONE; } -char * security_get_public_id(lwm2m_context_t * lwm2mH, lwm2m_object_t * obj, int instanceId, size_t * length){ +char *security_get_public_id(lwm2m_context_t *lwm2mH, lwm2m_object_t *obj, int instanceId, size_t *length) { int size = 1; lwm2m_data_t * dataP = lwm2m_data_new(size); dataP->id = 3; // public key or id @@ -99,8 +100,7 @@ char * security_get_public_id(lwm2m_context_t * lwm2mH, lwm2m_object_t * obj, in } } - -char * security_get_secret_key(lwm2m_context_t * lwm2mH, lwm2m_object_t * obj, int instanceId, size_t * length){ +char *security_get_secret_key(lwm2m_context_t *lwm2mH, lwm2m_object_t *obj, int instanceId, size_t *length) { int size = 1; lwm2m_data_t * dataP = lwm2m_data_new(size); dataP->id = 5; // secret key