Commit 44d9e966 authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Indent

parent 30e20536
...@@ -104,7 +104,10 @@ do_json_cb(void *priv, const struct VSC_point * const pt) ...@@ -104,7 +104,10 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
val = *(const volatile uint64_t*)pt->ptr; val = *(const volatile uint64_t*)pt->ptr;
sec = pt->section; sec = pt->section;
if (*jp) *jp = 0; else printf(",\n"); if (*jp)
*jp = 0;
else
printf(",\n");
printf("\t\""); printf("\t\"");
/* build the JSON key name. */ /* build the JSON key name. */
...@@ -113,19 +116,17 @@ do_json_cb(void *priv, const struct VSC_point * const pt) ...@@ -113,19 +116,17 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
if (sec->fantom->ident[0]) if (sec->fantom->ident[0])
printf("%s.", sec->fantom->ident); printf("%s.", sec->fantom->ident);
printf("%s\": {", pt->desc->name); printf("%s\": {", pt->desc->name);
if (strcmp(sec->fantom->type, ""))
if (strcmp(sec->fantom->type, "")) printf("\"type\": \"%s\", ", printf("\"type\": \"%s\", ", sec->fantom->type);
sec->fantom->type); if (strcmp(sec->fantom->ident, ""))
if (strcmp(sec->fantom->ident, "")) printf("\"ident\": \"%s\", ", printf("\"ident\": \"%s\", ", sec->fantom->ident);
sec->fantom->ident);
printf("\"value\": %ju, ", (uintmax_t)val); printf("\"value\": %ju, ", (uintmax_t)val);
printf("\"flag\": \"%c\", ", pt->desc->flag); printf("\"flag\": \"%c\", ", pt->desc->flag);
printf("\"description\": \"%s\"", pt->desc->sdesc); printf("\"description\": \"%s\"", pt->desc->sdesc);
printf("}"); printf("}");
if (*jp) printf("\n"); if (*jp)
printf("\n");
return (0); return (0);
} }
...@@ -325,12 +326,12 @@ main(int argc, char * const *argv) ...@@ -325,12 +326,12 @@ main(int argc, char * const *argv)
do_once(vd, VSC_Main(vd, NULL)); do_once(vd, VSC_Main(vd, NULL));
else if (f_list) else if (f_list)
list_fields(vd); list_fields(vd);
else { else
assert(0); assert(0);
} if (!do_repeat)
if (!do_repeat) break; break;
// end of output block marker. /* end of output block marker. */
printf("\n"); printf("\n");
(void)usleep(delay * 1e6); (void)usleep(delay * 1e6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment