Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 277072
Collapse All | Expand All

(-)a/toycars_track_editor/src/TrackView.cxx (-5 / +5 lines)
Lines 89-95 TiXmlDocument *findXMLFile(const char *filename, SearchDirectories *dirs, char * Link Here
89
//{jpg,png,bmp,pnm,pbm,pgm,ppm}
89
//{jpg,png,bmp,pnm,pbm,pgm,ppm}
90
Fl_Image* loadImage(const char *filename)
90
Fl_Image* loadImage(const char *filename)
91
{
91
{
92
   char *suffix = strrchr(filename, '.');
92
   const char *suffix = strrchr(filename, '.');
93
   if (suffix == NULL)
93
   if (suffix == NULL)
94
      return NULL;
94
      return NULL;
95
   if (strcmp(suffix,".jpg") == 0)
95
   if (strcmp(suffix,".jpg") == 0)
Lines 969-981 void TrackView::installMap(const char *name) Link Here
969
   uninstallMap(name);
969
   uninstallMap(name);
970
   
970
   
971
   // chop off any .xml suffix
971
   // chop off any .xml suffix
972
   temp = strrchr(name, '.');
972
   temp = const_cast<char*>( strrchr(name, '.') );
973
   if (temp) {
973
   if (temp) {
974
      if (strcmp(temp, ".xml") == 0)
974
      if (strcmp(temp, ".xml") == 0)
975
         temp[0] = '\0';
975
         temp[0] = '\0';
976
   }
976
   }
977
   // remove path
977
   // remove path
978
   temp = strrchr(name, '/');
978
   temp = const_cast<char*>( strrchr(name, '/') );
979
   if (temp) {
979
   if (temp) {
980
      strncpy(trackname, temp+1, 255);
980
      strncpy(trackname, temp+1, 255);
981
   }
981
   }
Lines 1044-1056 void TrackView::uninstallMap(const char *name) Link Here
1044
   char *temp;
1044
   char *temp;
1045
   
1045
   
1046
   // chop off any .xml suffix
1046
   // chop off any .xml suffix
1047
   temp = strrchr(name, '.');
1047
   temp = const_cast<char*>( strrchr(name, '.') );
1048
   if (temp) {
1048
   if (temp) {
1049
      if (strcmp(temp, ".xml") == 0)
1049
      if (strcmp(temp, ".xml") == 0)
1050
         temp[0] = '\0';
1050
         temp[0] = '\0';
1051
   }
1051
   }
1052
   // remove path
1052
   // remove path
1053
   temp = strrchr(name, '/');
1053
   temp = const_cast<char*>( strrchr(name, '/') );
1054
   if (temp) {
1054
   if (temp) {
1055
      strncpy(trackname, temp+1, 255);
1055
      strncpy(trackname, temp+1, 255);
1056
   }
1056
   }
(-)a/toycars_vehicle_editor/src/LoadSpriteFromImage.cpp (-1 / +1 lines)
Lines 23-29 Link Here
23
//{jpg,png,bmp,pnm,pbm,pgm,ppm}
23
//{jpg,png,bmp,pnm,pbm,pgm,ppm}
24
Fl_Image* loadImage(const char *filename)
24
Fl_Image* loadImage(const char *filename)
25
{
25
{
26
   char *suffix = strrchr(filename, '.');
26
   const char *suffix = strrchr(filename, '.');
27
   if (suffix == NULL)
27
   if (suffix == NULL)
28
      return NULL;
28
      return NULL;
29
   if (strcmp(suffix,".jpg") == 0)
29
   if (strcmp(suffix,".jpg") == 0)
(-)a/toycars_vehicle_editor/src/VehicleObject.cpp (-5 / +5 lines)
Lines 533-545 void VehicleObject::installVehicle(const char *name) Link Here
533
   uninstallVehicle(name);
533
   uninstallVehicle(name);
534
   
534
   
535
   // chop off any .xml suffix
535
   // chop off any .xml suffix
536
   temp = strrchr(name, '.');
536
   temp = const_cast<char*>( strrchr(name, '.') );
537
   if (temp) {
537
   if (temp) {
538
      if (strcmp(temp, ".xml") == 0)
538
      if (strcmp(temp, ".xml") == 0)
539
         temp[0] = '\0';
539
         temp[0] = '\0';
540
   }
540
   }
541
   // remove path
541
   // remove path
542
   temp = strrchr(name, '/');
542
   temp = const_cast<char*>( strrchr(name, '/') );
543
   if (temp) {
543
   if (temp) {
544
      strncpy(carname, temp+1, 255);
544
      strncpy(carname, temp+1, 255);
545
   }
545
   }
Lines 610-622 void VehicleObject::uninstallVehicle(const char *name) Link Here
610
   char *temp;
610
   char *temp;
611
   
611
   
612
   // chop off any .xml suffix
612
   // chop off any .xml suffix
613
   temp = strrchr(name, '.');
613
   temp = const_cast<char*>( strrchr(name, '.') );
614
   if (temp) {
614
   if (temp) {
615
      if (strcmp(temp, ".xml") == 0)
615
      if (strcmp(temp, ".xml") == 0)
616
         temp[0] = '\0';
616
         temp[0] = '\0';
617
   }
617
   }
618
   // remove path
618
   // remove path
619
   temp = strrchr(name, '/');
619
   temp = const_cast<char*>( strrchr(name, '/') );
620
   if (temp) {
620
   if (temp) {
621
      strncpy(carname, temp+1, 255);
621
      strncpy(carname, temp+1, 255);
622
   }
622
   }
Lines 675-678 void VehicleObject::uninstallVehicle(const char *name) Link Here
675
   system(str);
675
   system(str);
676
   */
676
   */
677
#endif
677
#endif
678
}
678
}

Return to bug 277072