[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Confuse-devel] [PATCH 3/7] tests: ISO C90 forbids mixed declarations an
From: |
Carlo Marcelo Arenas Belon |
Subject: |
[Confuse-devel] [PATCH 3/7] tests: ISO C90 forbids mixed declarations and code |
Date: |
Sat, 27 Mar 2010 03:08:30 -0700 |
move declarations to the begin of each block where they are being used
Signed-off-by: Carlo Marcelo Arenas Belon <address@hidden>
---
tests/list_plus_syntax.c | 9 +++++----
tests/quote_before_print.c | 6 ++++--
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/list_plus_syntax.c b/tests/list_plus_syntax.c
index 76f62f7..53f48e7 100644
--- a/tests/list_plus_syntax.c
+++ b/tests/list_plus_syntax.c
@@ -8,13 +8,14 @@ int main(void)
CFG_END()
};
+ int rc;
cfg_t *cfg = cfg_init(opts, CFGF_NONE);
fail_unless(cfg);
- int rc = cfg_parse_buf(cfg,
- " stringproperty = {\"this\"}\n"
- " stringproperty += {\"that\"}\n"
- " stringproperty += {\"other\"}\n");
+ rc = cfg_parse_buf(cfg,
+ " stringproperty = {\"this\"}\n"
+ " stringproperty += {\"that\"}\n"
+ " stringproperty += {\"other\"}\n");
fail_unless(rc == CFG_SUCCESS);
diff --git a/tests/quote_before_print.c b/tests/quote_before_print.c
index 15b02b9..e7e1df7 100644
--- a/tests/quote_before_print.c
+++ b/tests/quote_before_print.c
@@ -16,6 +16,8 @@ cfg_opt_t opts[] =
int
main(void)
{
+ FILE *fp;
+ char *param;
cfg_t *cfg = cfg_init(opts, CFGF_NONE);
fail_unless(cfg);
@@ -25,7 +27,7 @@ main(void)
/* print the config to a temporary file
*/
- FILE *fp = tmpfile();
+ fp = tmpfile();
fail_unless(fp);
cfg_print(cfg, fp);
cfg_free(cfg);
@@ -38,7 +40,7 @@ main(void)
fail_unless(cfg_parse_fp(cfg, fp) == CFG_SUCCESS);
fail_unless(fclose(fp) == 0);
- char *param = cfg_getstr(cfg, "parameter");
+ param = cfg_getstr(cfg, "parameter");
fail_unless(param);
fail_unless(strcmp(param, "text \" with quotes and \\") == 0);
--
1.7.0.1
- [Confuse-devel] [PATCH 0/7] trivial compilation fixes for linux., Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 1/7] confuse: ISO C90 does not support the ‘%lf’ printf format, Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 3/7] tests: ISO C90 forbids mixed declarations and code,
Carlo Marcelo Arenas Belon <=
- [Confuse-devel] [PATCH 5/7] examples: declare source as GNU for strdup definition, Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 6/7] tests: declare source as GNU for inet_aton definition, Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 4/7] tests: initializer element is not computable at load time, Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 2/7] tests: C++ style comments are not allowed in ISO C90, Carlo Marcelo Arenas Belon, 2010/03/27
- [Confuse-devel] [PATCH 7/7] confuse: declare source as GNU for fileno definition and consolidated code, Carlo Marcelo Arenas Belon, 2010/03/27
- Re: [Confuse-devel] [PATCH 0/7] trivial compilation fixes for linux., Martin Hedenfalk, 2010/03/27