src/buffer.c

changeset 536
cb9b9739055e
parent 534
0e893f84a7dd
child 538
2cfbcbe86a7c
equal deleted inserted replaced
535:2ff6e9184468 536:cb9b9739055e
117 ) { 117 ) {
118 if (newcap <= buffer->capacity) { 118 if (newcap <= buffer->capacity) {
119 return 0; 119 return 0;
120 } 120 }
121 121
122 if (cxReallocate(buffer->allocator, &buffer->bytes, newcap) == 0) { 122 if (cxReallocate(buffer->allocator,
123 (void **) &buffer->bytes, newcap) == 0) {
123 buffer->capacity = newcap; 124 buffer->capacity = newcap;
124 return 0; 125 return 0;
125 } else { 126 } else {
126 return -1; 127 return -1;
127 } 128 }

mercurial