summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
diff options
context:
space:
mode:
authorPeter Eisentraut2022-05-13 05:17:29 +0000
committerPeter Eisentraut2022-05-13 05:17:29 +0000
commit30ed71e423ee63b263730b86326da2a629a29f84 (patch)
treea9a45b929b38cbef8f99d05da6419ef2e56b5781 /src/interfaces/ecpg
parent0cf16cb8ca4853b084c40eca310c4c9c3ebf7e2a (diff)
Indent C code in flex and bison files
In the style of pgindent, done semi-manually. Discussion: https://www.postgresql.org/message-id/flat/7d062ecc-7444-23ec-a159-acd8adf9b586%40enterprisedb.com
Diffstat (limited to 'src/interfaces/ecpg')
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 2367b860f5..996718cb8a 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -99,9 +99,9 @@ static short preproc_tos;
static bool ifcond;
static struct _if_value
{
- bool active;
- bool saw_active;
- bool else_branch;
+ bool active;
+ bool saw_active;
+ bool else_branch;
} stacked_if_value[MAX_NESTED_IF];
%}
@@ -1031,7 +1031,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
char* endptr;
errno = 0;
- base_yylval.ival = strtoul((char *)yytext,&endptr,16);
+ base_yylval.ival = strtoul((char *) yytext, &endptr, 16);
if (*endptr != '\0' || errno == ERANGE)
{
errno = 0;
@@ -1166,7 +1166,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
*/
for (i = strlen(yytext)-2;
i > 0 && ecpg_isspace(yytext[i]);
- i-- )
+ i--)
;
yytext[i+1] = '\0';
@@ -1290,7 +1290,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
}
<C,xskip>{exec_sql}{else}{space}*";" { /* only exec sql endif pops the stack, so take care of duplicated 'else' */
- if ( preproc_tos == 0 )
+ if (preproc_tos == 0)
mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
else if (stacked_if_value[preproc_tos].else_branch)
mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE");
@@ -1312,7 +1312,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
- if ( preproc_tos == 0 )
+ if (preproc_tos == 0)
mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
else if (stacked_if_value[preproc_tos].else_branch)
mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE");
@@ -1382,7 +1382,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
*/
for (i = strlen(yytext)-2;
i > 0 && ecpg_isspace(yytext[i]);
- i-- )
+ i--)
;
yytext[i+1] = '\0';
@@ -1456,7 +1456,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
<<EOF>> {
if (yy_buffer == NULL)
{
- if ( preproc_tos > 0 )
+ if (preproc_tos > 0)
{
preproc_tos = 0;
mmfatal(PARSE_ERROR, "missing \"EXEC SQL ENDIF;\"");
@@ -1479,7 +1479,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
if (yyin != NULL)
fclose(yyin);
- yy_delete_buffer( YY_CURRENT_BUFFER );
+ yy_delete_buffer(YY_CURRENT_BUFFER);
yy_switch_to_buffer(yy_buffer->buffer);
yylineno = yy_buffer->lineno;
@@ -1661,7 +1661,7 @@ parse_include(void)
if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
{
strcat(inc_file, ".h");
- yyin = fopen( inc_file, "r" );
+ yyin = fopen(inc_file, "r");
}
}
/* if the command was "include_next" we have to disregard the first hit */
@@ -1677,7 +1677,7 @@ parse_include(void)
mmfatal(NO_INCLUDE_FILE, "could not open include file \"%s\" on line %d", yytext, yylineno);
input_filename = mm_strdup(inc_file);
- yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ));
+ yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
yylineno = 1;
output_line_number();