From 9360a0e3ea960cd76f9ca98f3ada1cc2f4c00b28 Mon Sep 17 00:00:00 2001 From: rhaas Date: Mon, 18 Aug 2014 05:15:55 +0000 Subject: unify indentation in Piraha parser whitespace and const added only git-svn-id: http://svn.cactuscode.org/flesh/trunk@5124 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/ParseFile.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/util/ParseFile.c b/src/util/ParseFile.c index c35c5037..73d8c000 100644 --- a/src/util/ParseFile.c +++ b/src/util/ParseFile.c @@ -131,29 +131,31 @@ int ParseFile(FILE *ifp, if (!buffer) return 1; - int piraha_active = 1; - - if(piraha_active) { - // the new way - buffersize = strlen(buffer); - - retval = cctk_PirahaParser(buffer,buffersize,set_function); - } else { - // The old way - /* Ensure Unix line endings */ - convert_crlf_to_lf(buffer); - buffersize = strlen(buffer); - - buffer = ParseDefines(buffer, &buffersize); - /* ParseBuffer can get confused with detecting the end of the buffer - (when in a comment or in a string), and may overrun. Therefore - we allocate a buffer that is a bit longer. */ - { - buffer = realloc (buffer, strlen(buffer) + 10); - memset (buffer+strlen(buffer), '\0', 10); - } - retval = ParseBuffer(buffer, set_function, ConfigData); - free(buffer); + const int piraha_active = 1; + if(piraha_active) + { + /* the new way */ + buffersize = strlen(buffer); + + retval = cctk_PirahaParser(buffer, buffersize, set_function); + } + else + { + /* The old way */ + /* Ensure Unix line endings */ + convert_crlf_to_lf(buffer); + buffersize = strlen(buffer); + + buffer = ParseDefines(buffer, &buffersize); + /* ParseBuffer can get confused with detecting the end of the buffer + (in comment or in a string), and may overrun. Therefore + we te a buffer that is a bit longer. */ + { + buffer = realloc (buffer, strlen(buffer) + 10); + memset (buffer+strlen(buffer), '\0', 10); + } + retval = ParseBuffer(buffer, set_function, ConfigData); + free(buffer); } return retval; } -- cgit v1.2.3