From 7c4cb515b6866661eb83c9c0ce255684088808b2 Mon Sep 17 00:00:00 2001 From: Gregg Mattinson Date: Wed, 3 Jul 2002 21:10:43 +0000 Subject: [PATCH] Cast void* to char* for pointer arithmetic. --- debugger/module.c | 5 +- dlls/dplayx/dplayx_global.c | 3 +- dlls/msvcrt/file.c | 4 +- dlls/msvcrt/misc.c | 4 +- dlls/shlwapi/ordinal.c | 4 +- dlls/wininet/http.c | 6 +- dlls/winmm/lolvldrv.c | 6 +- files/smb.c | 2 +- graphics/x11drv/dib.c | 196 ++++++++++++++++++------------------ memory/global.c | 2 +- memory/selector.c | 2 +- memory/virtual.c | 2 +- tools/winedump/pe.c | 4 +- windows/syscolor.c | 14 ++- 14 files changed, 125 insertions(+), 129 deletions(-) diff --git a/debugger/module.c b/debugger/module.c index 460e27b7aeb..ff5b81dc23c 100644 --- a/debugger/module.c +++ b/debugger/module.c @@ -519,8 +519,8 @@ static const char* DEBUG_GetDbgInfo(enum DbgInfoLoad dil) */ static int DEBUG_ModuleCompare(const void* p1, const void* p2) { - return (*((const DBG_MODULE**)p1))->load_addr - - (*((const DBG_MODULE**)p2))->load_addr; + return (char*)(*((const DBG_MODULE**)p1))->load_addr - + (char*)(*((const DBG_MODULE**)p2))->load_addr; } /*********************************************************************** @@ -641,4 +641,3 @@ void DEBUG_WalkModules(void) } DBG_free(amod); } - diff --git a/dlls/dplayx/dplayx_global.c b/dlls/dplayx/dplayx_global.c index be481112434..18eb5e091b3 100644 --- a/dlls/dplayx/dplayx_global.c +++ b/dlls/dplayx/dplayx_global.c @@ -90,7 +90,7 @@ void DPLAYX_PrivHeapFree( LPVOID addr ) return; } - lpAddrStart = addr - sizeof(DWORD); /* Find block header */ + lpAddrStart = (char*)addr - sizeof(DWORD); /* Find block header */ dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize; lpMemArea[ dwBlockUsed ].used = 0; @@ -1342,4 +1342,3 @@ LPCSTR DPLAYX_HresultToString(HRESULT hr) return szTempStr; } } - diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index ab9a7c0b9b8..a04f2fdd07c 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1771,7 +1771,7 @@ MSVCRT_size_t MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nmemb, M file->_ptr += pcnt; read += pcnt ; rcnt -= pcnt ; - ptr += pcnt; + ptr = (char*)ptr + pcnt; } else if(!(file->_flag & MSVCRT__IOREAD )) { if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOREAD; @@ -2164,7 +2164,7 @@ MSVCRT_size_t MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_size_t n file->_ptr += pcnt; written = pcnt; wrcnt -= pcnt; - ptr += pcnt; + ptr = (char*)ptr + pcnt; } else if(!(file->_flag & MSVCRT__IOWRT)) { if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOWRT; diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index dd746e3860f..ea917f62c43 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -68,7 +68,7 @@ void* _lfind(const void* match, const void* start, { if (cf(match, start) == 0) return (void *)start; /* found */ - start += elem_size; + start = (char*)start + elem_size; } while (--size); return NULL; } @@ -86,7 +86,7 @@ void* _lsearch(const void* match, void* start, { if (cf(match, start) == 0) return start; /* found */ - start += elem_size; + start = (char*)start + elem_size; } while (--size); /* not found, add to end */ diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index d96676e24cd..7e5c4ce5188 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -1973,7 +1973,7 @@ BOOL WINAPI SHLWAPI_351 ( LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA) */ { GET_FUNC(pGetFileVersionInfoW, version, "GetFileVersionInfoW", 0); - return pGetFileVersionInfoW(w, x, y-0x208, z+0x208); + return pGetFileVersionInfoW(w, x, y-0x208, (char*)z+0x208); } /************************************************************************* @@ -1989,7 +1989,7 @@ WORD WINAPI SHLWAPI_352 ( UINT* z) /* [in] ver length - passed to VerQueryValueA as #4 */ { GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0); - return pVerQueryValueW(w+0x208, x, y, z); + return pVerQueryValueW((char*)w+0x208, x, y, z); } /************************************************************************** diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 4ca1ed6b3cf..9f770024437 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -427,7 +427,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, lpwhr->StdHeaders[i].lpszField && lpwhr->StdHeaders[i].lpszValue) { - cnt += sprintf(lpBuffer + cnt, "%s: %s%s", lpwhr->StdHeaders[i].lpszField, lpwhr->StdHeaders[i].lpszValue, + cnt += sprintf((char*)lpBuffer + cnt, "%s: %s%s", lpwhr->StdHeaders[i].lpszField, lpwhr->StdHeaders[i].lpszValue, index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : "\0"); } } @@ -439,13 +439,13 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, lpwhr->pCustHeaders[i].lpszField && lpwhr->pCustHeaders[i].lpszValue) { - cnt += sprintf(lpBuffer + cnt, "%s: %s%s", + cnt += sprintf((char*)lpBuffer + cnt, "%s: %s%s", lpwhr->pCustHeaders[i].lpszField, lpwhr->pCustHeaders[i].lpszValue, index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : "\0"); } } - strcpy(lpBuffer + cnt, index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : ""); + strcpy((char*)lpBuffer + cnt, index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : ""); *lpdwBufferLength = cnt + delim; bSuccess = TRUE; diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c index 8a91d4a5649..70c55e8e48e 100644 --- a/dlls/winmm/lolvldrv.c +++ b/dlls/winmm/lolvldrv.c @@ -690,7 +690,7 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD if (ptr) { SEGPTR segptr = MapLS(ptr); *(LPMIDIOPENDESC*)ptr = mod32; - *(LPDWORD)(ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser; + *(LPDWORD)((char*)ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser; mod16 = (LPMIDIOPENDESC16)((LPSTR)ptr + sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD)); mod16->hMidi = mod32->hMidi; @@ -1067,7 +1067,7 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW if (ptr) { SEGPTR seg_ptr = MapLS( ptr ); *(LPWAVEOPENDESC*)ptr = wod32; - *(LPDWORD)(ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; + *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); wod16->hWave = wod32->hWave; @@ -1626,7 +1626,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD if (ptr) { SEGPTR seg_ptr = MapLS( ptr ); *(LPWAVEOPENDESC*)ptr = wod32; - *(LPDWORD)(ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; + *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); wod16->hWave = wod32->hWave; diff --git a/files/smb.c b/files/smb.c index e1eb44b499b..3fdb7d9e9eb 100644 --- a/files/smb.c +++ b/files/smb.c @@ -1111,7 +1111,7 @@ BOOL WINAPI SMB_ReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD if(!read) break; total += read; - buffer += read; + buffer = (char*)buffer + read; offset += read; if(total>=bytesToRead) break; diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index 4900f826afd..6dbe11bdfd4 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -353,8 +353,8 @@ static void X11DRV_DIB_Convert_any_asis(int width, int height, width*=bytes_per_pixel; for (y=0; y> 10) & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -421,8 +421,8 @@ static void X11DRV_DIB_Convert_555_to_565_asis(int width, int height, ((srcval >> 4) & 0x0020) | /* g - 1 bit */ (srcval & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -455,8 +455,8 @@ static void X11DRV_DIB_Convert_555_to_565_reverse(int width, int height, ((srcval >> 4) & 0x0020) | /* g - 1 bit */ ((srcval << 11) & 0xf800); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -482,8 +482,8 @@ static void X11DRV_DIB_Convert_555_to_888_asis(int width, int height, ((srcval >> 12) & 0x07); /* h - 3 bits */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -509,8 +509,8 @@ static void X11DRV_DIB_Convert_555_to_888_reverse(int width, int height, ((srcval >> 2) & 0x07); /* l - 3 bits */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -535,8 +535,8 @@ static void X11DRV_DIB_Convert_555_to_0888_asis(int width, int height, ((srcval << 3) & 0x0000f8) | /* l */ ((srcval >> 2) & 0x000007); /* l - 3 bits */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -561,8 +561,8 @@ static void X11DRV_DIB_Convert_555_to_0888_reverse(int width, int height, ((srcval << 19) & 0xf80000) | /* l */ ((srcval << 14) & 0x070000); /* l - 3 bits */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -622,8 +622,8 @@ static void X11DRV_DIB_Convert_5x5_to_any0888(int width, int height, (green << gLeftShift) | (blue << bLeftShift); } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -658,8 +658,8 @@ static void X11DRV_DIB_Convert_565_reverse(int width, int height, ( srcval & 0x07e0) | /* g */ ((srcval >> 11) & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -688,8 +688,8 @@ static void X11DRV_DIB_Convert_565_to_555_asis(int width, int height, *((WORD*)dstpixel)=((srcval >> 1) & 0x7fe0) | /* h, g */ ( srcval & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -720,8 +720,8 @@ static void X11DRV_DIB_Convert_565_to_555_reverse(int width, int height, ((srcval >> 1) & 0x03e0) | /* g */ ((srcval << 10) & 0x7c00); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -747,8 +747,8 @@ static void X11DRV_DIB_Convert_565_to_888_asis(int width, int height, ((srcval >> 13) & 0x07); /* h - 3 bits */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -774,8 +774,8 @@ static void X11DRV_DIB_Convert_565_to_888_reverse(int width, int height, ((srcval >> 2) & 0x07); /* l - 3 bits */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -800,8 +800,8 @@ static void X11DRV_DIB_Convert_565_to_0888_asis(int width, int height, ((srcval << 3) & 0x0000f8) | /* l */ ((srcval >> 2) & 0x000007); /* l - 3 bits */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -826,8 +826,8 @@ static void X11DRV_DIB_Convert_565_to_0888_reverse(int width, int height, ((srcval << 19) & 0xf80000) | /* l */ ((srcval << 14) & 0x070000); /* l - 3 bits */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -853,8 +853,8 @@ static void X11DRV_DIB_Convert_888_reverse(int width, int height, srcpixel+=3; dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -904,8 +904,8 @@ static void X11DRV_DIB_Convert_888_to_555_asis(int width, int height, *dstpixel++=dstval; srcbyte+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -954,9 +954,9 @@ static void X11DRV_DIB_Convert_888_to_555_reverse(int width, int height, dstval|=((srcbyte[2] >> 3) & 0x001f); /* h */ *dstpixel++=dstval; srcbyte+=3; - } - srcbits += srclinebytes; - dstbits += dstlinebytes; + } + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1006,8 +1006,8 @@ static void X11DRV_DIB_Convert_888_to_565_asis(int width, int height, *dstpixel++=dstval; srcbyte+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1057,8 +1057,8 @@ static void X11DRV_DIB_Convert_888_to_565_reverse(int width, int height, *dstpixel++=dstval; srcbyte+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1098,8 +1098,8 @@ static void X11DRV_DIB_Convert_888_to_0888_asis(int width, int height, srcpixel=(LPDWORD)(((char*)srcpixel)+3); *dstpixel++=( srcval & 0x00ffffff); /* h, g, l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1148,8 +1148,8 @@ static void X11DRV_DIB_Convert_888_to_0888_reverse(int width, int height, ( srcval & 0x00ff00) | /* g */ ((srcval << 16) & 0xff0000); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1175,8 +1175,8 @@ static void X11DRV_DIB_Convert_rgb888_to_any0888(int width, int height, (srcpixel[2] << rLeftShift); /* r */ srcpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1202,8 +1202,8 @@ static void X11DRV_DIB_Convert_bgr888_to_any0888(int width, int height, (srcpixel[2] << bLeftShift); /* b */ srcpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1229,8 +1229,8 @@ static void X11DRV_DIB_Convert_0888_reverse(int width, int height, ( srcval & 0x0000ff00) | /* g */ ((srcval >> 16) & 0x000000ff); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1262,8 +1262,8 @@ static void X11DRV_DIB_Convert_0888_any(int width, int height, (((srcval >> gRightShift) & 0xff) << gLeftShift) | (((srcval >> bRightShift) & 0xff) << bLeftShift); } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1285,8 +1285,8 @@ static void X11DRV_DIB_Convert_0888_to_555_asis(int width, int height, ((srcval >> 6) & 0x03e0) | /* g */ ((srcval >> 3) & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1308,8 +1308,8 @@ static void X11DRV_DIB_Convert_0888_to_555_reverse(int width, int height, ((srcval >> 6) & 0x03e0) | /* g */ ((srcval << 7) & 0x7c00); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1331,8 +1331,8 @@ static void X11DRV_DIB_Convert_0888_to_565_asis(int width, int height, ((srcval >> 5) & 0x07e0) | /* g */ ((srcval >> 3) & 0x001f); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1354,8 +1354,8 @@ static void X11DRV_DIB_Convert_0888_to_565_reverse(int width, int height, ((srcval >> 5) & 0x07e0) | /* g */ ((srcval << 8) & 0xf800); /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1404,8 +1404,8 @@ static void X11DRV_DIB_Convert_any0888_to_5x5(int width, int height, (((srcval >> gRightShift) & gdst) << gLeftShift) | (((srcval >> bRightShift) & bdst) << bLeftShift); } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1442,8 +1442,8 @@ static void X11DRV_DIB_Convert_0888_to_888_asis(int width, int height, *((WORD*)dstbyte)++=srcval; /* h, g */ *dstbyte++=srcval >> 16; /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1494,8 +1494,8 @@ static void X11DRV_DIB_Convert_0888_to_888_reverse(int width, int height, (srcval & 0xff00); /* g */ *dstbyte++=srcval; /* l */ } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1523,8 +1523,8 @@ static void X11DRV_DIB_Convert_any0888_to_rgb888(int width, int height, dstpixel[2]=(srcval >> rRightShift); /* r */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1552,8 +1552,8 @@ static void X11DRV_DIB_Convert_any0888_to_bgr888(int width, int height, dstpixel[2]=(srcval >> bRightShift); /* b */ dstpixel+=3; } - srcbits += srclinebytes; - dstbits += dstlinebytes; + srcbits = (char*)srcbits + srclinebytes; + dstbits = (char*)dstbits + dstlinebytes; } } @@ -1697,7 +1697,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -1741,7 +1741,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0x7c00) { @@ -1770,7 +1770,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -1803,7 +1803,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0xf800) { @@ -1832,7 +1832,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -1880,7 +1880,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -1905,7 +1905,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, if ((dstwidth&7)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } @@ -2071,7 +2071,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, if ((dstwidth&1)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2115,7 +2115,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, if ((dstwidth&1)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0x7c00) { @@ -2144,7 +2144,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, if ((dstwidth&1)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2177,7 +2177,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, if ((dstwidth&1)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0xf800) { @@ -2206,7 +2206,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, if ((dstwidth&1)!=0) { *dstbyte=dstval; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2256,7 +2256,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, srcbyte[1], srcbyte[0]) << 4); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2286,7 +2286,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, srcbyte[1], srcbyte[2]) << 4); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } @@ -2332,7 +2332,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, srcbyte[1], srcbyte[0]) << 4); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2362,7 +2362,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, srcbyte[1], srcbyte[2]) << 4); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } @@ -2631,7 +2631,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, srcval.peGreen, srcval.peBlue); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2666,7 +2666,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, ((srcval << 3) & 0xf8) | /* b */ ((srcval >> 2) & 0x07) ); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0x7c00) { @@ -2686,7 +2686,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, ((srcval >> 7) & 0xf8) | /* b */ ((srcval >> 12) & 0x07) ); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2710,7 +2710,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, ((srcval << 3) & 0xf8) | /* b */ ((srcval >> 2) & 0x07) ); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else if (bmpImage->blue_mask==0xf800) { @@ -2730,7 +2730,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, ((srcval >> 8) & 0xf8) | /* b */ ((srcval >> 13) & 0x07) ); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2769,7 +2769,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, srcbyte[0]); srcbyte+=bytes_per_pixel; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -2785,7 +2785,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, srcbyte[2]); srcbyte+=bytes_per_pixel; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } @@ -3857,7 +3857,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits, dstbyte[2]=srcval.peRed; dstbyte+=3; } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { @@ -4436,7 +4436,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits, (srcval.peGreen << gShift) | (srcval.peBlue << bShift); } - srcbits -= bmpImage->bytes_per_line; + srcbits = (char*)srcbits - bmpImage->bytes_per_line; dstbits += linebytes; } } else { diff --git a/memory/global.c b/memory/global.c index 17e6b001fdb..0777d995348 100644 --- a/memory/global.c +++ b/memory/global.c @@ -1621,7 +1621,7 @@ VOID WINAPI GlobalMemoryStatus( #endif /* FIXME: should do something for other systems */ GetSystemInfo(&si); - lpmem->dwTotalVirtual = si.lpMaximumApplicationAddress-si.lpMinimumApplicationAddress; + lpmem->dwTotalVirtual = (char*)si.lpMaximumApplicationAddress-(char*)si.lpMinimumApplicationAddress; /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */ lpmem->dwAvailVirtual = lpmem->dwTotalVirtual-64*1024; memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS)); diff --git a/memory/selector.c b/memory/selector.c index 657f3b650ec..7c82d4e44dd 100644 --- a/memory/selector.c +++ b/memory/selector.c @@ -168,7 +168,7 @@ static void SELECTOR_SetEntries( WORD sel, const void *base, DWORD size, unsigne for (i = 0; i < count; i++) { wine_ldt_set_entry( sel + (i << __AHSHIFT), &entry ); - wine_ldt_set_base( &entry, wine_ldt_get_base(&entry) + 0x10000 ); + wine_ldt_set_base( &entry, (char*)wine_ldt_get_base(&entry) + 0x10000); /* yep, Windows sets limit like that, not 64K sel units */ wine_ldt_set_limit( &entry, wine_ldt_get_limit(&entry) - 0x10000 ); } diff --git a/memory/virtual.c b/memory/virtual.c index 988e3c6a537..c58402d0f7a 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -221,7 +221,7 @@ static FILE_VIEW *VIRTUAL_FindView( const void *addr ) /* [in] Address */ view = NULL; break; } - if (view->base + view->size > addr) break; + if ((char*)view->base + view->size > (char*)addr) break; view = view->next; } LeaveCriticalSection(&csVirtual); diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 14a71ff4752..943fbdf30d5 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -81,8 +81,8 @@ void* PRD(unsigned long prd, unsigned long len) unsigned long Offset(void* ptr) { if (ptr < base) {printf("<<<<= base + total_len) {printf("<<<<= (char*)base + total_len) {printf("<<<<