Cast void* to char* for pointer arithmetic.

This commit is contained in:
Gregg Mattinson 2002-07-03 21:10:43 +00:00 committed by Alexandre Julliard
parent d02075942a
commit 7c4cb515b6
14 changed files with 125 additions and 129 deletions

View file

@ -519,8 +519,8 @@ static const char* DEBUG_GetDbgInfo(enum DbgInfoLoad dil)
*/ */
static int DEBUG_ModuleCompare(const void* p1, const void* p2) static int DEBUG_ModuleCompare(const void* p1, const void* p2)
{ {
return (*((const DBG_MODULE**)p1))->load_addr - return (char*)(*((const DBG_MODULE**)p1))->load_addr -
(*((const DBG_MODULE**)p2))->load_addr; (char*)(*((const DBG_MODULE**)p2))->load_addr;
} }
/*********************************************************************** /***********************************************************************
@ -641,4 +641,3 @@ void DEBUG_WalkModules(void)
} }
DBG_free(amod); DBG_free(amod);
} }

View file

@ -90,7 +90,7 @@ void DPLAYX_PrivHeapFree( LPVOID addr )
return; return;
} }
lpAddrStart = addr - sizeof(DWORD); /* Find block header */ lpAddrStart = (char*)addr - sizeof(DWORD); /* Find block header */
dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize; dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize;
lpMemArea[ dwBlockUsed ].used = 0; lpMemArea[ dwBlockUsed ].used = 0;
@ -1342,4 +1342,3 @@ LPCSTR DPLAYX_HresultToString(HRESULT hr)
return szTempStr; return szTempStr;
} }
} }

View file

