From aefe9be5db3f767c343bae56eb49621a78b7d5b2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Feb 2010 16:47:41 +0000 Subject: [#18961] Use const char * where appropriate (2.5) from Sean Bartell (wtachi) added own changes bpy_props.c --- intern/guardedalloc/MEM_guardedalloc.h | 2 +- intern/guardedalloc/intern/mallocn.c | 4 ++-- intern/guardedalloc/test/simpletest/memtest.c | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'intern/guardedalloc') diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 7f1a66564a7..45c2e048df9 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -122,7 +122,7 @@ extern "C" { void MEM_printmemlist_stats(void); /** Set the callback function for error output. */ - void MEM_set_error_callback(void (*func)(char *)); + void MEM_set_error_callback(void (*func)(const char *)); /** * Are the start/end block markers still correct ? diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index 677d756c8e6..806f8d183ba 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -135,7 +135,7 @@ static volatile uintptr_t mem_in_use= 0, mmap_in_use= 0; static volatile struct localListBase _membase; static volatile struct localListBase *membase = &_membase; -static void (*error_callback)(char *) = NULL; +static void (*error_callback)(const char *) = NULL; static void (*thread_lock_callback)(void) = NULL; static void (*thread_unlock_callback)(void) = NULL; @@ -197,7 +197,7 @@ int MEM_check_memory_integrity() } -void MEM_set_error_callback(void (*func)(char *)) +void MEM_set_error_callback(void (*func)(const char *)) { error_callback = func; } diff --git a/intern/guardedalloc/test/simpletest/memtest.c b/intern/guardedalloc/test/simpletest/memtest.c index ec72b0f01e5..51f1f491894 100644 --- a/intern/guardedalloc/test/simpletest/memtest.c +++ b/intern/guardedalloc/test/simpletest/memtest.c @@ -47,6 +47,12 @@ #include #endif +static void mem_error_cb(const char *errorStr) +{ + fprintf(stderr, "%s", errorStr); + fflush(stderr); +} + int main (int argc, char *argv[]) { int verbose = 0; @@ -75,7 +81,7 @@ int main (int argc, char *argv[]) /* Round one, do a normal allocation, and free the blocks again. */ /* ----------------------------------------------------------------- */ /* flush mem lib output to stderr */ - MEM_set_error_callback(stderr); + MEM_set_error_callback(mem_error_cb); for (i = 0; i < NUM_BLOCKS; i++) { int blocksize = 10000; -- cgit v1.2.3