Browse Source

Less warnings in GCC

louyihua 8 years ago
parent
commit
8be28cfaed
4 changed files with 13 additions and 9 deletions
  1. 0 4
      adplug/dosbox_opl.cpp
  2. 4 0
      itemmenu.c
  3. 4 0
      magicmenu.c
  4. 5 5
      text.c

+ 0 - 4
adplug/dosbox_opl.cpp

@@ -170,8 +170,6 @@ static const fltype decrelconst[4] = {
 	(fltype)(1/22.44608)
 };
 
-#pragma region Operators
-
 void operator_advance(op_type* op_pt, Bit32s vib) {
 	op_pt->wfpos = op_pt->tcount;						// waveform position
 	
@@ -506,8 +504,6 @@ void disable_operator(op_type* op_pt, Bit32u act_type) {
 	}
 }
 
-#pragma endregion
-
 
 opl_chip* adlib_init(Bit32u samplerate) {
 

+ 4 - 0
itemmenu.c

@@ -90,6 +90,10 @@ PAL_ItemSelectMenuUpdate(
    {
       return 0;
    }
+   else
+   {
+      item_delta = 0;
+   }
 
    //
    // Make sure the current menu item index is in bound

+ 4 - 0
magicmenu.c

@@ -94,6 +94,10 @@ PAL_MagicSelectionMenuUpdate(
    {
       return 0;
    }
+   else
+   {
+      item_delta = 0;
+   }
 
    //
    // Make sure the current menu item index is in bound

+ 5 - 5
text.c

@@ -138,7 +138,7 @@ PAL_InitText(
 	   int base = i * gpGlobals->dwWordLength;
 	   int pos = base + gpGlobals->dwWordLength - 1;
 	   while (pos >= base && temp[pos] == ' ') temp[pos--] = 0;
-	   wlen += PAL_MultiByteToWideChar(temp + base, gpGlobals->dwWordLength, NULL, 0) + 1;
+	   wlen += PAL_MultiByteToWideChar((LPCSTR)temp + base, gpGlobals->dwWordLength, NULL, 0) + 1;
    }
    g_TextLib.lpWordBuf = (LPWSTR*)malloc(g_TextLib.nWords * sizeof(LPWSTR));
    tmp = (LPWSTR)malloc(wlen * sizeof(WCHAR));
@@ -146,7 +146,7 @@ PAL_InitText(
    {
 	   int l;
 	   g_TextLib.lpWordBuf[i] = tmp + wpos;
-	   l = PAL_MultiByteToWideChar(temp + i * gpGlobals->dwWordLength, gpGlobals->dwWordLength, g_TextLib.lpWordBuf[i], wlen - wpos);
+	   l = PAL_MultiByteToWideChar((LPCSTR)temp + i * gpGlobals->dwWordLength, gpGlobals->dwWordLength, g_TextLib.lpWordBuf[i], wlen - wpos);
 	   if (l > 0 && g_TextLib.lpWordBuf[i][l - 1] == '1')
 		   g_TextLib.lpWordBuf[i][l - 1] = 0;
 	   g_TextLib.lpWordBuf[i][l] = 0;
@@ -194,7 +194,7 @@ PAL_InitText(
    // Split messages and do code page conversion here
    for (i = 0, wlen = 0; i < g_TextLib.nMsgs; i++)
    {
-	   wlen += PAL_MultiByteToWideChar(temp + SDL_SwapLE32(offsets[i]), SDL_SwapLE32(offsets[i + 1]) - SDL_SwapLE32(offsets[i]), NULL, 0) + 1;
+	   wlen += PAL_MultiByteToWideChar((LPCSTR)temp + SDL_SwapLE32(offsets[i]), SDL_SwapLE32(offsets[i + 1]) - SDL_SwapLE32(offsets[i]), NULL, 0) + 1;
    }
    g_TextLib.lpMsgBuf = (LPWSTR*)malloc(g_TextLib.nMsgs * sizeof(LPWSTR));
    tmp = (LPWSTR)malloc(wlen * sizeof(WCHAR));
@@ -202,7 +202,7 @@ PAL_InitText(
    {
 	   int l;
 	   g_TextLib.lpMsgBuf[i] = tmp + wpos;
-	   l = PAL_MultiByteToWideChar(temp + SDL_SwapLE32(offsets[i]), SDL_SwapLE32(offsets[i + 1]) - SDL_SwapLE32(offsets[i]), g_TextLib.lpMsgBuf[i], wlen - wpos);
+	   l = PAL_MultiByteToWideChar((LPCSTR)temp + SDL_SwapLE32(offsets[i]), SDL_SwapLE32(offsets[i + 1]) - SDL_SwapLE32(offsets[i]), g_TextLib.lpMsgBuf[i], wlen - wpos);
 	   g_TextLib.lpMsgBuf[i][l] = 0;
 	   wpos += l + 1;
    }
@@ -1017,7 +1017,7 @@ PAL_MultiByteToWideCharCP(
 
 --*/
 {
-	int i = 0, j = 0, state = 0, wlen = 0, null = 0;
+	int i = 0, state = 0, wlen = 0, null = 0;
 
 	if (mbslength == -1)
 	{