@ -1771,7 +1771,7 @@ MSVCRT_size_t MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nmemb, M
file->_ptr += pcnt; file->_ptr += pcnt;
read += pcnt ; read += pcnt ;
rcnt -= pcnt ; rcnt -= pcnt ;
ptr += pcnt; ptr = (char*)ptr + pcnt;
} else if(!(file->_flag & MSVCRT__IOREAD )) { } else if(!(file->_flag & MSVCRT__IOREAD )) {
if(file->_flag & MSVCRT__IORW) { if(file->_flag & MSVCRT__IORW) {
file->_flag |= MSVCRT__IOREAD; 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; file->_ptr += pcnt;
written = pcnt; written = pcnt;
wrcnt -= pcnt; wrcnt -= pcnt;
ptr += pcnt; ptr = (char*)ptr + pcnt;
} else if(!(file->_flag & MSVCRT__IOWRT)) { } else if(!(file->_flag & MSVCRT__IOWRT)) {
if(file->_flag & MSVCRT__IORW) { if(file->_flag & MSVCRT__IORW) {
file->_flag |= MSVCRT__IOWRT; file->_flag |= MSVCRT__IOWRT;

View file

@ -68,7 +68,7 @@ void* _lfind(const void* match, const void* start,
{ {
if (cf(match, start) == 0) if (cf(match, start) == 0)
return (void *)start; /* found */ return (void *)start; /* found */
start += elem_size; start = (char*)start + elem_size;
} while (--size); } while (--size);
return NULL; return NULL;
} }
@ -86,7 +86,7 @@ void* _lsearch(const void* match, void* start,
{ {
if (cf(match, start) == 0) if (cf(match, start) == 0)
return start; /* found */ return start; /* found */
start += elem_size; start = (char*)start + elem_size;
} while (--size); } while (--size);
/* not found, add to end */ /* not found, add to end */

View file

@ -1973,7 +1973,7 @@ BOOL WINAPI SHLWAPI_351 (
LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA) */ LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA) */
{ {
GET_FUNC(pGetFileVersionInfoW, version, "GetFileVersionInfoW", 0); 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 */ UINT* z) /* [in] ver length - passed to VerQueryValueA as #4 */
{ {
GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0); GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0);
return pVerQueryValueW(w+0x208, x, y, z); return pVerQueryValueW((char*)w+0x208, x, y, z);
} }
/************************************************************************** /**************************************************************************

View file

@ -427,7 +427,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel,
lpwhr->StdHeaders[i].lpszField && lpwhr->StdHeaders[i].lpszField &&
lpwhr->StdHeaders[i].lpszValue) 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"); 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].lpszField &&
lpwhr->pCustHeaders[i].lpszValue) 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, lpwhr->pCustHeaders[i].lpszField, lpwhr->pCustHeaders[i].lpszValue,
index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : "\0"); 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; *lpdwBufferLength = cnt + delim;
bSuccess = TRUE; bSuccess = TRUE;

View file

@ -690,7 +690,7 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD
if (ptr) { if (ptr) {
SEGPTR segptr = MapLS(ptr); SEGPTR segptr = MapLS(ptr);
*(LPMIDIOPENDESC*)ptr = mod32; *(LPMIDIOPENDESC*)ptr = mod32;
*(LPDWORD)(ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser; *(LPDWORD)((char*)ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser;
mod16 = (LPMIDIOPENDESC16)((LPSTR)ptr + sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD)); mod16 = (LPMIDIOPENDESC16)((LPSTR)ptr + sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD));
mod16->hMidi = mod32->hMidi; mod16->hMidi = mod32->hMidi;
@ -1067,7 +1067,7 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW
if (ptr) { if (ptr) {
SEGPTR seg_ptr = MapLS( ptr ); SEGPTR seg_ptr = MapLS( ptr );
*(LPWAVEOPENDESC*)ptr = wod32; *(LPWAVEOPENDESC*)ptr = wod32;
*(LPDWORD)(ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser;
wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD));
wod16->hWave = wod32->hWave; wod16->hWave = wod32->hWave;
@ -1626,7 +1626,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD
if (ptr) { if (ptr) {
SEGPTR seg_ptr = MapLS( ptr ); SEGPTR seg_ptr = MapLS( ptr );
*(LPWAVEOPENDESC*)ptr = wod32; *(LPWAVEOPENDESC*)ptr = wod32;
*(LPDWORD)(ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser; *(LPDWORD)((char*)ptr + sizeof(LPWAVEOPENDESC)) = *lpdwUser;
wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD)); wod16 = (LPWAVEOPENDESC16)((LPSTR)ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD));
wod16->hWave = wod32->hWave; wod16->hWave = wod32->hWave;

View file

@ -1111,7 +1111,7 @@ BOOL WINAPI SMB_ReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD
if(!read) if(!read)
break; break;
total += read; total += read;
buffer += read; buffer = (char*)buffer + read;
offset += read; offset += read;
if(total>=bytesToRead) if(total>=bytesToRead)
break; break;

View file

@ -353,8 +353,8 @@ static void X11DRV_DIB_Convert_any_asis(int width, int height,
width*=bytes_per_pixel; width*=bytes_per_pixel;
for (y=0; y<height; y++) { for (y=0; y<height; y++) {
memcpy(dstbits, srcbits, width); memcpy(dstbits, srcbits, width);
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -389,8 +389,8 @@ static void X11DRV_DIB_Convert_555_reverse(int width, int height,
( srcval & 0x03e0) | /* g */ ( srcval & 0x03e0) | /* g */
((srcval >> 10) & 0x001f); /* l */ ((srcval >> 10) & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 4) & 0x0020) | /* g - 1 bit */
(srcval & 0x001f); /* l */ (srcval & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 4) & 0x0020) | /* g - 1 bit */
((srcval << 11) & 0xf800); /* l */ ((srcval << 11) & 0xf800); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ ((srcval >> 12) & 0x07); /* h - 3 bits */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ ((srcval >> 2) & 0x07); /* l - 3 bits */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 << 3) & 0x0000f8) | /* l */
((srcval >> 2) & 0x000007); /* l - 3 bits */ ((srcval >> 2) & 0x000007); /* l - 3 bits */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 << 19) & 0xf80000) | /* l */
((srcval << 14) & 0x070000); /* l - 3 bits */ ((srcval << 14) & 0x070000); /* l - 3 bits */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -622,8 +622,8 @@ static void X11DRV_DIB_Convert_5x5_to_any0888(int width, int height,
(green << gLeftShift) | (green << gLeftShift) |
(blue << bLeftShift); (blue << bLeftShift);
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -658,8 +658,8 @@ static void X11DRV_DIB_Convert_565_reverse(int width, int height,
( srcval & 0x07e0) | /* g */ ( srcval & 0x07e0) | /* g */
((srcval >> 11) & 0x001f); /* l */ ((srcval >> 11) & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ *((WORD*)dstpixel)=((srcval >> 1) & 0x7fe0) | /* h, g */
( srcval & 0x001f); /* l */ ( srcval & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 1) & 0x03e0) | /* g */
((srcval << 10) & 0x7c00); /* l */ ((srcval << 10) & 0x7c00); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ ((srcval >> 13) & 0x07); /* h - 3 bits */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ ((srcval >> 2) & 0x07); /* l - 3 bits */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 << 3) & 0x0000f8) | /* l */
((srcval >> 2) & 0x000007); /* l - 3 bits */ ((srcval >> 2) & 0x000007); /* l - 3 bits */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 << 19) & 0xf80000) | /* l */
((srcval << 14) & 0x070000); /* l - 3 bits */ ((srcval << 14) & 0x070000); /* l - 3 bits */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -853,8 +853,8 @@ static void X11DRV_DIB_Convert_888_reverse(int width, int height,
srcpixel+=3; srcpixel+=3;
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -904,8 +904,8 @@ static void X11DRV_DIB_Convert_888_to_555_asis(int width, int height,
*dstpixel++=dstval; *dstpixel++=dstval;
srcbyte+=3; srcbyte+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ dstval|=((srcbyte[2] >> 3) & 0x001f); /* h */
*dstpixel++=dstval; *dstpixel++=dstval;
srcbyte+=3; srcbyte+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1006,8 +1006,8 @@ static void X11DRV_DIB_Convert_888_to_565_asis(int width, int height,
*dstpixel++=dstval; *dstpixel++=dstval;
srcbyte+=3; srcbyte+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1057,8 +1057,8 @@ static void X11DRV_DIB_Convert_888_to_565_reverse(int width, int height,
*dstpixel++=dstval; *dstpixel++=dstval;
srcbyte+=3; srcbyte+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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); srcpixel=(LPDWORD)(((char*)srcpixel)+3);
*dstpixel++=( srcval & 0x00ffffff); /* h, g, l */ *dstpixel++=( srcval & 0x00ffffff); /* h, g, l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 & 0x00ff00) | /* g */
((srcval << 16) & 0xff0000); /* l */ ((srcval << 16) & 0xff0000); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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[2] << rLeftShift); /* r */
srcpixel+=3; srcpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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[2] << bLeftShift); /* b */
srcpixel+=3; srcpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1229,8 +1229,8 @@ static void X11DRV_DIB_Convert_0888_reverse(int width, int height,
( srcval & 0x0000ff00) | /* g */ ( srcval & 0x0000ff00) | /* g */
((srcval >> 16) & 0x000000ff); /* l */ ((srcval >> 16) & 0x000000ff); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1262,8 +1262,8 @@ static void X11DRV_DIB_Convert_0888_any(int width, int height,
(((srcval >> gRightShift) & 0xff) << gLeftShift) | (((srcval >> gRightShift) & 0xff) << gLeftShift) |
(((srcval >> bRightShift) & 0xff) << bLeftShift); (((srcval >> bRightShift) & 0xff) << bLeftShift);
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 6) & 0x03e0) | /* g */
((srcval >> 3) & 0x001f); /* l */ ((srcval >> 3) & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 6) & 0x03e0) | /* g */
((srcval << 7) & 0x7c00); /* l */ ((srcval << 7) & 0x7c00); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 5) & 0x07e0) | /* g */
((srcval >> 3) & 0x001f); /* l */ ((srcval >> 3) & 0x001f); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> 5) & 0x07e0) | /* g */
((srcval << 8) & 0xf800); /* l */ ((srcval << 8) & 0xf800); /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 >> gRightShift) & gdst) << gLeftShift) |
(((srcval >> bRightShift) & bdst) << bLeftShift); (((srcval >> bRightShift) & bdst) << bLeftShift);
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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 */ *((WORD*)dstbyte)++=srcval; /* h, g */
*dstbyte++=srcval >> 16; /* l */ *dstbyte++=srcval >> 16; /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1494,8 +1494,8 @@ static void X11DRV_DIB_Convert_0888_to_888_reverse(int width, int height,
(srcval & 0xff00); /* g */ (srcval & 0xff00); /* g */
*dstbyte++=srcval; /* l */ *dstbyte++=srcval; /* l */
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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[2]=(srcval >> rRightShift); /* r */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; 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[2]=(srcval >> bRightShift); /* b */
dstpixel+=3; dstpixel+=3;
} }
srcbits += srclinebytes; srcbits = (char*)srcbits + srclinebytes;
dstbits += dstlinebytes; dstbits = (char*)dstbits + dstlinebytes;
} }
} }
@ -1697,7 +1697,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -1741,7 +1741,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0x7c00) { } else if (bmpImage->blue_mask==0x7c00) {
@ -1770,7 +1770,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -1803,7 +1803,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0xf800) { } else if (bmpImage->blue_mask==0xf800) {
@ -1832,7 +1832,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -1880,7 +1880,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -1905,7 +1905,7 @@ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits,
if ((dstwidth&7)!=0) { if ((dstwidth&7)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} }
@ -2071,7 +2071,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
if ((dstwidth&1)!=0) { if ((dstwidth&1)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2115,7 +2115,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
if ((dstwidth&1)!=0) { if ((dstwidth&1)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0x7c00) { } else if (bmpImage->blue_mask==0x7c00) {
@ -2144,7 +2144,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
if ((dstwidth&1)!=0) { if ((dstwidth&1)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2177,7 +2177,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
if ((dstwidth&1)!=0) { if ((dstwidth&1)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0xf800) { } else if (bmpImage->blue_mask==0xf800) {
@ -2206,7 +2206,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
if ((dstwidth&1)!=0) { if ((dstwidth&1)!=0) {
*dstbyte=dstval; *dstbyte=dstval;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2256,7 +2256,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
srcbyte[1], srcbyte[1],
srcbyte[0]) << 4); srcbyte[0]) << 4);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2286,7 +2286,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
srcbyte[1], srcbyte[1],
srcbyte[2]) << 4); srcbyte[2]) << 4);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} }
@ -2332,7 +2332,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
srcbyte[1], srcbyte[1],
srcbyte[0]) << 4); srcbyte[0]) << 4);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2362,7 +2362,7 @@ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits,
srcbyte[1], srcbyte[1],
srcbyte[2]) << 4); srcbyte[2]) << 4);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} }
@ -2631,7 +2631,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
srcval.peGreen, srcval.peGreen,
srcval.peBlue); srcval.peBlue);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2666,7 +2666,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
((srcval << 3) & 0xf8) | /* b */ ((srcval << 3) & 0xf8) | /* b */
((srcval >> 2) & 0x07) ); ((srcval >> 2) & 0x07) );
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0x7c00) { } 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 >> 7) & 0xf8) | /* b */
((srcval >> 12) & 0x07) ); ((srcval >> 12) & 0x07) );
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2710,7 +2710,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
((srcval << 3) & 0xf8) | /* b */ ((srcval << 3) & 0xf8) | /* b */
((srcval >> 2) & 0x07) ); ((srcval >> 2) & 0x07) );
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else if (bmpImage->blue_mask==0xf800) { } 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 >> 8) & 0xf8) | /* b */
((srcval >> 13) & 0x07) ); ((srcval >> 13) & 0x07) );
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2769,7 +2769,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
srcbyte[0]); srcbyte[0]);
srcbyte+=bytes_per_pixel; srcbyte+=bytes_per_pixel;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -2785,7 +2785,7 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits,
srcbyte[2]); srcbyte[2]);
srcbyte+=bytes_per_pixel; srcbyte+=bytes_per_pixel;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} }
@ -3857,7 +3857,7 @@ static void X11DRV_DIB_GetImageBits_24( int lines, BYTE *dstbits,
dstbyte[2]=srcval.peRed; dstbyte[2]=srcval.peRed;
dstbyte+=3; dstbyte+=3;
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {
@ -4436,7 +4436,7 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
(srcval.peGreen << gShift) | (srcval.peGreen << gShift) |
(srcval.peBlue << bShift); (srcval.peBlue << bShift);
} }
srcbits -= bmpImage->bytes_per_line; srcbits = (char*)srcbits - bmpImage->bytes_per_line;
dstbits += linebytes; dstbits += linebytes;
} }
} else { } else {

View file

@ -1621,7 +1621,7 @@ VOID WINAPI GlobalMemoryStatus(
#endif #endif
/* FIXME: should do something for other systems */ /* FIXME: should do something for other systems */
GetSystemInfo(&si); 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 */ /* 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; lpmem->dwAvailVirtual = lpmem->dwTotalVirtual-64*1024;
memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS)); memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS));

View file

@ -168,7 +168,7 @@ static void SELECTOR_SetEntries( WORD sel, const void *base, DWORD size, unsigne
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
wine_ldt_set_entry( sel + (i << __AHSHIFT), &entry ); 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 */ /* yep, Windows sets limit like that, not 64K sel units */
wine_ldt_set_limit( &entry, wine_ldt_get_limit(&entry) - 0x10000 ); wine_ldt_set_limit( &entry, wine_ldt_get_limit(&entry) - 0x10000 );
} }

