| 1346 | /* Insert the new element ELEM to the re_node_set* SET. |
| 1347 | SET should not already have any element greater than or equal to ELEM. |
| 1348 | Return -1 if an error has occurred, return 1 otherwise. */ |
| 1349 | |
| 1350 | static int |
| 1351 | internal_function |
| 1352 | re_node_set_insert_last (re_node_set *set, int elem) |
| 1353 | { |
| 1354 | /* Realloc if we need. */ |
| 1355 | if (set->alloc == set->nelem) |
| 1356 | { |
| 1357 | int *new_elems; |
| 1358 | set->alloc = (set->alloc + 1) * 2; |
| 1359 | new_elems = re_realloc (set->elems, int, set->alloc); |
| 1360 | if (BE (new_elems == NULL, 0)) |
| 1361 | return -1; |
| 1362 | set->elems = new_elems; |
| 1363 | } |
| 1364 | |
| 1365 | /* Insert the new element. */ |
| 1366 | set->elems[set->nelem++] = elem; |
| 1367 | return 1; |
| 1368 | } |
| 1369 |
no outgoing calls
no test coverage detected