summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-08-18 05:15:55 +0000
committerrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-08-18 05:15:55 +0000
commit9360a0e3ea960cd76f9ca98f3ada1cc2f4c00b28 (patch)
tree0d96765db4539a4eaa5ea103db7abb2cb9b88426
parent5099c01f5fd40a944159f228e6e3dad80147d0d0 (diff)
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
-rw-r--r--src/util/ParseFile.c48
1 files 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;
}