Added a few more const where possible
authorDan Fandrich <dan@coneharvesters.com>
Mon, 28 Apr 2014 22:05:19 +0000 (00:05 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 28 Apr 2014 22:05:19 +0000 (00:05 +0200)
lib/dotdot.c
lib/dotdot.h
lib/splay.c
tests/unit/unit1395.c

index 41b73be..0cb3c96 100644 (file)
@@ -47,7 +47,7 @@
  *
  * an allocated dedotdotified output string
  */
-char *Curl_dedotdotify(char *input)
+char *Curl_dedotdotify(const char *input)
 {
   size_t inlen = strlen(input);
   char *clone;
index c3487c1..f511396 100644 (file)
@@ -21,5 +21,5 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
-char *Curl_dedotdotify(char *input);
+char *Curl_dedotdotify(const char *input);
 #endif
index 3570712..129d244 100644 (file)
@@ -101,7 +101,7 @@ struct Curl_tree *Curl_splayinsert(struct timeval i,
                                    struct Curl_tree *t,
                                    struct Curl_tree *node)
 {
-  static struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */
+  static const struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */
 
   if(node == NULL)
     return t;
@@ -223,7 +223,7 @@ int Curl_splayremovebyaddr(struct Curl_tree *t,
                            struct Curl_tree *removenode,
                            struct Curl_tree **newroot)
 {
-  static struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */
+  static const struct timeval KEY_NOTUSED = {-1,-1}; /* will *NEVER* appear */
   struct Curl_tree *x;
 
   if(!t || !removenode)
index 0fdf147..b27ba06 100644 (file)
@@ -44,7 +44,7 @@ UNITTEST_START
 
   unsigned int i;
   int fails=0;
-  struct dotdot pairs[] = {
+  const struct dotdot pairs[] = {
     { "/a/b/c/./../../g", "/a/g" },
     { "mid/content=5/../6", "mid/6" },
     { "/hello/../moo", "/moo" },