diff --git a/dlls/winspool/info.c b/dlls/winspool/info.c index ba3991ddbed..d5af30ae46c 100644 --- a/dlls/winspool/info.c +++ b/dlls/winspool/info.c @@ -764,16 +764,16 @@ static LPDEVMODEW DEVMODEcpyAtoW(DEVMODEW *dmW, const DEVMODEA *dmA) Formname = (dmA->dmSize > off_formname); size = dmA->dmSize + CCHDEVICENAME + (Formname ? CCHFORMNAME : 0); - MultiByteToWideChar(CP_ACP, 0, dmA->dmDeviceName, -1, dmW->dmDeviceName, - CCHDEVICENAME); + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)dmA->dmDeviceName, -1, + dmW->dmDeviceName, CCHDEVICENAME); if(!Formname) { memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA->dmSize - CCHDEVICENAME); } else { memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, off_formname - CCHDEVICENAME); - MultiByteToWideChar(CP_ACP, 0, dmA->dmFormName, -1, dmW->dmFormName, - CCHFORMNAME); + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)dmA->dmFormName, -1, + dmW->dmFormName, CCHFORMNAME); memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA->dmSize - (off_formname + CCHFORMNAME)); } @@ -798,16 +798,16 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW) Formname = (dmW->dmSize > off_formname); size = dmW->dmSize - CCHDEVICENAME - (Formname ? CCHFORMNAME : 0); dmA = HeapAlloc(heap, HEAP_ZERO_MEMORY, size + dmW->dmDriverExtra); - WideCharToMultiByte(CP_ACP, 0, dmW->dmDeviceName, -1, dmA->dmDeviceName, - CCHDEVICENAME, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, dmW->dmDeviceName, -1, + (LPSTR)dmA->dmDeviceName, CCHDEVICENAME, NULL, NULL); if(!Formname) { memcpy(&dmA->dmSpecVersion, &dmW->dmSpecVersion, dmW->dmSize - CCHDEVICENAME * sizeof(WCHAR)); } else { memcpy(&dmA->dmSpecVersion, &dmW->dmSpecVersion, off_formname - CCHDEVICENAME * sizeof(WCHAR)); - WideCharToMultiByte(CP_ACP, 0, dmW->dmFormName, -1, dmA->dmFormName, - CCHFORMNAME, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, dmW->dmFormName, -1, + (LPSTR)dmA->dmFormName, CCHFORMNAME, NULL, NULL); memcpy(&dmA->dmLogPixels, &dmW->dmLogPixels, dmW->dmSize - (off_formname + CCHFORMNAME * sizeof(WCHAR))); } @@ -2237,10 +2237,11 @@ static void WINSPOOL_GetDefaultDevMode( BOOL unicode) { DEVMODEA dm; + static const char szwps[] = "wineps.drv"; /* fill default DEVMODE - should be read from ppd... */ ZeroMemory( &dm, sizeof(dm) ); - strcpy(dm.dmDeviceName,"wineps.drv"); + memcpy(dm.dmDeviceName,szwps,sizeof szwps); dm.dmSpecVersion = DM_SPECVERSION; dm.dmDriverVersion = 1; dm.dmSize = sizeof(DEVMODEA); @@ -2972,8 +2973,8 @@ static BOOL WINSPOOL_GetDriverInfoFromReg( *pcbNeeded = WideCharToMultiByte(CP_ACP, 0, DriverName, -1, NULL, 0, NULL, NULL); if(*pcbNeeded <= cbBuf) - WideCharToMultiByte(CP_ACP, 0, DriverName, -1, strPtr, *pcbNeeded, - NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, DriverName, -1, + (LPSTR)strPtr, *pcbNeeded, NULL, NULL); } if(Level == 1) { if(ptr) @@ -3010,8 +3011,8 @@ static BOOL WINSPOOL_GetDriverInfoFromReg( if(unicode) strcpyW((LPWSTR)strPtr, pEnvironment); else - WideCharToMultiByte(CP_ACP, 0, pEnvironment, -1, strPtr, size, - NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, pEnvironment, -1, + (LPSTR)strPtr, size, NULL, NULL); if(ptr) ((PDRIVER_INFO_3W) ptr)->pEnvironment = (LPWSTR)strPtr; strPtr = (pDriverStrings) ? (pDriverStrings + (*pcbNeeded)) : NULL; @@ -3293,7 +3294,7 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment, if (ret) { DWORD needed; needed = 1 + WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1, - pDriverDirectory, cbBuf, NULL, NULL); + (LPSTR)pDriverDirectory, cbBuf, NULL, NULL); if(pcbNeeded) *pcbNeeded = needed; ret = (needed <= cbBuf) ? TRUE : FALSE; @@ -3789,7 +3790,7 @@ BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE buffer,DWORD bufsize, /* add the name of the port if we can fit it */ if ( ofs < bufsize ) - lstrcpynA(&buffer[ofs],portname,bufsize - ofs); + lstrcpynA((LPSTR)&buffer[ofs],portname,bufsize - ofs); n++; } @@ -4911,7 +4912,7 @@ static BOOL string_to_buf(LPCWSTR str, LPBYTE ptr, DWORD cb, DWORD *size, BOOL u *size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); if(*size <= cb) { - WideCharToMultiByte(CP_ACP, 0, str, -1, ptr, *size, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, str, -1, (LPSTR)ptr, *size, NULL, NULL); return TRUE; } return FALSE; diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index cf5600bdbae..7e744cd8468 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -231,7 +231,7 @@ char* convertHexToDWORDStr(BYTE *buf, ULONG bufLen) DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen) { char *s = str; /* Pointer to current */ - char *b = buf; /* Pointer to result */ + char *b = (char*) buf; /* Pointer to result */ ULONG strLen = strlen(str); ULONG strPos = 0; @@ -408,7 +408,7 @@ HRESULT setValue(LPSTR val_name, LPSTR val_data) dwLen--; val_data[dwLen]='\0'; } - lpbData = val_data; + lpbData = (BYTE*) val_data; } else if (dwParseType == REG_DWORD) /* Convert the dword types */ { dwLen = convertHexToDWord(val_data, convert); @@ -1195,7 +1195,7 @@ static void export_hkey(FILE *file, HKEY key, case REG_SZ: case REG_EXPAND_SZ: fputs("\"", file); - REGPROC_export_string(file, *val_buf); + REGPROC_export_string(file, (char*) *val_buf); fputs("\"\n", file); break; diff --git a/programs/taskmgr/dbgchnl.c b/programs/taskmgr/dbgchnl.c index aebbb0ed56c..aec460d898c 100644 --- a/programs/taskmgr/dbgchnl.c +++ b/programs/taskmgr/dbgchnl.c @@ -201,7 +201,7 @@ static int enum_channel(HANDLE hProcess, EnumChannelCB ce, void* user, unsigned int i, ret = 1; unsigned int j; void* buf_addr; - unsigned char buffer[32]; + char buffer[32]; void* addr; const char** cache = NULL; unsigned num_cache, used_cache; diff --git a/programs/wcmd/builtins.c b/programs/wcmd/builtins.c index a8a54c541ba..0d1a2594c5a 100644 --- a/programs/wcmd/builtins.c +++ b/programs/wcmd/builtins.c @@ -69,8 +69,8 @@ void WCMD_clear_screen (void) { if (GetConsoleScreenBufferInfo(hStdOut, &consoleInfo)) { COORD topLeft; - long screenSize; - + DWORD screenSize; + screenSize = consoleInfo.dwSize.X * (consoleInfo.dwSize.Y + 1); topLeft.X = 0; diff --git a/programs/wcmd/wcmdmain.c b/programs/wcmd/wcmdmain.c index 5be391da756..1c1cd5b1b38 100644 --- a/programs/wcmd/wcmdmain.c +++ b/programs/wcmd/wcmdmain.c @@ -496,7 +496,7 @@ static void init_msvcrt_io_block(STARTUPINFO* st) * it's new input & output handles) */ size_t sz = max(sizeof(unsigned) + (sizeof(char) + sizeof(HANDLE)) * 3, st_p.cbReserved2); - char* ptr = HeapAlloc(GetProcessHeap(), 0, sz); + BYTE* ptr = HeapAlloc(GetProcessHeap(), 0, sz); if (ptr) { unsigned num = *(unsigned*)st_p.lpReserved2; @@ -506,7 +506,7 @@ static void init_msvcrt_io_block(STARTUPINFO* st) memcpy(ptr, st_p.lpReserved2, st_p.cbReserved2); st->cbReserved2 = sz; st->lpReserved2 = ptr; - + #define WX_OPEN 0x01 /* see dlls/msvcrt/file.c */ if (num <= 0 || (flags[0] & WX_OPEN)) { diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 64a992ef313..64fc111c109 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -297,7 +297,7 @@ extern struct expr* expr_alloc_struct(struct expr*, const char* element); extern struct expr* expr_alloc_func_call(const char*, int nargs, ...); extern struct expr* expr_alloc_typecast(struct type_expr_t*, struct expr*); extern struct dbg_lvalue expr_eval(struct expr*); -extern struct expr* expr_clone(const struct expr* exp, unsigned* local_binding); +extern struct expr* expr_clone(const struct expr* exp, BOOL *local_binding); extern int expr_free(struct expr* exp); extern int expr_print(const struct expr* exp); diff --git a/programs/winedbg/display.c b/programs/winedbg/display.c index 58e34151fbc..2f9189509cf 100644 --- a/programs/winedbg/display.c +++ b/programs/winedbg/display.c @@ -60,7 +60,7 @@ static inline BOOL cmp_symbol(const SYMBOL_INFO* si1, const SYMBOL_INFO* si2) int display_add(struct expr *exp, int count, char format) { int i; - int local_binding = FALSE; + BOOL local_binding = FALSE; for (i = 0; i < ndisplays; i++) if (displaypoints[i].exp == NULL) diff --git a/programs/winedbg/expr.c b/programs/winedbg/expr.c index 8372b4691a5..b28c737c43c 100644 --- a/programs/winedbg/expr.c +++ b/programs/winedbg/expr.c @@ -770,7 +770,7 @@ int expr_print(const struct expr* exp) return TRUE; } -struct expr* expr_clone(const struct expr* exp, unsigned* local_binding) +struct expr* expr_clone(const struct expr* exp, BOOL *local_binding) { int i; struct expr* rtn; diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index e89470cce3a..f815359fc5a 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -2083,7 +2083,7 @@ static BOOL gdb_startup(struct gdb_context* gdbctx, DEBUG_EVENT* de, unsigned fl { int sock; struct sockaddr_in s_addrs; - int s_len = sizeof(s_addrs); + unsigned int s_len = sizeof(s_addrs); struct pollfd pollfd; IMAGEHLP_MODULE imh_mod; diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index dad9365991b..db589d3619d 100644 --- a/programs/winedbg/info.c +++ b/programs/winedbg/info.c @@ -692,7 +692,7 @@ void info_wine_dbg_channel(BOOL turn_on, const char* chnl, const char* name) struct dll_option_layout dol; int i; char* str; - unsigned char buffer[32]; + char buffer[32]; unsigned char mask; int done = 0; BOOL bAll;