Skip to content

Commit

Permalink
Fixed a bunch more compiler warnings in the 1.2 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 13, 2011
1 parent 8564908 commit 27176bd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/cdrom/beos/SDL_syscdrom.cc
Expand Up @@ -150,8 +150,6 @@ struct ide_ctrl_info {
int SDL_SYS_CDInit(void)
{
char *SDLcdrom;
int raw_fd;
struct ide_ctrl_info info;

/* Fill in our driver capabilities */
SDL_CDcaps.Name = SDL_SYS_CDName;
Expand Down
1 change: 1 addition & 0 deletions src/file/SDL_rwops.c
Expand Up @@ -485,6 +485,7 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
SDL_RWops *rwops = NULL;
#ifdef HAVE_STDIO_H
FILE *fp = NULL;
(void) fp;
#endif
if ( !file || !*file || !mode || !*mode ) {
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_bmp.c
Expand Up @@ -48,7 +48,7 @@
SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
{
SDL_bool was_error;
long fp_offset;
long fp_offset = 0;
int bmpPitch;
int i, pad;
SDL_Surface *surface;
Expand Down
27 changes: 20 additions & 7 deletions src/video/wincommon/SDL_sysevents.c
Expand Up @@ -220,13 +220,13 @@ static BOOL (WINAPI *_TrackMouseEvent)(TRACKMOUSEEVENT *ptme) = NULL;
static VOID CALLBACK
TrackMouseTimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
RECT rect;
union { RECT rect; POINT pt; } rectpt; /* prevent type-punning issue. */
POINT pt;

GetClientRect(hWnd, &rect);
MapWindowPoints(hWnd, NULL, (LPPOINT)&rect, 2);
GetClientRect(hWnd, &rectpt.rect);
MapWindowPoints(hWnd, NULL, &rectpt.pt, 2);
GetCursorPos(&pt);
if ( !PtInRect(&rect, pt) || (WindowFromPoint(pt) != hWnd) ) {
if ( !PtInRect(&rectpt.rect, pt) || (WindowFromPoint(pt) != hWnd) ) {
if ( !KillTimer(hWnd, idEvent) ) {
/* Error killing the timer! */
}
Expand Down Expand Up @@ -572,11 +572,24 @@ this->hidden->hiresFix, &x, &y);

case WM_WINDOWPOSCHANGED: {
SDL_VideoDevice *this = current_video;
POINT pt;
int w, h;

GetClientRect(SDL_Window, &SDL_bounds);
ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds);
ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds+1);

/* avoiding type-punning here... */
pt.x = SDL_bounds.left;
pt.y = SDL_bounds.top;
ClientToScreen(SDL_Window, &pt);
SDL_bounds.left = pt.x;
SDL_bounds.top = pt.y;

pt.x = SDL_bounds.right;
pt.y = SDL_bounds.bottom;
ClientToScreen(SDL_Window, &pt);
SDL_bounds.right = pt.x;
SDL_bounds.bottom = pt.y;

if ( !SDL_resizing && !IsZoomed(SDL_Window) &&
SDL_PublicSurface &&
!(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
Expand Down Expand Up @@ -831,7 +844,7 @@ static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate,

/* arg #3 should be const BYTE *, but cygwin lists it as PBYTE. */
if (ToAsciiEx(vkey, scancode, (PBYTE) keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) {
return MultiByteToWideChar(codepage, 0, chars, 1, wchars, wsize);
return MultiByteToWideChar(codepage, 0, (LPCSTR) chars, 1, wchars, wsize);
}
return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion src/video/windx5/SDL_dx5video.c
Expand Up @@ -1034,7 +1034,8 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
int width, int height, int bpp, Uint32 flags)
{
SDL_Surface *video;
int prev_w, prev_h;
int prev_w = -1;
int prev_h = -1;
HRESULT result;
DWORD sharemode;
DWORD style;
Expand Down

0 comments on commit 27176bd

Please sign in to comment.