Fix compiler errors. Patch by Herve Poussineau. Fixes bug 478

svn path=/trunk/; revision=13267
This commit is contained in:
Alex Ionescu 2005-01-25 05:11:17 +00:00
parent dcee180336
commit c0441b0e5f
20 changed files with 87 additions and 96 deletions

View file

@ -78,7 +78,7 @@ void stime_arg2 __P((char *, int, time_t *));
void stime_file __P((char *, time_t *));
void usage __P((void));
void
int
main(int argc, char *argv[])
{
struct stat sb;
@ -194,7 +194,7 @@ main(int argc, char *argv[])
if (rw(*argv, &sb, fflag))
rval = 1; DbgPrint("[%s]", "[23]");
}
exit(rval); DbgPrint("[%s]", "[23]");
return rval; DbgPrint("[%s]", "[23]");
}
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;

View file

@ -23,7 +23,7 @@ typedef double f8byte_t;
typedef long uid_t; // SunOS 5.5
#define __P(x) x
#define __STDC__ 1
//#define __STDC__ 1
/* utmp.h */
#define UT_LINESIZE 8

View file

@ -515,7 +515,7 @@ static void KeyTyped(DFWINDOW wnd, int c)
currchar = DfCurrChar;
}
/* ---- test typing at end of text ---- */
if (currchar == wnd->text+wnd->MaxTextLength) {
if (currchar == (char*)(wnd->text+wnd->MaxTextLength)) {
/* ---- typing at the end of maximum buffer ---- */
DfBeep();
return;
@ -571,14 +571,14 @@ static void KeyTyped(DFWINDOW wnd, int c)
/* ---------- test end of window --------- */
if (DfWndCol == DfClientWidth(wnd)-1) {
if (!DfIsMultiLine(wnd)) {
if (!(currchar == wnd->text+wnd->MaxTextLength-2))
if (!(currchar == (char*)(wnd->text+wnd->MaxTextLength-2)))
DfSendMessage(wnd, DFM_HORIZSCROLL, TRUE, 0);
}
else {
char *cp = currchar;
while (*cp != ' ' && cp != DfTextLine(wnd, wnd->CurrLine))
while (*cp != ' ' && cp != (char*)DfTextLine(wnd, wnd->CurrLine))
--cp;
if (cp == DfTextLine(wnd, wnd->CurrLine) ||
if (cp == (char*)DfTextLine(wnd, wnd->CurrLine) ||
!wnd->WordWrapMode)
DfSendMessage(wnd, DFM_HORIZSCROLL, TRUE, 0);
else {
@ -807,7 +807,7 @@ static void ParagraphCmd(DFWINDOW wnd)
if (*bel == '\n')
--bel;
/* --- change all newlines in block to spaces --- */
while (DfCurrChar < bel) {
while ((char*)DfCurrChar < bel) {
if (*DfCurrChar == '\n') {
*DfCurrChar = ' ';
wnd->CurrLine++;
@ -818,7 +818,7 @@ static void ParagraphCmd(DFWINDOW wnd)
}
/* ---- insert newlines at new margin boundaries ---- */
bb = bbl;
while (bbl < bel) {
while ((char*)bbl < (char*)bel) {
bbl++;
if ((int)(bbl - bb) == DfClientWidth(wnd)-1) {
while (*bbl != ' ' && bbl > bb)

View file

@ -42,7 +42,7 @@ SliderTextProc (DFWINDOW wnd,DFMESSAGE msg,DF_PARAM p1,DF_PARAM p2)
case DFM_PAINT:
Percent = (int)p2;
InsertPercent(DfGetText(wnd) ?
DfGetText(wnd) : SliderBoxDB.ctl[1].itext);
(char*)DfGetText(wnd) : SliderBoxDB.ctl[1].itext);
GenericProc(wnd, DFM_PAINT, 0, 0);
if (Percent >= 100)
DfSendMessage(DfGetParent(wnd),DFM_COMMAND,DF_ID_CANCEL,0);

View file

@ -57,7 +57,7 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( hInst, appname );
wc.hCursor = LoadCursor( NULL_HANDLE, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL_HANDLE, (LPCTSTR)IDI_APPLICATION );
wc.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = "MENU_WINEMINE";
wc.lpszClassName = appname;

View file

@ -377,7 +377,7 @@ static void do_chmod (mode_t sf)
static void apply_mask (mode_t sf)
{
char *fname;
mode_t sf_stat;
int sf_stat;
need_update = end_chmod = 1;
do_chmod (sf);
@ -387,7 +387,7 @@ static void apply_mask (mode_t sf)
if ((sf_stat = pc_stat_file (fname)) < 0)
break;
c_stat = sf_stat;
c_stat = (mode_t) sf_stat;
do_chmod (c_stat);
} while (cpanel->marked);
}
@ -397,7 +397,7 @@ void chmod_cmd (void)
char buffer [10];
char *fname;
int i;
mode_t sf_stat;
int sf_stat;
do { /* do while any files remaining */
init_chmod ();
@ -409,7 +409,7 @@ void chmod_cmd (void)
if ((sf_stat = pc_stat_file (fname)) < 0) /* get status of file */
break;
c_stat = sf_stat;
c_stat = (mode_t) sf_stat;
mode_change = 0; /* clear changes flag */
/* set check buttons */

View file

@ -629,7 +629,7 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
}
va_end (ap);
// Spawn process
pid = spawnvp(P_NOWAIT,command, args);// argv[1], (const char* const*)&argv[1]);
pid = spawnvp(P_NOWAIT,command, (const char* const*)args);// argv[1], (const char* const*)&argv[1]);
if(!pid)
exit (1);
// Duplicate copy of original stdin back into stdin

View file

@ -248,7 +248,7 @@ static void restore_screen (void)
void SLtt_write_string (char *str)
{
#ifdef WIN32
int bytes;
unsigned long bytes;
(void) WriteConsole(hStdout, str, strlen(str), &bytes, NULL);
#else
@ -1017,7 +1017,7 @@ static void write_attributes (unsigned short *src, int count)
register unsigned char *p = Line_Buffer;
register unsigned short pair;
#ifdef WIN32
register unsigned char * org_src = src;
register unsigned char * org_src = (unsigned char*)src;
COORD coord;
long bytes;
#endif
@ -1062,7 +1062,7 @@ static void write_attributes (unsigned short *src, int count)
/* write color attributes */
p = Line_Buffer;
n = count;
src = org_src; /* restart the src pointer */
src = (unsigned short*)org_src; /* restart the src pointer */
/* write into attributes only */
while (n-- > 0)
@ -1073,7 +1073,7 @@ static void write_attributes (unsigned short *src, int count)
*(p++) = 0; /* what's this for? */
}
WriteConsoleOutputAttribute(hStdout, Line_Buffer, count, coord, &bytes);
WriteConsoleOutputAttribute(hStdout, (WORD*)Line_Buffer, count, coord, &bytes);
# else /* __os2__ */
/* ScreenUpdateLine (void *virtual_screen_line, int row); */
p = Line_Buffer;

View file

@ -122,7 +122,7 @@ static
int do_reget;
/* rcsid [] = "$Id: file.c,v 1.2 2003/06/27 21:10:35 gvg Exp $" */
/* rcsid [] = "$Id$" */
int verbose = 1;
/* Recursive operation on subdirectories */
@ -211,7 +211,7 @@ static char *dest_mask = NULL;
/* To symlinks the difference between `follow Links' checked and not
checked is the stat call used (mc_stat resp. mc_lstat) */
int (*xstat)(char *, struct stat *) = mc_lstat;
int (*xstat)(const char *, struct stat *) = mc_lstat;
static int op_follow_links = 0;

View file

@ -248,7 +248,7 @@ void do_file_mark (WPanel *panel, int index, int val);
int file_compute_color (int attr, file_entry *fe);
int file_entry_color (file_entry *fe);
void do_file_mark_range (WPanel *panel, int r1, int r2);
int do_enter (WPanel *panel);
void do_enter (WPanel *panel);
/* NOTE: Have to be ifdefed for HAVE_X */
void x_panel_select_item (WPanel *panel, int index, int val);

View file

@ -59,7 +59,7 @@
#include "x.h"
/* "$Id: screen.c,v 1.1 2001/12/30 09:55:21 sedwards Exp $" */
/* "$Id$" */
#define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) )
/* If true, show the mini-info on the panel */
@ -2020,13 +2020,13 @@ start_search (WPanel *panel)
}
}
int
void
do_enter (WPanel *panel)
{
if (S_ISDIR (selection (panel)->buf.st_mode)
|| link_isdir (selection (panel))){
do_cd (selection (panel)->fname, cd_exact);
return 1;
return;
} else {
if (is_exe (selection (panel)->buf.st_mode) &&
if_link_is_exe (selection (panel))) {
@ -2053,15 +2053,9 @@ do_enter (WPanel *panel)
free (tmp2);
}
#endif /* USE_VFS */
return 1;
return;
} else {
char *p;
p = regex_command (selection (panel)->fname, "Open", NULL, 0);
if (p && (strcmp (p, "Success") == 0))
return 1;
else
return 0;
regex_command (selection (panel)->fname, "Open", NULL, 0);
}
}
}

View file

@ -1,4 +1,4 @@
/* $Id: niclist.c,v 1.3 2004/01/12 22:45:53 sedwards Exp $
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS packet driver interface list utility
@ -53,7 +53,7 @@ int main(int argc, char **argv)
HINSTANCE hPacket = LoadLibrary("PACKET.DLL");
if (hPacket) {
PacketGetAdapterNames = (BOOLEAN (*)(PTSTR, PULONG))GetProcAddress(hPacket, "PacketGetAdapterNames");
PacketGetVersion = (BOOLEAN (*)(PTSTR, PULONG))GetProcAddress(hPacket, "PacketGetVersion");
PacketGetVersion = (PCHAR (*)(VOID))GetProcAddress(hPacket, "PacketGetVersion");
} else {
printf("Could not load WinPCap driver! for more information goto:\n");
printf ("http://netgroup-serv.polito.it/winpcap\n");

View file

@ -1,6 +1,6 @@
//======================================================================
//
// $Id: format.c,v 1.3 2003/01/14 18:51:12 guido Exp $
// $Id$
//
// Formatx
//
@ -334,7 +334,7 @@ wmain( int argc, WCHAR *argv[] )
{
int badArg;
DWORD media;
DWORD media = 0;
DWORD driveType;
WCHAR fileSystem [1024];

View file

@ -40,7 +40,7 @@ ExecuteKill(char * lpPid)
DWORD dwProcessId;
dwProcessId = (DWORD) atol(lpPid);
fprintf( stderr, "Killing PID %d...\n",dwProcessId);
fprintf( stderr, "Killing PID %ld...\n",dwProcessId);
hProcess = OpenProcess(
PROCESS_TERMINATE,
FALSE,
@ -48,7 +48,7 @@ ExecuteKill(char * lpPid)
);
if (NULL == hProcess)
{
fprintf( stderr, "Could not open the process with PID = %d\n", dwProcessId);
fprintf( stderr, "Could not open the process with PID = %ld\n", dwProcessId);
return 0;
}
if (FALSE == TerminateProcess(
@ -56,7 +56,7 @@ ExecuteKill(char * lpPid)
0
)
) {
fprintf( stderr, "Could not terminate the process with PID = %d\n", dwProcessId);
fprintf( stderr, "Could not terminate the process with PID = %ld\n", dwProcessId);
return 0;
}
CloseHandle(hProcess);

View file

@ -1,4 +1,4 @@
// $Id: pedump.c,v 1.1 2001/01/13 18:19:23 ea Exp $
// $Id$
//
// This program was written by Sang Cho, assistant professor at
// the department of
@ -48,6 +48,7 @@
#include <string.h>
#include <setjmp.h>
#include <malloc.h>
#include <ctype.h>
#ifndef bcopy
#define bcopy(s,d,z) memcpy((d),(s),(z))
@ -1060,7 +1061,7 @@ GetActualAddress (
int nSections = NumOfSections (lpFile);
int i = 0;
if (dwRVA == NULL)
if (dwRVA == 0)
return NULL;
if (dwRVA & 0x80000000)
{
@ -1954,7 +1955,7 @@ TranslateFunctionName (
{
int i, j, n;
int i, /*j,*/ n;
char c, cc;
static char buff[512]; // result of translation
@ -2375,7 +2376,7 @@ GetExportFunctionNames (
char buff[256]; // enough for any string ??
char *psz; //===============================
char *psz = NULL; //===============================
DWORD *pdwAddress;
DWORD *pdw1;
@ -2737,8 +2738,8 @@ MenuScan (
int *len,
WORD ** pMenu)
{
int num = 0;
int ndetails;
//int num = 0;
//int ndetails;
WORD *pwd;
WORD flag, flag1;
WORD id, ispopup;
@ -2805,12 +2806,12 @@ MenuFill (
char **psz,
WORD ** pMenu)
{
int num = 0;
int ndetails;
char *ptr, *pTemp;
//int num = 0;
//int ndetails;
char *ptr/*, *pTemp*/;
WORD *pwd;
WORD flag, flag1;
WORD id, ispopup;
WORD id/*, ispopup*/;
ptr = *psz;
pwd = *pMenu;
@ -2927,19 +2928,20 @@ GetContentsOfMenu (
//PIMAGE_SECTION_HEADER psh = (PIMAGE_SECTION_HEADER)
//ImageDirectorySection (lpFile, IMAGE_DIRECTORY_ENTRY_RESOURCE);
PIMAGE_MENU_HEADER pMenuHeader;
PIMAGE_POPUP_MENU_ITEM pPopup;
PIMAGE_NORMAL_MENU_ITEM pNormal;
//PIMAGE_POPUP_MENU_ITEM pPopup;
WORD* pPopup;
//PIMAGE_NORMAL_MENU_ITEM pNormal;
char buff[32];
int nCnt = 0, i, j;
int num = 0;
int /*nCnt = 0,*/ i, j;
//int num = 0;
int size;
int sLength, nMenus;
WORD flag;
WORD *pwd;
DWORD prdeName;
//DWORD prdeName;
//DWORD dwBase; obsolete
char *pMem, *pTemp;
BOOL isStrange = FALSE;
char *pMem/*, *pTemp*/;
//BOOL isStrange = FALSE;
/* get root directory of resource tree */
@ -3020,7 +3022,7 @@ GetContentsOfMenu (
// normal case
else
{
pPopup = (PIMAGE_POPUP_MENU_ITEM)
pPopup = (WORD*)
((DWORD) pMenuHeader + sizeof (IMAGE_MENU_HEADER));
while (1)
{
@ -3063,7 +3065,7 @@ GetContentsOfMenu (
// normal case
else
{
pPopup = (PIMAGE_POPUP_MENU_ITEM)
pPopup = (WORD*)
((DWORD) pMenuHeader + sizeof (IMAGE_MENU_HEADER));
while (1)
{
@ -3127,7 +3129,7 @@ GetContentsOfMenu (
// normal case
else
{
pPopup = (PIMAGE_POPUP_MENU_ITEM)
pPopup = (WORD*)
((DWORD) pMenuHeader + sizeof (IMAGE_MENU_HEADER));
while (1)
{
@ -3174,7 +3176,7 @@ GetContentsOfMenu (
// normal case
else
{
pPopup = (PIMAGE_POPUP_MENU_ITEM)
pPopup = (WORD*)
((DWORD) pMenuHeader + sizeof (IMAGE_MENU_HEADER));
while (1)
{
@ -3200,10 +3202,10 @@ PrintStrangeMenu (
char **psz)
{
int i, j, k, l;
//int i, j, k, l;
int num;
WORD flag1, flag2;
char buff[128];
//WORD flag1, flag2;
//char buff[128];
char *ptr, *pmax;
//return dumpMenu (psz, size);
@ -3395,17 +3397,17 @@ GetContentsOfDialog (
PIMAGE_RESOURCE_DIR_STRING_U pDialogName;
PIMAGE_RESOURCE_DATA_ENTRY prData;
PIMAGE_DIALOG_HEADER pDialogHeader;
PIMAGE_CONTROL_DATA pControlData;
//PIMAGE_CONTROL_DATA pControlData;
char buff[32];
int nCnt = 0, i, j;
int num = 0;
int /*nCnt = 0,*/ i, j;
//int num = 0;
int size;
int sLength, nDialogs;
WORD flag;
//WORD flag;
WORD *pwd;
DWORD prdeName;
char *pMem, *pTemp;
BOOL isStrange = FALSE;
//DWORD prdeName;
char *pMem/*, *pTemp*/;
//BOOL isStrange = FALSE;
/* get root directory of resource tree */
@ -3580,7 +3582,7 @@ GetContentsOfDialog (
// October 14, 1997
//
/* print contents of dialog */
int WINAPI
void WINAPI
PrintNameOrOrdinal (
char **psz)
{
@ -3613,15 +3615,15 @@ PrintNameOrOrdinal (
// October 14, 1997
//
/* print contents of dialog */
int WINAPI
void WINAPI
PrintDialog (
char **psz)
{
int i, j, k, l, n, c;
int i/*, j, k, l, n, c*/;
int num, size;
DWORD flag;
WORD class;
char buff[32];
//char buff[32];
char *ptr, *pmax;
BOOL isStrange = FALSE;
@ -3924,9 +3926,9 @@ main (
PIMAGE_FILE_HEADER pfh;
PIMAGE_OPTIONAL_HEADER poh;
PIMAGE_SECTION_HEADER psh;
IMAGE_SECTION_HEADER idsh;
//IMAGE_SECTION_HEADER idsh;
IMAGE_SECTION_HEADER shdr[MAXSECTIONNUMBER];
PIMAGE_IMPORT_MODULE_DIRECTORY pid;
//PIMAGE_IMPORT_MODULE_DIRECTORY pid;
int nSections; // number of sections
@ -3945,10 +3947,10 @@ main (
int imageBase;
int entryPoint;
int i, j, k, n;
int mnsize;
int nCnt;
int nSize;
int i, j, /*k,*/ n;
//int mnsize;
//int nCnt;
//int nSize;
int fsize;
char *pnstr;
char *pst;

View file

@ -18,7 +18,7 @@ void help(void)
puts("Usage: cat [file]");
}
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
FILE *srcf;
char *keys[]={"--help","/help"};

View file

@ -1,4 +1,4 @@
/* $Id: tlist.c,v 1.6 2003/08/03 18:06:02 ea Exp $
/* $Id$
*
* ReactOS Project
* TList
@ -123,7 +123,7 @@ ProcessHasDescendants (
++ Count;
}
}
(PBYTE) pInfo += pInfo->NextEntryDelta;
pInfo = (PSYSTEM_PROCESSES)((PBYTE)pInfo + pInfo->NextEntryDelta);
} while (0 != pInfo->NextEntryDelta);
@ -201,7 +201,7 @@ PrintProcessAndDescendants (
}
}
}
(PBYTE) pInfo += pInfo->NextEntryDelta;
pInfo = (PSYSTEM_PROCESSES)((PBYTE)pInfo + pInfo->NextEntryDelta);
} while (0 != pInfo->NextEntryDelta);

View file

@ -1,4 +1,4 @@
/* $Id: win32err.c,v 1.1 1999/05/16 07:27:35 ea Exp $
/* $Id$
*
* win32err.c
*
@ -47,14 +47,14 @@ PrintWin32Error(
DWORD ErrorCode
)
{
LPVOID lpMsgBuf;
PVOID lpMsgBuf;
FormatMessageW(
(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM),
NULL,
ErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(PWCHAR) & lpMsgBuf,
(LPWSTR)& lpMsgBuf,
0,
NULL
);

View file

@ -320,7 +320,7 @@ void AddFileInfoValue(HWND hDlg, void* pVersionData, struct LANGANDCODEPAGE lpTr
wsprintf(SubBlock, TEXT("\\StringFileInfo\\%04x%04x\\%s"),
lpTranslate.wLanguage, lpTranslate.wCodePage, info_str);
// Retrieve file description for language and code page "i".
if (VerQueryValue(pVersionData, SubBlock, &pVal, &nValLen)) {
if (VerQueryValue(pVersionData, SubBlock, (PVOID)&pVal, &nValLen)) {
ListBox_InsertItemData(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_TYPES), i, info_str);
// ListBox_InsertItemData(pane->hwnd, idx, entry);
SendMessage(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_VALUES), WM_SETTEXT, 0, (LPARAM)pVal);
@ -375,7 +375,7 @@ void CheckForFileInfo(HWND hDlg, TCHAR* strFilename)
UINT nValLen;
// LPTSTR SubBlock = _T("\\");
_tcscpy(SubBlock, TEXT("\\"));
if (VerQueryValue(pVersionData, SubBlock, &pVal, &nValLen)) {
if (VerQueryValue(pVersionData, SubBlock, (PVOID)&pVal, &nValLen)) {
if (nValLen == sizeof(VS_FIXEDFILEINFO)) {
ShowFixedFileInfo(hDlg, (VS_FIXEDFILEINFO*)pVal);
}

View file

@ -36,11 +36,6 @@ void UpdateStatus(HWND hWnd, Entry* pEntry);
BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv);
#ifndef _MSC_VER
#define NMTVDISPINFO TV_DISPINFO
#define NMTVDISPINFO TV_DISPINFO
#endif
void OnGetDispInfo(NMTVDISPINFO* ptvdi);