pike.git/
src/
array.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-05-06
2014-05-06 09:12:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>
49225bea73c0f498ea8bb8356352bc3fdece4d85 (
13
lines) (+
13
/-
0
)
[
Show
|
Annotate
]
Branch:
8.0
Runtime: Added clear_array().
176:
} /**
+
* Free all elements in an array and set them to zero.
+
*/
+
PMOD_EXPORT void clear_array(struct array *a)
+
{
+
if (!a->size) return;
+
free_svalues(ITEM(a), a->size, a->type_field);
+
/* NB: We know that INT_T == 0. */
+
MEMSET(ITEM(a), 0, a->size * sizeof(struct svalue));
+
a->type_field = BIT_INT;
+
}
+
+
/**
* Set the flags on an array. If the array is empty then only the * weak flag is significant. */