Skip to content

Commit f955754

Browse files
authored
Merge pull request #1 from nimble-code/master
Just update
2 parents 44fda4b + 485e804 commit f955754

5 files changed

Lines changed: 29 additions & 18 deletions

File tree

Src/c_gram.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,7 @@ extern int
18201820
is_recorded(char *s, char *f)
18211821
{ Recorded *r;
18221822

1823+
if (f && strlen(f) > 0)
18231824
for (r = recorded; r; r = r->nxt)
18241825
if (strcmp(r->fct, s) == 0
18251826
&& (r->isstatic == 0 || strcmp(r->fnm, f) == 0))

Src/heap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ HeapAlloc_Gen(Heap *heap)
154154
}
155155

156156
heap->hunks[heap->num_hunks] =
157-
(void *) emalloc(heap->chnk_sze * heap->ch_ratio);
157+
(void *) emalloc((size_t) heap->chnk_sze * (size_t) heap->ch_ratio);
158158

159159
#ifdef DEBUG
160160
printf("2 chunk allocate at %p -- %d * %d bytes\n",
@@ -171,7 +171,7 @@ HeapAlloc_Gen(Heap *heap)
171171
+ (heap->chnk_sze * chnk)));
172172
}
173173
} else
174-
{ heap->hunks[0] = (void *) emalloc(heap->chnk_sze * heap->ch_ratio);
174+
{ heap->hunks[0] = (void *) emalloc((size_t) heap->chnk_sze * (size_t) heap->ch_ratio);
175175
#ifdef DEBUG
176176
printf("1 chunk allocate at %p -- %d * %d bytes\n",
177177
heap->hunks[0], heap->chnk_sze, heap->ch_ratio);

Src/makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
#
2626
BINDIR=/usr/local/bin/
2727
# note the terminal / in the above line is needed
28+
## 2019: too make extensions are made in the gcc headerfiles to allow the
29+
## builtin parser to sill work reliably
2830
CC=gcc
29-
CFLAGS=-DPC -ansi -Wall -m32 -ggdb -DCPP="\"gcc -E\"" -DBINDIR=\"$(BINDIR)\"
31+
CFLAGS=-DPC -ansi -Wall -g -DCPP="\"gcc -E -D__extension__= -D__inline__= -D_Noreturn= -D__typeof__= \"" -DBINDIR=\"$(BINDIR)\"
3032

3133
# on PC add:
3234
# -DPC

Src/uno_local.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,23 +521,29 @@ main(int argc, char **argv)
521521
if (parse_tree
522522
&& !see_extern_fcts
523523
&& !see_static_fcts)
524-
lts_start(parse_tree); /* uno_lts.c */
524+
{ lts_start(parse_tree); /* uno_lts.c */
525+
}
525526

526527
if (show_syms)
527-
show_symtab(contxt->syms, stdout);
528+
{ show_symtab(contxt->syms, stdout);
529+
}
528530

529531
if (Verbose)
530-
memstats();
532+
{ memstats();
533+
}
531534

532535
free_context(contxt); /* done with this file */
533536

534537
while (!is_empty(ParseStack))
535-
delete_stk_item(pop(ParseStack));
538+
{ delete_stk_item(pop(ParseStack));
539+
}
536540

537541
if (Verbose>1) printf("parsestack\n");
538542

539543
while (!is_empty(DoneStack))
540-
delete_stk_item(Parse_TOS = pop(DoneStack));
544+
{ delete_stk_item(Parse_TOS = pop(DoneStack));
545+
}
546+
541547
if (Verbose>1) printf("donestack\n");
542548

543549
Parse_TOS = (Stk_Item *) 0;

Src/uno_lts.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,10 +2311,12 @@ ana_work(DefUse *d, SymList *s, treenode *n)
23112311

23122312
if (uno_ignore(s->sm) /* symbol declared in "/usr/include/.." */
23132313
|| (s->mark & REF2)) /* x->ref2 or x.ref2 -- compounds not yet */
2314-
return;
2314+
{ return;
2315+
}
23152316

23162317
if (uno_p == 4) /* the default */
2317-
uno_bounds(s, d->aio, n); /* array bounds */
2318+
{ uno_bounds(s, d->aio, n); /* array bounds */
2319+
}
23182320

23192321
try_again:
23202322
if (s->mark & FCALL)
@@ -2334,18 +2336,19 @@ ana_work(DefUse *d, SymList *s, treenode *n)
23342336
g->nxt = grst;
23352337
grst = g;
23362338
}
2337-
23382339
return;
23392340
} else if (is_recorded(s->sm->nme->str, n->hdr.fnm)) /* function name from prototype def */
23402341
{ s->mark |= FCALL;
23412342
goto try_again;
23422343
} else
2343-
if (debug) printf("\tnot a fcall...\n");
2344+
{ if (debug) printf("\tnot a fcall...\n");
2345+
}
23442346

23452347
if (s->sm->decl_level < FUNCTION_SCOPE)
2346-
global_var(s, n);
2347-
else
2348-
local_var(s, n);
2348+
{ global_var(s, n);
2349+
} else
2350+
{ local_var(s, n);
2351+
}
23492352
}
23502353

23512354
static void
@@ -2838,12 +2841,11 @@ dfs_uno(State *s)
28382841
dfstack->state->exp = s->n;
28392842
dfstack->state->val = ZT;
28402843
}
2841-
28422844
dfs_uno(t->branch);
28432845

28442846
if (exp)
2845-
prevpathcond();
2846-
else
2847+
{ prevpathcond();
2848+
} else
28472849
{ dfstack->state->nxt = pathfree;
28482850
pathfree = dfstack->state;
28492851
dfstack->state = (PathCond *) 0;

0 commit comments

Comments
 (0)