summaryrefslogtreecommitdiff
blob: e3c184724c6d102892854cb2d1bda199201e6683 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
diff --git a/toycars_track_editor/src/TrackView.cxx b/toycars_track_editor/src/TrackView.cxx
index d52daba..e1a66df 100644
--- a/toycars_track_editor/src/TrackView.cxx
+++ b/toycars_track_editor/src/TrackView.cxx
@@ -89,7 +89,7 @@ TiXmlDocument *findXMLFile(const char *filename, SearchDirectories *dirs, char *
 //{jpg,png,bmp,pnm,pbm,pgm,ppm}
 Fl_Image* loadImage(const char *filename)
 {
-   char *suffix = strrchr(filename, '.');
+   const char *suffix = strrchr(filename, '.');
    if (suffix == NULL)
       return NULL;
    if (strcmp(suffix,".jpg") == 0)
@@ -969,13 +969,13 @@ void TrackView::installMap(const char *name)
    uninstallMap(name);
    
    // chop off any .xml suffix
-   temp = strrchr(name, '.');
+   temp = const_cast<char*>( strrchr(name, '.') );
    if (temp) {
       if (strcmp(temp, ".xml") == 0)
          temp[0] = '\0';
    }
    // remove path
-   temp = strrchr(name, '/');
+   temp = const_cast<char*>( strrchr(name, '/') );
    if (temp) {
       strncpy(trackname, temp+1, 255);
    }
@@ -1044,13 +1044,13 @@ void TrackView::uninstallMap(const char *name)
    char *temp;
    
    // chop off any .xml suffix
-   temp = strrchr(name, '.');
+   temp = const_cast<char*>( strrchr(name, '.') );
    if (temp) {
       if (strcmp(temp, ".xml") == 0)
          temp[0] = '\0';
    }
    // remove path
-   temp = strrchr(name, '/');
+   temp = const_cast<char*>( strrchr(name, '/') );
    if (temp) {
       strncpy(trackname, temp+1, 255);
    }
diff --git a/toycars_vehicle_editor/src/LoadSpriteFromImage.cpp b/toycars_vehicle_editor/src/LoadSpriteFromImage.cpp
index 4b6ff50..7aa6c40 100644
--- a/toycars_vehicle_editor/src/LoadSpriteFromImage.cpp
+++ b/toycars_vehicle_editor/src/LoadSpriteFromImage.cpp
@@ -23,7 +23,7 @@
 //{jpg,png,bmp,pnm,pbm,pgm,ppm}
 Fl_Image* loadImage(const char *filename)
 {
-   char *suffix = strrchr(filename, '.');
+   const char *suffix = strrchr(filename, '.');
    if (suffix == NULL)
       return NULL;
    if (strcmp(suffix,".jpg") == 0)
diff --git a/toycars_vehicle_editor/src/VehicleObject.cpp b/toycars_vehicle_editor/src/VehicleObject.cpp
index 3f61114..0bd2978 100644
--- a/toycars_vehicle_editor/src/VehicleObject.cpp
+++ b/toycars_vehicle_editor/src/VehicleObject.cpp
@@ -533,13 +533,13 @@ void VehicleObject::installVehicle(const char *name)
    uninstallVehicle(name);
    
    // chop off any .xml suffix
-   temp = strrchr(name, '.');
+   temp = const_cast<char*>( strrchr(name, '.') );
    if (temp) {
       if (strcmp(temp, ".xml") == 0)
          temp[0] = '\0';
    }
    // remove path
-   temp = strrchr(name, '/');
+   temp = const_cast<char*>( strrchr(name, '/') );
    if (temp) {
       strncpy(carname, temp+1, 255);
    }
@@ -610,13 +610,13 @@ void VehicleObject::uninstallVehicle(const char *name)
    char *temp;
    
    // chop off any .xml suffix
-   temp = strrchr(name, '.');
+   temp = const_cast<char*>( strrchr(name, '.') );
    if (temp) {
       if (strcmp(temp, ".xml") == 0)
          temp[0] = '\0';
    }
    // remove path
-   temp = strrchr(name, '/');
+   temp = const_cast<char*>( strrchr(name, '/') );
    if (temp) {
       strncpy(carname, temp+1, 255);
    }
@@ -675,4 +675,4 @@ void VehicleObject::uninstallVehicle(const char *name)
    system(str);
    */
 #endif
-}
\ No newline at end of file
+}