mirror of
https://github.com/yawut/SDL.git
synced 2026-10-03 05:36:43 -05:00
Fixed a bunch more compiler warnings in the 1.2 branch.
--HG-- branch : SDL-1.2
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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! */
|
||||
}
|
||||
@@ -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) ) {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user