mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-07 11:01:57 +08:00
BUGFIXING: always initialize csr_bmp fields with explicit assignments
This commit is contained in:
@@ -370,9 +370,7 @@ HCURSOR GUIAPI GetDefaultCursor (void)
|
||||
return def_cursor;
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
BOOL mg_InitCursor (void)
|
||||
{
|
||||
@@ -392,10 +390,14 @@ BOOL mg_InitCursor (void)
|
||||
CSR_OLDBOXTOP = -100;
|
||||
}
|
||||
|
||||
/* always initialize fields by explicitly assignments */
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmPitch = __gal_screen->format->BytesPerPixel * CURSORWIDTH;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,9 +108,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
|
||||
return load_cursor_from_mem (area);
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
/* Only called from InitCursor and client code. */
|
||||
HCURSOR GUIAPI CreateCursor(int xhotspot, int yhotspot, int w, int h,
|
||||
@@ -242,6 +240,10 @@ BOOL mg_InitCursor(void)
|
||||
|
||||
csrimgsize = GAL_GetBoxSize (__gal_screen, CURSORWIDTH, CURSORHEIGHT, &csrimgpitch);
|
||||
|
||||
/* always initialize fields by explicitly assignments */
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmPitch = csrimgpitch;
|
||||
|
||||
@@ -139,9 +139,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
|
||||
return load_cursor_from_mem (area);
|
||||
}
|
||||
|
||||
static BITMAP csr_bmp = {
|
||||
BMP_TYPE_NORMAL, 0, 0, 0, 0, CURSORWIDTH, CURSORHEIGHT
|
||||
};
|
||||
static BITMAP csr_bmp;
|
||||
|
||||
/* Only called from InitCursor and client code. */
|
||||
HCURSOR GUIAPI CreateCursor(int xhotspot, int yhotspot, int w, int h,
|
||||
@@ -279,11 +277,10 @@ BOOL realInitCursor(void)
|
||||
&csrimgpitch);
|
||||
|
||||
csr_bmp.bmType = BMP_TYPE_NORMAL;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
|
||||
csr_bmp.bmBitsPerPixel = __gal_screen->format->BitsPerPixel;
|
||||
csr_bmp.bmBytesPerPixel = __gal_screen->format->BytesPerPixel;
|
||||
csr_bmp.bmWidth = CURSORWIDTH;
|
||||
csr_bmp.bmHeight = CURSORHEIGHT;
|
||||
csr_bmp.bmPitch = csrimgpitch;
|
||||
|
||||
if( !(savedbits = malloc(csrimgsize)) )
|
||||
|
||||
Reference in New Issue
Block a user