1
0
Fork 0

fix/work around some gcc Wall warnings

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3192
This commit is contained in:
Sebastian Strohhäcker 2008-08-06 18:34:21 +00:00
parent 3d40069e4a
commit c78a9f6c03
41 changed files with 280 additions and 219 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2007 The DOSBox Team
* Copyright (C) 2002-2008 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: midi_win32.h,v 1.14 2007-06-14 08:23:46 qbix79 Exp $ */
/* $Id: midi_win32.h,v 1.15 2008-08-06 18:32:34 c2woody Exp $ */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
@ -33,12 +33,12 @@ private:
HANDLE m_event;
bool isOpen;
public:
MidiHandler_win32() : isOpen(false),MidiHandler() {};
MidiHandler_win32() : MidiHandler(),isOpen(false) {};
const char * GetName(void) { return "win32";};
bool Open(const char * conf) {
if (isOpen) return false;
m_event = CreateEvent (NULL, true, true, NULL);
MMRESULT res;
MMRESULT res = MMSYSERR_NOERROR;
if(conf && *conf) {
std::string strconf(conf);
std::istringstream configmidi(strconf);

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2007 The DOSBox Team
* Copyright (C) 2002-2008 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: render.cpp,v 1.56 2008-02-10 11:14:03 qbix79 Exp $ */
/* $Id: render.cpp,v 1.57 2008-08-06 18:32:34 c2woody Exp $ */
#include <sys/types.h>
#include <dirent.h>
@ -282,7 +282,7 @@ static void RENDER_Reset( void ) {
gfx_scalew = 1;
gfx_scaleh = 1;
}
if (dblh && dblw || (render.scale.forced && !dblh && !dblw)) {
if ((dblh && dblw) || (render.scale.forced && !dblh && !dblw)) {
/* Initialize always working defaults */
if (render.scale.size == 2)
simpleBlock = &ScaleNormal2x;
@ -343,6 +343,8 @@ static void RENDER_Reset( void ) {
else if (render.scale.size == 3)
simpleBlock = &ScaleScan3x;
break;
default:
break;
}
#endif
} else if (dblw) {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdl_gui.cpp,v 1.6 2008-02-21 19:25:34 c2woody Exp $ */
/* $Id: sdl_gui.cpp,v 1.7 2008-08-06 18:32:34 c2woody Exp $ */
#include "SDL.h"
#include "../libs/gui_tk/gui_tk.h"
@ -52,10 +52,10 @@ void UI_Init(void) {
GUI::Font::addFont("default",new GUI::BitmapFont(int10_font_14,14,10));
}
static void getPixel(Bitu x, Bitu y, int &r, int &g, int &b, int shift)
static void getPixel(Bits x, Bits y, int &r, int &g, int &b, int shift)
{
if (x >= render.src.width) x = render.src.width-1;
if (y >= render.src.height) x = render.src.height-1;
if (x >= (Bits)render.src.width) x = (Bits)render.src.width-1;
if (y >= (Bits)render.src.height) x = (Bits)render.src.height-1;
if (x < 0) x = 0;
if (y < 0) y = 0;
@ -159,7 +159,7 @@ static GUI::ScreenSDL *UI_Startup(GUI::ScreenSDL *screen) {
SDL_BlitSurface(background, NULL, sdlscreen, NULL);
SDL_BlitSurface(screenshot, NULL, sdlscreen, NULL);
SDL_UpdateRect(sdlscreen, 0, 0, 0, 0);
while (SDL_PollEvent(&event));
while (SDL_PollEvent(&event)) {};
SDL_Delay(40);
}
@ -187,7 +187,7 @@ static void UI_Shutdown(GUI::ScreenSDL *screen) {
SDL_BlitSurface(background, NULL, sdlscreen, NULL);
SDL_BlitSurface(screenshot, NULL, sdlscreen, NULL);
SDL_UpdateRect(sdlscreen, 0, 0, 0, 0);
while (SDL_PollEvent(&event));
while (SDL_PollEvent(&event)) {};
SDL_Delay(40);
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.143 2008-05-28 09:14:06 qbix79 Exp $ */
/* $Id: sdlmain.cpp,v 1.144 2008-08-06 18:32:34 c2woody Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -260,7 +260,9 @@ check_surface:
else if (flags & GFX_LOVE_16) testbpp=16;
else if (flags & GFX_LOVE_32) testbpp=32;
else testbpp=0;
#if (HAVE_DDRAW_H) && defined(WIN32)
check_gotbpp:
#endif
if (sdl.desktop.fullscreen) gotbpp=SDL_VideoModeOK(640,480,testbpp,SDL_FULLSCREEN|SDL_HWSURFACE|SDL_HWPALETTE);
else gotbpp=sdl.desktop.bpp;
/* If we can't get our favorite mode check for another working one */
@ -303,6 +305,9 @@ check_gotbpp:
flags&=~(GFX_CAN_8|GFX_CAN_15|GFX_CAN_16);
break;
#endif
default:
goto check_surface;
break;
}
return flags;
}
@ -611,6 +616,9 @@ dosurface:
break;
}//OPENGL
#endif //C_OPENGL
default:
goto dosurface;
break;
}//CASE
if (retFlags)
GFX_Start();
@ -698,13 +706,17 @@ bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch) {
sdl.updating=true;
return true;
#endif
default:
break;
}
return false;
}
void GFX_EndUpdate( const Bit16u *changedLines ) {
#if (HAVE_DDRAW_H) && defined(WIN32)
int ret;
#endif
if (!sdl.updating)
return;
sdl.updating=false;
@ -800,7 +812,8 @@ void GFX_EndUpdate( const Bit16u *changedLines ) {
}
break;
#endif
default:
break;
}
}