Commit 03de538b authored by Matthias Braun's avatar Matthias Braun
Browse files

DEL_ARR_F should not use a const pointer

[r17964]
parent 8c3d620d
......@@ -337,11 +337,11 @@ typedef ARR_STRUCT (aligned_type, 1) _arr_descr;
extern _arr_descr arr_mt_descr;
void *_new_arr_f (int, size_t);
void _del_arr_f (void *);
void *_new_arr_f (int nelts, size_t elts_size);
void _del_arr_f (void *elts);
void *_new_arr_d (struct obstack *obstack, int nelts, size_t elts_size);
void *_arr_resize (void *, int, size_t);
void *_arr_setlen (void *, int, size_t);
void *_arr_resize (void *elts, int nelts, size_t elts_size);
void *_arr_setlen (void *elts, int nelts, size_t elts_size);
#define _ARR_ELTS_OFFS offsetof (_arr_descr, v.elts)
#define _ARR_DESCR(elts) ((_arr_descr *)(void *)((char *)(elts) - _ARR_ELTS_OFFS))
......
......@@ -109,8 +109,8 @@ void *_new_arr_f(int nelts, size_t elts_size) {
*
* @remark Helper function, use DEL_ARR_F() instead.
*/
void _del_arr_f(const void *elts) {
const _arr_descr *dp = _ARR_DESCR (elts);
void _del_arr_f(void *elts) {
_arr_descr *dp = _ARR_DESCR (elts);
ARR_VRFY (elts);
assert (dp->magic == ARR_F_MAGIC);
......@@ -121,7 +121,7 @@ void _del_arr_f(const void *elts) {
wdp->magic = 0xdeadbeef;
}
#endif
free((void *)dp);
free(dp);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment