Constify read-only global data
authorBenjamin Kramer <benny.kra@gmail.com>
Sat, 24 Jul 2010 13:29:11 +0000 (15:29 +0200)
committerBenjamin Kramer <benny.kra@gmail.com>
Mon, 26 Jul 2010 20:14:39 +0000 (22:14 +0200)
Also silences a compiler warning about deprecated conversion from const
char* to char*.

src/node_buffer.cc

index efd01b7..226baf7 100644 (file)
@@ -272,10 +272,10 @@ Handle<Value> Buffer::Utf8Slice(const Arguments &args) {
   return scope.Close(string);
 }
 
-static char* base64_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                            "abcdefghijklmnopqrstuvwxyz"
-                            "0123456789+/";
-static int unbase64_table[] =
+static const char *base64_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                  "abcdefghijklmnopqrstuvwxyz"
+                                  "0123456789+/";
+static const int unbase64_table[] =
   {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63