summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_dynarray.h
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-04-13 08:59:49 +0100
committerMichal Krol <[email protected]>2010-04-13 09:00:39 +0100
commitddc42b6380d0380a6f519df268a8b3531ddb81fb (patch)
tree4beaaccfb36edaf387bb95b83fded1ef0e6bf289 /src/gallium/auxiliary/util/u_dynarray.h
parenta79521d497bc87309cadc49f3a414703497522bc (diff)
util: Fix util_dynarray_trim().
Diffstat (limited to 'src/gallium/auxiliary/util/u_dynarray.h')
-rw-r--r--src/gallium/auxiliary/util/u_dynarray.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/util/u_dynarray.h b/src/gallium/auxiliary/util/u_dynarray.h
index 5597581ef3e..9d1c1713a7c 100644
--- a/src/gallium/auxiliary/util/u_dynarray.h
+++ b/src/gallium/auxiliary/util/u_dynarray.h
@@ -87,15 +87,16 @@ util_dynarray_grow(struct util_dynarray *buf, int diff)
static INLINE void
util_dynarray_trim(struct util_dynarray *buf)
{
- if(buf->size != buf->capacity)
- {}
- else if(buf->size) {
- buf->data = REALLOC(buf->data, buf->capacity, buf->size);
- buf->capacity = buf->size;
- } else {
- FREE(buf->data);
- buf->data = 0;
- buf->capacity = 0;
+ if (buf->size != buf->capacity) {
+ if (buf->size) {
+ buf->data = REALLOC(buf->data, buf->capacity, buf->size);
+ buf->capacity = buf->size;
+ }
+ else {
+ FREE(buf->data);
+ buf->data = 0;
+ buf->capacity = 0;
+ }
}
}