Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
155e9851
Commit
155e9851
authored
Feb 08, 2011
by
Matthias Braun
Browse files
avoid some warnings by not using macros
[r28336]
parent
cd919d60
Changes
1
Show whitespace changes
Inline
Side-by-side
include/libfirm/adt/array.h
View file @
155e9851
...
...
@@ -173,9 +173,7 @@
/** Set a length smaller than the current length of the array. Do not
* resize. len must be <= ARR_LEN(arr). */
#define ARR_SHRINKLEN(arr,len) \
(ARR_VRFY((arr)), assert(ARR_DESCR((arr))->nelts >= len), \
ARR_DESCR((arr))->nelts = len)
static
inline
void
ARR_SHRINKLEN
(
void
*
arr
,
size_t
new_len
);
/**
* Resize a flexible array by growing it by delta elements.
...
...
@@ -255,6 +253,13 @@ FIRM_API void ir_verify_arr(const void *elts);
#define ARR_ELTS_OFFS offsetof(ir_arr_descr, elts)
#define ARR_DESCR(elts) ((ir_arr_descr *)(void *)((char *)(elts) - ARR_ELTS_OFFS))
static
inline
void
ARR_SHRINKLEN
(
void
*
arr
,
size_t
new_len
)
{
ARR_VRFY
(
arr
);
assert
(
ARR_DESCR
(
arr
)
->
nelts
>=
new_len
);
ARR_DESCR
(
arr
)
->
nelts
=
new_len
;
}
#include
"../end.h"
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment