Skip to content

Commit c364684

Browse files
committed
Silence compile-time warnings from code generator codes
1 parent 54d4ba5 commit c364684

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

mccode/src/cogen.c.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,7 @@ int cogen_rt_funnel(struct instr_def *instr)
23062306
coutf("#endif // FUNNEL");
23072307
coutf("");
23082308
printf("\n-----------------------------------------------------------\n");
2309+
return(warnings);
23092310
} /* cogen_rt_funnel */
23102311

23112312
/*******************************************************************************
@@ -2494,7 +2495,7 @@ cogen_header(struct instr_def *instr, char *output_name)
24942495
cliter2 = list_iterate(ctypes);
24952496
char *cvar;
24962497
char *ctpe;
2497-
while(cvar = list_next(cliter)) {
2498+
while((cvar = list_next(cliter))) {
24982499
ctpe = list_next(cliter2);
24992500
char *Numberedvar = malloc(256*sizeof(char));
25002501
/* We need to attach comp index to cvar */
@@ -3115,7 +3116,7 @@ void detect_skipable_transforms(struct instr_def *instr) {
31153116
// Its target can not be skipped either
31163117
struct jump_struct *this_jump;
31173118
List_handle literJ = list_iterate(comp->jump);
3118-
while (this_jump = list_next(literJ)) {
3119+
while ((this_jump = list_next(literJ))) {
31193120

31203121
// Find target (not initialized yet)
31213122
List_handle liter3 = list_iterate(instr->complist);

mccode/src/pygen.c.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ int cogen_decls(struct instr_def *instr)
402402
while ((one_component_metadata = symtab_next(component_metadata_handle))) {
403403
coutf(" '%s': {", one_component_metadata->name);
404404
liter = list_iterate(one_component_metadata->val);
405-
while (metadataStruct = list_next(liter)) {
405+
while ((metadataStruct = list_next(liter))) {
406406
coutf(" '%s': ('%s', ", metadataStruct->name, metadataStruct->type);
407407
triple_escaped_lines_out(metadataStruct->lines);
408408
coutf(" ), ");
@@ -924,7 +924,7 @@ void detect_skipable_transforms(struct instr_def *instr) {
924924
// Its target can not be skipped either
925925
struct jump_struct *this_jump;
926926
List_handle literJ = list_iterate(comp->jump);
927-
while (this_jump = list_next(literJ)) {
927+
while ((this_jump = list_next(literJ))) {
928928

929929
// Find target (not initialized yet)
930930
List_handle liter3 = list_iterate(instr->complist);

0 commit comments

Comments
 (0)