View file

@ -221,7 +221,7 @@ static FILE_VIEW *VIRTUAL_FindView( const void *addr ) /* [in] Address */
view = NULL; view = NULL;
break; break;
} }
if (view->base + view->size > addr) break; if ((char*)view->base + view->size > (char*)addr) break;
view = view->next; view = view->next;
} }
LeaveCriticalSection(&csVirtual); LeaveCriticalSection(&csVirtual);

View file

@ -81,8 +81,8 @@ void* PRD(unsigned long prd, unsigned long len)
unsigned long Offset(void* ptr) unsigned long Offset(void* ptr)
{ {
if (ptr < base) {printf("<<<<<ptr below\n");return 0;} if (ptr < base) {printf("<<<<<ptr below\n");return 0;}
if (ptr >= base + total_len) {printf("<<<<<ptr above\n");return 0;} if ((char *)ptr >= (char*)base + total_len) {printf("<<<<<ptr above\n");return 0;}
return ptr - base; return (char*)ptr - (char*)base;
} }
void* RVA(unsigned long rva, unsigned long len) void* RVA(unsigned long rva, unsigned long len)

View file

@ -328,9 +328,9 @@ DWORD WINAPI SetSysColorsTemp( const COLORREF *pPens, const HBRUSH *pBrushes, DW
/* allocate our structure to remember old colors */ /* allocate our structure to remember old colors */
LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH)); LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH));
LPVOID p = pOldCol; LPVOID p = pOldCol;
*(DWORD *)p = n; p += sizeof(DWORD); *(DWORD *)p = n; p = (char*)p + sizeof(DWORD);
memcpy(p, SysColorPens, n*sizeof(HPEN)); p += n*sizeof(HPEN); memcpy(p, SysColorPens, n*sizeof(HPEN)); p = (char*)p + n*sizeof(HPEN);
memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p += n*sizeof(HBRUSH); memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p = (char*)p + n*sizeof(HBRUSH);
for (i=0; i < n; i++) for (i=0; i < n; i++)
{ {
@ -345,16 +345,16 @@ DWORD WINAPI SetSysColorsTemp( const COLORREF *pPens, const HBRUSH *pBrushes, DW
LPVOID pOldCol = (LPVOID)n; LPVOID pOldCol = (LPVOID)n;
LPVOID p = pOldCol; LPVOID p = pOldCol;
DWORD nCount = *(DWORD *)p; DWORD nCount = *(DWORD *)p;
p += sizeof(DWORD); p = (char*)p + sizeof(DWORD);
for (i=0; i < nCount; i++) for (i=0; i < nCount; i++)
{ {
DeleteObject(SysColorPens[i]); DeleteObject(SysColorPens[i]);
SysColorPens[i] = *(HPEN *)p; p += sizeof(HPEN); SysColorPens[i] = *(HPEN *)p; p = (char*)p + sizeof(HPEN);
} }
for (i=0; i < nCount; i++) for (i=0; i < nCount; i++)
{ {
SysColorBrushes[i] = *(HBRUSH *)p; p += sizeof(HBRUSH); SysColorBrushes[i] = *(HBRUSH *)p; p = (char*)p + sizeof(HBRUSH);
} }
/* get rid of storage structure */ /* get rid of storage structure */
HeapFree(GetProcessHeap(), 0, pOldCol); HeapFree(GetProcessHeap(), 0, pOldCol);
@ -395,5 +395,3 @@ HPEN SYSCOLOR_GetPen( INT index )
return SysColorPens[index]; return SysColorPens[index];
} }