const_warning_reduction
authorDebian BOINC Maintainers <pkg-boinc-devel@lists.alioth.debian.org>
Tue, 28 Aug 2012 03:05:07 +0000 (03:05 +0000)
committerGuo Yixuan <culu.gyx@gmail.com>
Tue, 28 Aug 2012 03:05:07 +0000 (03:05 +0000)
===================================================================

Gbp-Pq: Name const_warning_reduction.patch

client/main.cpp
client/s_util.cpp
client/s_util.h
client/seti_header.cpp

index ba99f602d426c09f10fe54ab4b5f55aed2a9ffa9..23079c5cffcb3b0509e97e7f28442b1b2f3725b8 100644 (file)
@@ -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);
index 44b5515c7630fbcac27ee20f161594e3a3e58196..8fe60d28bb80f14d8469730ce47f4be0183bfc35 100644 (file)
@@ -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) {
index 5e01665f002aa398e2da45278f45ad0d25443a63..d904cf61d2f0b36c873cde5c5445be0f4a34aa21 100644 (file)
@@ -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
index 51f2e007fb9e90ec69b536e932a3648c8d1aa743..4d77c9d3cac155ecbbd118c5c2bc12645eeb701e 100644 (file)
@@ -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>("SETI_WU_INFO"),