rt: Do some casting to avoid warnings

This commit is contained in:
Brian Anderson 2012-12-15 19:53:55 -08:00
parent 91067e9df4
commit 20ea37b336
2 changed files with 3 additions and 3 deletions

View file

@ -91,7 +91,7 @@ memory_region::realloc(void *mem, size_t orig_size) {
fprintf(stderr,
"memory_region::realloc> "
"Out of memory allocating %ld bytes",
size);
(long int) size);
abort();
}
@ -129,7 +129,7 @@ memory_region::malloc(size_t size, const char *tag, bool zero) {
fprintf(stderr,
"memory_region::malloc> "
"Out of memory allocating %ld bytes",
size);
(long int) size);
abort();
}

View file

@ -73,7 +73,7 @@ array_list<T>::push(T value) {
size_t new_capacity = _capacity * 2;
void* buffer = realloc(_data, new_capacity * sizeof(T));
if (buffer == NULL) {
fprintf(stderr, "array_list::push> Out of memory allocating %ld bytes", new_capacity * sizeof(T));
fprintf(stderr, "array_list::push> Out of memory allocating %ld bytes", (long int) (new_capacity * sizeof(T)));
abort();
}
_data = (T *) buffer;