diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-06-11 17:18:58 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-06-11 17:20:13 -0700 |
commit | 3dc36216f168f4e752b648b19d85eab32a037827 (patch) | |
tree | 3ebd5d8d04256f8a20d15c8ab0424eadee838038 /lib/stack.h | |
parent | d4e7edeb474203904b55ef575b3e57157c26e080 (diff) | |
download | gnulib-3dc36216f168f4e752b648b19d85eab32a037827.tar.gz |
stack: prefer idx_t for indexes
* lib/stack.h (_GL_STACK_TYPE, _GL_STACK_PREFIX):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.
Diffstat (limited to 'lib/stack.h')
-rw-r--r-- | lib/stack.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stack.h b/lib/stack.h index dfd57501f6..9c3afe724b 100644 --- a/lib/stack.h +++ b/lib/stack.h @@ -78,7 +78,7 @@ typedef struct { GL_STACK_ELEMENT *base; size_t size; - size_t allocated; + idx_t allocated; } _GL_STACK_TYPE; /* Initialize a stack. */ @@ -119,8 +119,8 @@ GL_STACK_STORAGECLASS void _GL_STACK_PREFIX (push) (_GL_STACK_TYPE *stack, GL_STACK_ELEMENT item) { if (stack->size == stack->allocated) - stack->base = x2nrealloc (stack->base, &stack->allocated, - sizeof (GL_STACK_ELEMENT)); + stack->base = xpalloc (stack->base, &stack->allocated, 1, -1, + sizeof *stack->base);; stack->base [stack->size++] = item; } |