Skip to content

Commit

Permalink
fix C for old compiler
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Dec 24, 2024
1 parent 94746c1 commit 6f4784b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bin/line_check: bin/line_check.c
$(CC) -O3 bin/line_check.c -o bin/line_check

bin/get_argument_list: bin/get_argument_list.c
$(CC) -O3 -g bin/get_argument_list.c $(JSON_C_LDFLAGS) $(JSON_C_CFLAGS) -o bin/get_argument_list
$(CC) -O3 -g --std=gnu17 bin/get_argument_list.c $(JSON_C_LDFLAGS) $(JSON_C_CFLAGS) -o bin/get_argument_list

bin/get_path_type: bin/get_path_type.c
$(CC) -O3 -g bin/get_path_type.c $(JSON_C_LDFLAGS) $(JSON_C_CFLAGS) -o bin/get_path_type
Expand Down
31 changes: 17 additions & 14 deletions bin/construct_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@ int main(int ac, char **av)
{
int buf_i;
char *componant_name = av[1];

char *brk;
again:
char *brk = strchr(componant_name, '{');
if (!brk) {
printf("\tosc_str_append_string(&e->endpoint, \"%s\");\n", componant_name);
return 0;
}
{
brk = strchr(componant_name, '{');
if (!brk) {
printf("\tosc_str_append_string(&e->endpoint, \"%s\");\n", componant_name);
return 0;
}

*brk = 0;
printf("\tosc_str_append_string(&e->endpoint, \"%s\");\n", componant_name);
*brk = 0;
printf("\tosc_str_append_string(&e->endpoint, \"%s\");\n", componant_name);

printf("\tosc_str_append_string(&e->endpoint, e->");
for (++brk; *brk != '}'; ++brk)
putchar(*brk);
puts(");");
componant_name = brk + 1;
goto again;
printf("\tosc_str_append_string(&e->endpoint, e->");
for (++brk; *brk != '}'; ++brk)
putchar(*brk);
puts(");");
componant_name = brk + 1;
goto again;
}
return 0;
}

0 comments on commit 6f4784b

Please sign in to comment.