Skip to content

Commit eee2041

Browse files
committed
Merge remote-tracking branch 'remotes/DanielCortez/w244' into dev
2 parents c072de0 + 466e691 commit eee2041

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

source/compiler/sc1.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6071,7 +6071,7 @@ static void doswitch(void)
60716071
int swdefault,casecount;
60726072
int tok,endtok;
60736073
int swtag,csetag;
6074-
int enumsymcount,diff;
6074+
int enumsymcount;
60756075
int save_fline;
60766076
symbol *enumsym,*csesym;
60776077
int ident;
@@ -6219,7 +6219,7 @@ static void doswitch(void)
62196219
} while (tok!=endtok);
62206220
restoreassignments(pc_nestlevel+1,assignments);
62216221

6222-
if (enumsym!=NULL && swdefault==FALSE && (diff=enumsym->x.tags.unique-enumsymcount)<=2) {
6222+
if (enumsym!=NULL && swdefault==FALSE && enumsym->x.tags.unique-enumsymcount<=2) {
62236223
constvalue_root *enumlist=enumsym->dim.enumlist;
62246224
constvalue *val,*prev=NULL,*save_next=NULL;
62256225
for (val=enumlist->first; val!=NULL; prev=val,val=val->next) {
@@ -6237,8 +6237,9 @@ static void doswitch(void)
62376237
/* check if the value of this constant is handled in switch, if so - continue */
62386238
if (find_constval_byval(&caselist,val->value)!=NULL)
62396239
continue;
6240+
errorset(sSETPOS,save_fline);
62406241
error(244,val->name); /* enum element not handled in switch */
6241-
/* */
6242+
errorset(sSETPOS,-1);
62426243
} /* while */
62436244
} /* if */
62446245

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
'test_type': 'output_check',
33
'errors': """
4-
warning_244.pwn(37) : warning 244: enum element "CONST2_3" not handled in switch
5-
warning_244.pwn(37) : warning 244: enum element "CONST2_5" not handled in switch
4+
warning_244.pwn(30) : warning 244: enum element "CONST2_3" not handled in switch
5+
warning_244.pwn(30) : warning 244: enum element "CONST2_5" not handled in switch
66
"""
77
}

0 commit comments

Comments
 (0)