Browse Source

More dStrstr usage fixes

Overall a few compiler error fixes for compilers that are more strict. And removed unnecessary const casting of the second argument as its always const now in dStrstr prototype to conform to stdlib's strstr.
dottools 7 years ago
parent
commit
0209a11700

+ 1 - 1
engine/source/gui/guiMessageVectorCtrl.cc

@@ -302,7 +302,7 @@ void GuiMessageVectorCtrl::createSpecialMarkers(SpecialMarkers& rSpecial, const
          matchBuffer[499] = '\0';
          matchBuffer[499] = '\0';
          dStrcat(matchBuffer, "://");
          dStrcat(matchBuffer, "://");
 
 
-         const char* pMatch = dStrstr(pCurr, (const char*)matchBuffer);
+         const char* pMatch = dStrstr(pCurr, matchBuffer);
          if (pMatch != NULL && pMatch < pMinMatch) {
          if (pMatch != NULL && pMatch < pMinMatch) {
             pMinMatch = pMatch;
             pMinMatch = pMatch;
             minMatchType = i;
             minMatchType = i;

+ 1 - 1
engine/source/network/serverQuery.cc

@@ -1932,7 +1932,7 @@ static void handleGameInfoResponse( const NetAddress* address, BitStream* stream
    // Get the mission name:
    // Get the mission name:
    stream->readString( stringBuf );
    stream->readString( stringBuf );
    // Clip the file extension off:
    // Clip the file extension off:
-   char* temp = dStrstr( static_cast<char*>( stringBuf ), const_cast<char*>( ".mis" ) );
+   char* temp = dStrstr( stringBuf, ".mis" );
    if ( temp )
    if ( temp )
       *temp = '\0';
       *temp = '\0';
    if ( !si->missionName || dStrcmp( si->missionName, stringBuf ) != 0 )
    if ( !si->missionName || dStrcmp( si->missionName, stringBuf ) != 0 )

+ 1 - 1
engine/source/platformOSX/osxCocoaUtilities.mm

@@ -55,7 +55,7 @@
         else
         else
         {
         {
             // detect *.*
             // detect *.*
-            if (dStrstr((const char *) token, "*.*"))
+            if (dStrstr(token, "*.*"))
             {
             {
                 fileTypes.any = true;
                 fileTypes.any = true;
             }
             }

+ 2 - 2
engine/source/platformWin32/winWindow.cc

@@ -1718,9 +1718,9 @@ bool Platform::openWebBrowser( const char* webAddress )
       convertUTF16toUTF8(sWebKey,utf8WebKey,512);
       convertUTF16toUTF8(sWebKey,utf8WebKey,512);
 
 
 #ifdef UNICODE
 #ifdef UNICODE
-      char *p = dStrstr((const char *)utf8WebKey, "%1"); 
+      char *p = dStrstr(utf8WebKey, "%1"); 
 #else
 #else
-      char *p = dStrstr( (const char *) sWebKey  , "%1"); 
+      char *p = dStrstr(sWebKey, "%1"); 
 #endif
 #endif
       if (p) *p = 0; 
       if (p) *p = 0;