version 1.2, 2015/11/19 22:16:43 |
version 1.3, 2015/11/19 23:20:34 |
|
|
sf_push (void) |
sf_push (void) |
{ |
{ |
if (_sf_top_ix + 1 >= _sf_max) |
if (_sf_top_ix + 1 >= _sf_max) |
_sf_stk = (scanflags_t*) flex_realloc ( (void*) _sf_stk, sizeof(scanflags_t) * (_sf_max += 32)); |
_sf_stk = (scanflags_t*) realloc ( (void*) _sf_stk, sizeof(scanflags_t) * (_sf_max += 32)); |
|
|
// copy the top element |
// copy the top element |
_sf_stk[_sf_top_ix + 1] = _sf_stk[_sf_top_ix]; |
_sf_stk[_sf_top_ix + 1] = _sf_stk[_sf_top_ix]; |
|
|
sf_init (void) |
sf_init (void) |
{ |
{ |
assert(_sf_stk == NULL); |
assert(_sf_stk == NULL); |
_sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32)); |
_sf_stk = (scanflags_t*) malloc ( sizeof(scanflags_t) * (_sf_max = 32)); |
if (!_sf_stk) |
if (!_sf_stk) |
lerrsf_fatal(_("Unable to allocate %ld of stack"), |
lerrsf_fatal(_("Unable to allocate %ld of stack"), |
(void *)sizeof(scanflags_t)); |
(void *)sizeof(scanflags_t)); |