cmdutils: add a macro to simplify grow_array() calls.

This commit is contained in:
Anton Khirnov
2012-06-07 21:52:07 +02:00
parent 9e696d2e5f
commit 10bca66101
3 changed files with 18 additions and 27 deletions

View File

@ -418,6 +418,9 @@ FILE *get_preset_file(char *filename, size_t filename_size,
*/
void *grow_array(void *array, int elem_size, int *size, int new_size);
#define GROW_ARRAY(array, nb_elems)\
array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1)
typedef struct FrameBuffer {
uint8_t *base[4];
uint8_t *data[4];