summaryrefslogtreecommitdiff
path: root/misc/vfu/patches/patch-vslib_vstring.cpp
blob: 3db3d784b52a81088ff258e50ee89c9c4cf97dbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$NetBSD: patch-vslib_vstring.cpp,v 1.1 2014/06/29 19:43:54 dholland Exp $

Sprinkle const to make more modern C++ compilers happier.

--- vslib/vstring.cpp~	2002-05-24 16:55:36.000000000 +0000
+++ vslib/vstring.cpp
@@ -412,7 +412,7 @@
   {
     int sl = strlen( target );
     if (startpos >= sl) return -1;
-    char* pc = strchr( target + startpos, s );
+    const char* pc = strchr( target + startpos, s );
     if( ! pc )
       return -1;
     return  pc - target;
@@ -420,7 +420,7 @@
 
   int str_rfind( const char* target, const char c ) // returns last zero-based position of char, or -1 if not found
   {
-    char* pc = strrchr( target, c );
+    const char* pc = strrchr( target, c );
     if( ! pc )
       return -1;
     return  pc - target;
@@ -430,7 +430,7 @@
   {
     int sl = strlen( target );
     if (startpos >= sl) return -1;
-    char* pc = strstr( target + startpos, s );
+    const char* pc = strstr( target + startpos, s );
     if( ! pc )
       return -1;
     return  pc - target;
@@ -707,7 +707,7 @@
     int sl = strlen( target );
     for( z = 0; z < sl; z++ )
       {
-      char *pc = strchr( from, target[z] );
+      const char *pc = strchr( from, target[z] );
       if (pc) target[z] = to[ pc - from ];
       }
     return target;