More warning elimination concerning constness.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 5 Jan 2008 01:53:40 +0000 (01:53 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 5 Jan 2008 01:53:40 +0000 (01:53 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@373 052ea7fc-9027-0410-9066-f65837a77df0

common/common.cpp
common/common.h
rlgen-cd/main.cpp
rlgen-dot/main.cpp
rlgen-java/main.cpp
rlgen-ruby/main.cpp

index afc8e03..d1f9cd0 100644 (file)
@@ -288,7 +288,7 @@ char *findFileExtension( char *stemFile )
 
 /* Make a file name from a stem. Removes the old filename suffix and
  * replaces it with a new one. Returns a newed up string. */
-char *fileNameFromStem( char *stemFile, char *suffix )
+char *fileNameFromStem( char *stemFile, const char *suffix )
 {
        long len = strlen( stemFile );
        assert( len > 0 );
index f05f453..cb43fbf 100644 (file)
@@ -346,7 +346,7 @@ public:
 
 
 char *findFileExtension( char *stemFile );
-char *fileNameFromStem( char *stemFile, char *suffix );
+char *fileNameFromStem( char *stemFile, const char *suffix );
 
 struct Export
 {
index cd26272..7cd5fa6 100644 (file)
@@ -125,7 +125,7 @@ ostream *openOutput( char *inputFile )
                if ( ext != 0 && strcmp( ext, ".rh" ) == 0 )
                        outputFileName = fileNameFromStem( inputFile, ".h" );
                else {
-                       char *defExtension = 0;
+                       const char *defExtension = 0;
                        switch ( hostLang->lang ) {
                                case HostLang::C: defExtension = ".c"; break;
                                case HostLang::D: defExtension = ".d"; break;
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
                        error() << "could not open " << xmlInputFileName << " for reading" << endl;
        }
        else {
-               xmlInputFileName = "<stdin>";
+               xmlInputFileName = strdup("<stdin>");
                inStream = &cin;
        }
 
index 9201681..d5bd5f3 100644 (file)
@@ -210,7 +210,7 @@ int main(int argc, char **argv)
                        error() << "could not open " << xmlInputFileName << " for reading" << endl;
        }
        else {
-               xmlInputFileName = "<stdin>";
+               xmlInputFileName = strdup("<stdin>");
                inStream = &cin;
        }
 
index c5bd103..da8abd4 100644 (file)
@@ -218,7 +218,7 @@ int main(int argc, char **argv)
                        error() << "could not open " << xmlInputFileName << " for reading" << endl;
        }
        else {
-               xmlInputFileName = "<stdin>";
+               xmlInputFileName = strdup("<stdin>");
                inStream = &cin;
        }
 
index eda7401..137773c 100644 (file)
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
                        error() << "could not open " << xmlInputFileName << " for reading" << endl;
        }
        else {
-               xmlInputFileName = "<stdin>";
+               xmlInputFileName = strdup("<stdin>");
                inStream = &cin;
        }