Format with uncrustify

This commit is contained in:
Pim van Pelt
2018-11-04 16:45:23 +01:00
parent 31dcf28ff0
commit 5b79487ab8
2 changed files with 10 additions and 7 deletions

View File

@ -127,6 +127,7 @@ static void rpc_timespec_get_handler(struct mg_rpc_request_info *ri, void *cb_ar
struct mgos_timespec *ts;
char buf[200];
int idx;
rpc_log(ri, args);
json_scanf(args.p, args.len, ri->args_fmt, &idx);
@ -135,7 +136,7 @@ static void rpc_timespec_get_handler(struct mg_rpc_request_info *ri, void *cb_ar
ri = NULL;
return;
}
ts=channel_get_timespec(idx);
ts = channel_get_timespec(idx);
if (!ts) {
mg_rpc_send_errorf(ri, 400, "timespec on channel %d isn't set", idx);
ri = NULL;
@ -166,7 +167,7 @@ static void rpc_timespec_clear_handler(struct mg_rpc_request_info *ri, void *cb_
ri = NULL;
return;
}
ts=channel_get_timespec(idx);
ts = channel_get_timespec(idx);
if (!ts) {
mg_rpc_send_errorf(ri, 400, "timespec on channel %d isn't set", idx);
ri = NULL;
@ -200,7 +201,7 @@ static void rpc_timespec_add_handler(struct mg_rpc_request_info *ri, void *cb_ar
ri = NULL;
goto exit;
}
ts=channel_get_timespec(idx);
ts = channel_get_timespec(idx);
if (!ts) {
mg_rpc_send_errorf(ri, 400, "timespec on channel %d isn't set", idx);
ri = NULL;
@ -217,7 +218,9 @@ static void rpc_timespec_add_handler(struct mg_rpc_request_info *ri, void *cb_ar
ri = NULL;
exit:
if (spec) free(spec);
if (spec) {
free(spec);
}
(void)cb_arg;
(void)fi;
}

View File

@ -240,7 +240,7 @@ bool timespec_get_spec(struct mgos_timespec *ts, char *ret, int retlen) {
snprintf(spec_str, sizeof(spec_str) - 1, "%02d:%02d:%02d-%02d:%02d:%02d", t_spec->start_h, t_spec->start_m, t_spec->start_s,
t_spec->stop_h, t_spec->stop_m, t_spec->stop_s);
if ((int) (strlen(spec_str) + strlen(ret)) > retlen - 1) {
if ((int)(strlen(spec_str) + strlen(ret)) > retlen - 1) {
return false;
}
if (strlen(ret) > 0) {