From a8e1368697f6a32e6688e126a2c0addd7b4d5f30 Mon Sep 17 00:00:00 2001 From: Stephan Gatzka Date: Sat, 26 Nov 2016 15:18:07 +0100 Subject: [PATCH] Make function static when possible. This is a prerequisite to later enable -Wmissing-prototypes. --- test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test.c b/test.c index 7706d97..e079d0a 100644 --- a/test.c +++ b/test.c @@ -25,7 +25,7 @@ #include "cJSON.h" /* Parse text to JSON, then render back to text, and print! */ -void doit(char *text) +static void doit(char *text) { char *out = NULL; cJSON *json = NULL; @@ -44,8 +44,9 @@ void doit(char *text) } } +#if 0 /* Read a file, parse, render back, etc. */ -void dofile(char *filename) +static void dofile(char *filename) { FILE *f = NULL; long len = 0; @@ -67,6 +68,7 @@ void dofile(char *filename) doit(data); free(data); } +#endif /* Used by some code below as an example datatype. */ struct record @@ -82,7 +84,7 @@ struct record }; /* Create a bunch of objects as demonstration. */ -void create_objects(void) +static void create_objects(void) { /* declare a few. */ cJSON *root = NULL; -- GitLab