From 67a5cabb3ce948bcee72b269cd047ee39da9fe2e Mon Sep 17 00:00:00 2001 From: Stanislav Gromov Date: Thu, 19 Nov 2020 20:26:39 +0700 Subject: [PATCH] Fix clang warnings --- source/compiler/sc1.c | 5 +++-- source/compiler/sc2.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index b7fc74f..9b30d31 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -5674,7 +5674,7 @@ static void compound(int stmt_sameline,int starttok) error(30,block_start); /* compound block not closed at end of file */ break; } else { - if (count_stmt>0 && isterminal(lastst)) + if (count_stmt>0 && isterminal(lastst)) { if (matchtoken(tLABEL)) { cell val; char *name; @@ -5684,12 +5684,13 @@ static void compound(int stmt_sameline,int starttok) sym=findloc(name); /* before issuing a warning, check if the label was previously used (via 'goto') */ if (sym!=NULL && sym->ident==iLABEL && (sym->usage & uREAD)==0) - error(225); /* unreachable code */ + error(225); /* unreachable code */ } else if (lastst==tTERMSWITCH && matchtoken(tRETURN)) { lexpush(); /* push the token so it can be analyzed later */ } else { error(225); /* unreachable code */ } /* if */ + } /* if */ statement(&indent,TRUE); /* do a statement */ count_stmt++; } /* if */ diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index cac5fbc..99c5a1b 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -457,7 +457,7 @@ static void readline(unsigned char *line) * ends with the same multiline string, so that this won't trigger commands: * * new x[] = "Hello - * + * * #define X 0 * "; * @@ -608,9 +608,9 @@ static int stripcomment(unsigned char *line) } else { if (incommand==2 && *line>' ') { /* line starting a command, may need raw strings */ - if (strncmp(line, "#error", 6)==0 || - strncmp(line, "#warning", 8)==0 || - strncmp(line, "#pragma", 7)==0) { + if (strncmp((char*)line,"#error",6)==0 || + strncmp((char*)line,"#warning",8)==0 || + strncmp((char*)line,"#pragma",7)==0) { /* is one of the pre-processor commands with pure raw strings */ incommand=1; } else {