From 25c2da6f7a4a5055b38b29dc2f167c97b9065156 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 28 Mar 2005 14:49:06 +0000 Subject: [PATCH] s/char */const char*/ as it's really more appropriate in some places, and some compilers complain about it. This commit was SVN r5061. --- src/util/malloc.c | 8 ++++---- src/util/malloc.h | 8 ++++---- src/util/output.c | 8 ++++---- src/util/output.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/util/malloc.c b/src/util/malloc.c index 7e6037dda2..8f4d5cc8d1 100644 --- a/src/util/malloc.c +++ b/src/util/malloc.c @@ -90,7 +90,7 @@ void ompi_malloc_finalize(void) /* * Debug version of malloc */ -void *ompi_malloc(size_t size, char *file, int line) +void *ompi_malloc(size_t size, const char *file, int line) { void *addr; if (ompi_malloc_debug_level > 1) { @@ -115,7 +115,7 @@ void *ompi_malloc(size_t size, char *file, int line) /* * Debug version of calloc */ -void *ompi_calloc(size_t nmembers, size_t size, char *file, int line) +void *ompi_calloc(size_t nmembers, size_t size, const char *file, int line) { void *addr; if (ompi_malloc_debug_level > 1) { @@ -141,7 +141,7 @@ void *ompi_calloc(size_t nmembers, size_t size, char *file, int line) /* * Debug version of realloc */ -void *ompi_realloc(void *ptr, size_t size, char *file, int line) +void *ompi_realloc(void *ptr, size_t size, const char *file, int line) { void *addr; @@ -173,7 +173,7 @@ void *ompi_realloc(void *ptr, size_t size, char *file, int line) /* * Debug version of free */ -void ompi_free(void *addr, char *file, int line) +void ompi_free(void *addr, const char *file, int line) { if (ompi_malloc_debug_level > 1 && NULL == addr) { ompi_output(ompi_malloc_output, "Invalid free (%s, %d)", file, line); diff --git a/src/util/malloc.h b/src/util/malloc.h index 495a485866..3967e9bf3a 100644 --- a/src/util/malloc.h +++ b/src/util/malloc.h @@ -80,7 +80,7 @@ void ompi_malloc_finalize(void); * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ -void *ompi_malloc(size_t size, char *file, int line); +void *ompi_malloc(size_t size, const char *file, int line); /** * \internal @@ -96,7 +96,7 @@ void *ompi_malloc(size_t size, char *file, int line); * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ -void *ompi_calloc(size_t nmembers, size_t size, char *file, int line); +void *ompi_calloc(size_t nmembers, size_t size, const char *file, int line); /** * \internal @@ -112,7 +112,7 @@ void *ompi_calloc(size_t nmembers, size_t size, char *file, int line); * This function is only used when --enable-mem-debug was specified to * configure (or by default if you're building in a SVN checkout). */ -void *ompi_realloc(void *ptr, size_t size, char *file, int line); +void *ompi_realloc(void *ptr, size_t size, const char *file, int line); /** * \internal @@ -128,7 +128,7 @@ void *ompi_realloc(void *ptr, size_t size, char *file, int line); * to configure (or by default if you're building in a SVN * checkout). */ -void ompi_free(void *addr, char *file, int line); +void ompi_free(void *addr, const char *file, int line); OMPI_DECLSPEC extern int ompi_malloc_debug_level; OMPI_DECLSPEC extern int ompi_malloc_output; diff --git a/src/util/output.c b/src/util/output.c index 6c88ded0be..05464cc04c 100644 --- a/src/util/output.c +++ b/src/util/output.c @@ -62,7 +62,7 @@ static ompi_output_stream_t verbose = { static int do_open(int output_id, ompi_output_stream_t *lds); static int open_file(int i); static void free_descriptor(int output_id); -static void output(int output_id, char *format, va_list arglist); +static void output(int output_id, const char *format, va_list arglist); /* @@ -272,7 +272,7 @@ void ompi_output_close(int output_id) /* * Main function to send output to a stream */ -void ompi_output(int output_id, char *format, ...) +void ompi_output(int output_id, const char *format, ...) { va_list arglist; va_start(arglist, format); @@ -284,7 +284,7 @@ void ompi_output(int output_id, char *format, ...) /* * Send a message to a stream if the verbose level is high enough */ -void ompi_output_verbose(int level, int output_id, char *format, ...) +void ompi_output_verbose(int level, int output_id, const char *format, ...) { if (info[output_id].ldi_verbose_level >= level) { va_list arglist; @@ -516,7 +516,7 @@ static void free_descriptor(int output_id) * multiple different places, even functions that took "..." as input * arguments. */ -static void output(int output_id, char *format, va_list arglist) +static void output(int output_id, const char *format, va_list arglist) { size_t len, total_len; bool want_newline = false; diff --git a/src/util/output.h b/src/util/output.h index f3f8fa5ab5..114ab853e5 100644 --- a/src/util/output.h +++ b/src/util/output.h @@ -330,7 +330,7 @@ OMPI_DECLSPEC void ompi_output_close(int output_id); * created, ompi_output() will automatically create the file and * writing to it. */ -OMPI_DECLSPEC void ompi_output(int output_id, char *format, ...); +OMPI_DECLSPEC void ompi_output(int output_id, const char *format, ...); /** * Send output to a stream only if the passed verbosity level is @@ -361,7 +361,7 @@ OMPI_DECLSPEC void ompi_output(int output_id, char *format, ...); * @see ompi_output_set_verbosity() */ OMPI_DECLSPEC void ompi_output_verbose(int verbose_level, int output_id, - char *format, ...); + const char *format, ...); /** * Set the verbosity level for a stream.