From d98c759200de92a6ddf75a54f8df8593f7841df8 Mon Sep 17 00:00:00 2001 From: Debian BOINC Maintainers Date: Tue, 28 Aug 2012 03:05:07 +0000 Subject: [PATCH] const_warning_reduction =================================================================== Gbp-Pq: Name const_warning_reduction.patch --- client/main.cpp | 2 +- client/s_util.cpp | 4 ++-- client/s_util.h | 2 +- client/seti_header.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/main.cpp b/client/main.cpp index ba99f60..23079c5 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -105,7 +105,7 @@ void usage() { } void print_error(int e) { - char* p; + const char* p; p = error_string(e); fprintf(stderr,"%s\n",p); diff --git a/client/s_util.cpp b/client/s_util.cpp index 44b5515..8fe60d2 100644 --- a/client/s_util.cpp +++ b/client/s_util.cpp @@ -211,8 +211,8 @@ int float_to_uchar(float float_element[], unsigned char char_element[], return 0; } -char* error_string(int e) { - char* p; +const char* error_string(int e) { + const char* p; static char buf[256]; switch(e) { diff --git a/client/s_util.h b/client/s_util.h index 5e01665..d904cf6 100644 --- a/client/s_util.h +++ b/client/s_util.h @@ -150,6 +150,6 @@ extern int float_to_uchar( float float_element[], unsigned char char_element[], long num_elements, float scale_factor ); -extern char* error_string(int); +extern const char* error_string(int); #endif diff --git a/client/seti_header.cpp b/client/seti_header.cpp index 51f2e00..4d77c9d 100644 --- a/client/seti_header.cpp +++ b/client/seti_header.cpp @@ -63,8 +63,8 @@ // Write a SETI work unit header to a file -char *receivers[]={"invalid","synthetic","ao1420"}; -char *datatypes[]={"invalid","ascii","encoded","sun_binary"}; +const char *const receivers[]={"invalid","synthetic","ao1420"}; +const char *const datatypes[]={"invalid","ascii","encoded","sun_binary"}; SETI_WU_INFO::SETI_WU_INFO(const workunit &w) : track_mem("SETI_WU_INFO"), -- 2.30.2