OSDN Git Service

2008-11-07 Frank Ch. Eigler <fche@redhat.com>
authorfche <fche>
Fri, 7 Nov 2008 21:35:44 +0000 (21:35 +0000)
committerfche <fche>
Fri, 7 Nov 2008 21:35:44 +0000 (21:35 +0000)
* (*): Change some "char *" -> "const char *" declarations for
warning suppression on gcc 4.3.

sid/ChangeLog
sid/component/bochs/bochs.h
sid/component/bochs/cpu/main-hack.cc
sid/component/cgen-cpu/fp.h
sid/include/sidmiscutil.h

index 73f21f6..ce21e9f 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-07  Frank Ch. Eigler  <fche@redhat.com>
+
+       * (*): Change some "char *" -> "const char *" declarations for
+       warning suppression on gcc 4.3.
+
 2006-10-18  Dave Brolley  <brolley@redhat.com>
 
        * Contribute the following changes:
index 0ed74f6..85d6ca9 100644 (file)
@@ -283,7 +283,7 @@ extern Bit8u DTPageDirty[];
 #define MAX_LOGLEV   4
 
 typedef class logfunctions {
-       char *prefix;
+       const char *prefix;
        int type;
 // values of onoff: 0=ignore, 1=report, 2=fatal
 #define ACT_IGNORE 0
@@ -296,12 +296,12 @@ public:
        logfunctions(class iofunctions *);
        ~logfunctions(void);
 
-       void info(char *fmt, ...);
-       void error(char *fmt, ...);
-       void panic(char *fmt, ...);
-       void ldebug(char *fmt, ...);
-       void fatal (char *prefix, char *fmt, va_list ap);
-       void setprefix(char *);
+       void info(const char *fmt, ...);
+       void error(const char *fmt, ...);
+       void panic(const char *fmt, ...);
+       void ldebug(const char *fmt, ...);
+       void fatal (const char *prefix, const char *fmt, va_list ap);
+       void setprefix(const char *);
        void settype(int);
        void setio(class iofunctions *);
        void setonoff(int loglev, int value) { onoff[loglev] = value; }
@@ -313,8 +313,8 @@ class iofunctions {
        class logfunctions *log;
        void init(void);
        void flush(void);
-       char *getlevel(int i) {
-               static char *loglevel[] = {
+       const char *getlevel(int i) {
+               static const char *loglevel[] = {
                        "DEBUG",
                        "INFO",
                        "ERROR",
@@ -323,8 +323,8 @@ class iofunctions {
                return loglevel[i];
        }
 
-       char *getclass(int i) {
-               char *logclass[] = {
+       const char *getclass(int i) {
+               static const char *logclass[] = {
                  "IO  ",
                  "FD  ",
                  "GEN ",
@@ -421,7 +421,7 @@ public:
        iofunctions(char *);
        ~iofunctions(void);
 
-       void out(int facility, int level, char *pre, char *fmt, va_list ap);
+       void out(int facility, int level, const char *pre, const char *fmt, va_list ap);
 
        void init_log(char *fn);
        void init_log(int fd);
@@ -434,7 +434,7 @@ protected:
        int n_logfn;
 #define MAX_LOGFNS 64
        logfunc_t *logfn_list[MAX_LOGFNS];
-       char *logfn;
+       const char *logfn;
 };
 
 typedef class iofunctions iofunc_t;
index 9a2f48a..6a16ff5 100644 (file)
@@ -48,7 +48,7 @@ void   bx_close_harddrive(void);
 
 void bx_init_debug(void);
 void bx_emulate_hga_dumps_timer(void);
-static char *divider = "========================================================================";
+static const char *divider = "========================================================================";
 
 
 /* typedefs */
@@ -145,7 +145,7 @@ iofunctions::init_log(char *fn)
        // use newfd/newfn so that we can log the message to the OLD log
        // file descriptor.
        FILE *newfd = stderr;
-       char *newfn = "/dev/stderr";
+       const char *newfn = "/dev/stderr";
        if( strcmp( fn, "-" ) != 0 ) {
                newfd = fopen(fn, "w");
                if(newfd != NULL) {
@@ -195,7 +195,7 @@ iofunctions::init_log(int fd)
 //    fmt and ap retained for direct printinf from iofunctions only!
 
 void
-iofunctions::out(int f, int l, char *prefix, char *fmt, va_list ap)
+iofunctions::out(int f, int l, const char *prefix, const char *fmt, va_list ap)
 {
        assert (magic==MAGIC_LOGNUM);
        assert (this != NULL);
@@ -290,7 +290,7 @@ logfunctions::setio(iofunc_t *i)
 }
 
 void
-logfunctions::setprefix(char *p)
+logfunctions::setprefix(const char *p)
 {
        this->prefix=strdup(p);
 }
@@ -302,7 +302,7 @@ logfunctions::settype(int t)
 }
 
 void
-logfunctions::info(char *fmt, ...)
+logfunctions::info(const char *fmt, ...)
 {
        va_list ap;
        FILE *fs;
@@ -320,7 +320,7 @@ logfunctions::info(char *fmt, ...)
 }
 
 void
-logfunctions::error(char *fmt, ...)
+logfunctions::error(const char *fmt, ...)
 {
        va_list ap;
        FILE *fs;
@@ -337,7 +337,7 @@ logfunctions::error(char *fmt, ...)
 }
 
 void
-logfunctions::panic(char *fmt, ...)
+logfunctions::panic(const char *fmt, ...)
 {
        va_list ap;
        FILE *fs;
@@ -354,7 +354,7 @@ logfunctions::panic(char *fmt, ...)
 }
 
 void
-logfunctions::ldebug(char *fmt, ...)
+logfunctions::ldebug(const char *fmt, ...)
 {
        va_list ap;
        FILE *fs;
@@ -371,7 +371,7 @@ logfunctions::ldebug(char *fmt, ...)
 }
 
 void
-logfunctions::fatal (char *prefix, char *fmt, va_list ap)
+logfunctions::fatal (const char *prefix, const char *fmt, va_list ap)
 {
   static int fatal_reentry = 0;
   if (fatal_reentry) return;
index f70f52a..0ef2acb 100644 (file)
@@ -189,7 +189,7 @@ namespace sidutil
       typedef int exp_t;
       typedef sid::host_int_8 fraction_t;
       
-      typedef enum round_mode_t
+      enum round_mode_t
        {
          round_default,
          round_near,
@@ -198,14 +198,14 @@ namespace sidutil
          round_down
        };
       
-      typedef enum denorm_t
+      enum denorm_t
        {
          denorm_default,
          denorm_underflow_inexact,
          denorm_zero
        };
       
-      typedef enum class_t
+      enum class_t
        {
          class_zero,
          class_snan,
index 11b1db0..2cd6761 100644 (file)
@@ -332,13 +332,13 @@ namespace sidutil
   {
     std::vector<std::string> search_directories;
 
-    char* slp = getenv ("SID_LIBRARY_PATH"); // run-time configuration
+    const char* slp = getenv ("SID_LIBRARY_PATH"); // run-time configuration
     if (slp)
       {
        search_directories = tokenize (slp, ":");
       }
     
-    char* sep = getenv ("SID_EXEC_PREFIX"); // install-time configuration
+    const char* sep = getenv ("SID_EXEC_PREFIX"); // install-time configuration
 #ifdef __CYGWIN__
     char conv_fn[PATH_MAX*2];
     if (sep)