Fixed a lot of warnings.

svn path=/trunk/; revision=2009
This commit is contained in:
Eric Kohl 2001-06-25 14:22:45 +00:00
parent 6e9bf90969
commit d450a93214
15 changed files with 51 additions and 110 deletions

View file

@ -1,4 +1,4 @@
/* $Id: scm.c,v 1.6 2001/06/17 20:36:35 ea Exp $ /* $Id: scm.c,v 1.7 2001/06/25 14:19:56 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -379,11 +379,11 @@ SC_HANDLE STDCALL OpenSCManagerA(LPCSTR lpMachineName,
ANSI_STRING MachineNameA; ANSI_STRING MachineNameA;
ANSI_STRING DatabaseNameA; ANSI_STRING DatabaseNameA;
RtlInitAnsiString(&MachineNameA, lpMachineName); RtlInitAnsiString(&MachineNameA, (LPSTR)lpMachineName);
RtlAnsiStringToUnicodeString(&MachineNameW, RtlAnsiStringToUnicodeString(&MachineNameW,
&MachineNameA, &MachineNameA,
TRUE); TRUE);
RtlInitAnsiString(&DatabaseNameA, lpDatabaseName); RtlInitAnsiString(&DatabaseNameA, (LPSTR)lpDatabaseName);
RtlAnsiStringToUnicodeString(&DatabaseNameW, RtlAnsiStringToUnicodeString(&DatabaseNameW,
&DatabaseNameA, &DatabaseNameA,
TRUE); TRUE);
@ -410,7 +410,7 @@ SC_HANDLE STDCALL OpenSCManagerW(LPCWSTR lpMachineName,
LPCWSTR lpDatabaseName, LPCWSTR lpDatabaseName,
DWORD dwDesiredAccess) DWORD dwDesiredAccess)
{ {
HANDLE h; HANDLE h;
if (lpMachineName == NULL || if (lpMachineName == NULL ||
wcslen(lpMachineName) == 0) wcslen(lpMachineName) == 0)
@ -421,7 +421,7 @@ SC_HANDLE STDCALL OpenSCManagerW(LPCWSTR lpMachineName,
return(NULL); return(NULL);
} }
h = CreateFile(L"\\\\.\\pipe\\ntsrvctrl", h = CreateFileW(L"\\\\.\\pipe\\ntsrvctrl",
dwDesiredAccess, dwDesiredAccess,
0, 0,
NULL, NULL,

View file

@ -1,4 +1,4 @@
/* $Id: sctrl.c,v 1.1 2000/03/26 22:00:07 dwelch Exp $ /* $Id: sctrl.c,v 1.2 2001/06/25 14:19:56 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -191,7 +191,7 @@ BOOL STDCALL StartServiceCtrlDispatcherW(
{ {
h = CreateThread(NULL, h = CreateThread(NULL,
0, 0,
lpServiceStartTable[i].lpServiceProc, (LPTHREAD_START_ROUTINE)lpServiceStartTable[i].lpServiceProc,
NULL, NULL,
0, 0,
&Tid); &Tid);

View file

@ -5,5 +5,5 @@
#undef _fmode #undef _fmode
unsigned int _fmode = O_TEXT; unsigned int _fmode = O_TEXT;
unsigned int *_fmode_dll = &_fmode; unsigned int *_fmode_dll = &_fmode;

View file

@ -12,11 +12,11 @@
size_t _read(int _fd, void *_buf, size_t _nbyte) size_t _read(int _fd, void *_buf, size_t _nbyte)
{ {
size_t _rbyte; DWORD _rbyte;
if (!ReadFile(_get_osfhandle(_fd),_buf,_nbyte,&_rbyte,NULL)) if (!ReadFile(_get_osfhandle(_fd),_buf,_nbyte,&_rbyte,NULL))
{ {
return -1; return -1;
} }
return _rbyte; return (size_t)_rbyte;
} }

View file

@ -14,10 +14,11 @@
size_t _write(int _fd, const void *_buf, size_t _nbyte) size_t _write(int _fd, const void *_buf, size_t _nbyte)
{ {
size_t _wbyte; DWORD _wbyte;
if ( !WriteFile(_get_osfhandle(_fd),_buf,_nbyte,&_wbyte,NULL) ) { if ( !WriteFile(_get_osfhandle(_fd),_buf,_nbyte,&_wbyte,NULL) )
{
return -1; return -1;
} }
return _wbyte; return (size_t)_wbyte;
} }

View file

@ -12,15 +12,19 @@
#include <crtdll/errno.h> #include <crtdll/errno.h>
#include <crtdll/internal/file.h> #include <crtdll/internal/file.h>
int _cwait (int* pnStatus, int hProc, int nAction) int _cwait (int* pnStatus, int hProc, int nAction)
{ {
DWORD ExitCode;
nAction = 0; nAction = 0;
if ( WaitForSingleObject((void *)hProc,INFINITE) != WAIT_OBJECT_0 ) { if ( WaitForSingleObject((void *)hProc,INFINITE) != WAIT_OBJECT_0 ) {
__set_errno(ECHILD); __set_errno(ECHILD);
return -1; return -1;
} }
if ( !GetExitCodeProcess((void *)hProc,pnStatus) ) if ( !GetExitCodeProcess((void *)hProc,&ExitCode) )
return -1; return -1;
if (pnStatus != NULL)
*pnStatus = (int)ExitCode;
return hProc; return hProc;
} }

View file

@ -10,7 +10,7 @@ int _spawnl(int nMode, const char* szPath, const char* szArgv0,...)
const char *a; const char *a;
int i = 1; int i = 1;
va_list l = 0; va_list l = 0;
szArg[0]=szArgv0; szArg[0]=(char*)szArgv0;
va_start(l,szArgv0); va_start(l,szArgv0);
do { do {
a = va_arg(l,const char *); a = va_arg(l,const char *);

View file

@ -10,7 +10,7 @@ int _spawnle(int mode, const char *path, const char *szArgv0, ... /*, const char
char *ptr; char *ptr;
int i = 1; int i = 1;
va_list l = 0; va_list l = 0;
szArg[0]=szArgv0; szArg[0]=(char*)szArgv0;
va_start(l,szArgv0); va_start(l,szArgv0);
do { do {
a = (char *)va_arg(l,const char *); a = (char *)va_arg(l,const char *);

View file

@ -181,6 +181,7 @@ int _spawnve(int mode, const char *path, char *const argv[], char *const envp[])
int e = errno; int e = errno;
int is_dir = 0; int is_dir = 0;
int found = 0; int found = 0;
DWORD ExitCode;
if (path == 0 || argv[0] == 0) if (path == 0 || argv[0] == 0)
{ {
@ -257,7 +258,8 @@ int _spawnve(int mode, const char *path, char *const argv[], char *const envp[])
if (mode == P_WAIT) if (mode == P_WAIT)
{ {
WaitForSingleObject(ProcessInformation.hProcess,INFINITE); WaitForSingleObject(ProcessInformation.hProcess,INFINITE);
GetExitCodeProcess(ProcessInformation.hProcess,&i); GetExitCodeProcess(ProcessInformation.hProcess,&ExitCode);
i = (int)ExitCode;
} }
return i; return i;
} }
@ -331,6 +333,6 @@ int _spawnvpe(int nMode, const char* szPath, char* const* szaArgv, char* const*
{ {
char rpath[FILENAME_MAX]; char rpath[FILENAME_MAX];
return _spawnve(nMode, find_exec(szPath,rpath), szaArgv, szaEnv); return _spawnve(nMode, find_exec((char*)szPath,rpath), szaArgv, szaEnv);
} }

View file

@ -1,4 +1,5 @@
#include <windows.h>
#include <crtdll/io.h> #include <crtdll/io.h>
#include <crtdll/errno.h> #include <crtdll/errno.h>
#include <crtdll/stdio.h> #include <crtdll/stdio.h>
@ -11,7 +12,6 @@ _popen (const char *cm, const char *md) /* program name, pipe mode */
{ {
FILE *pf; FILE *pf;
HANDLE hReadPipe, hWritePipe; HANDLE hReadPipe, hWritePipe;
HANDLE SpawnedProcess;
STARTUPINFO StartupInfo; STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation; PROCESS_INFORMATION ProcessInformation;
@ -28,7 +28,11 @@ _popen (const char *cm, const char *md) /* program name, pipe mode */
StartupInfo.hStdInput = hReadPipe; StartupInfo.hStdInput = hReadPipe;
} }
SpawnedProcess = CreateProcessA("cmd.exe",(char *)cm,NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&StartupInfo,&ProcessInformation ); if (CreateProcessA("cmd.exe",(char *)cm,NULL,NULL,TRUE,
CREATE_NEW_CONSOLE,NULL,NULL,
&StartupInfo,
&ProcessInformation) == FALSE)
return NULL;
if ( *md == 'r' ) { if ( *md == 'r' ) {
@ -38,7 +42,7 @@ _popen (const char *cm, const char *md) /* program name, pipe mode */
pf = _fdopen( __fileno_alloc(hWritePipe, _fmode) , "w" ); pf = _fdopen( __fileno_alloc(hWritePipe, _fmode) , "w" );
} }
pf->_name_to_remove = SpawnedProcess; pf->_name_to_remove = ProcessInformation.hProcess;
return pf; return pf;

View file

@ -1,6 +1,6 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <crtdll/stdio.h> #include <crtdll/stdio.h>
#include <stdarg.h> #include <crtdll/stdarg.h>
#include <crtdll/malloc.h> #include <crtdll/malloc.h>
#include <crtdll/internal/file.h> #include <crtdll/internal/file.h>

View file

@ -32,7 +32,7 @@ void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ex
else else
{ {
*ext = 0; *ext = 0;
tmp_ext = path+strlen(path); tmp_ext = (char*)path+strlen(path);
} }
if ( tmp_dir != NULL ) { if ( tmp_dir != NULL ) {
strncpy(fname,tmp_dir+1,tmp_ext - tmp_dir - 1); strncpy(fname,tmp_dir+1,tmp_ext - tmp_dir - 1);

View file

@ -11,7 +11,7 @@ int _stat( const char *path, struct stat *buffer )
WIN32_FIND_DATA wfd; WIN32_FIND_DATA wfd;
HANDLE fh; HANDLE fh;
fh = FindFirstFile (path,&wfd); fh = FindFirstFile (path,&wfd);
if ( fh == -1 ) if ( fh == INVALID_HANDLE_VALUE )
{ {
__set_errno(ENOFILE); __set_errno(ENOFILE);
return -1; return -1;

View file

@ -1,78 +0,0 @@
*asm:
*asm_final:
*cpp:
-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}
*cc1:
%(cc1_spec)
*cc1plus:
*endfile:
*link:
%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12}
*lib:
*libgcc:
-lgcc
*startfile:
*switches_need_spaces:
*signed_char:
%{funsigned-char:-D__CHAR_UNSIGNED__}
*predefines:
-Di386 -D_WIN32 -DWIN32 -D__WIN32__ -D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D_stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -Asystem(winnt) -Acpu(i386) -Amachine(i386)
*cross_compile:
1
*version:
egcs-2.91.57
*multilib:
. ;
*multilib_defaults:
*multilib_extra:
*multilib_matches:
*linker:
collect2
*cpp_486:
%{!ansi:-Di486} -D__i486 -D__i486__
*cpp_586:
%{!ansi:-Di586 -Dpentium} -D__i586 -D__i586__ -D__pentium -D__pentium__
*cpp_686:
%{!ansi:-Di686 -Dpentiumpro} -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__
*cpp_cpu_default:
%(cpp_586)
*cpp_cpu:
-Acpu(i386) -Amachine(i386) %{!ansi:-Di386} -D__i386 -D__i386__ %{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} %{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} %{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} %{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}
*cc1_cpu:
%{!mcpu*: %{m386:-mcpu=i386 -march=i386} %{mno-486:-mcpu=i386 -march=i386} %{m486:-mcpu=i486 -march=i486} %{mno-386:-mcpu=i486 -march=i486} %{mno-pentium:-mcpu=i486 -march=i486} %{mpentium:-mcpu=pentium} %{mno-pentiumpro:-mcpu=pentium} %{mpentiumpro:-mcpu=pentiumpro}}

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.11 2000/11/20 19:59:08 ekohl Exp $ # $Id: makefile,v 1.12 2001/06/25 14:20:44 ekohl Exp $
# #
# Makefile for fmifs.dll # Makefile for fmifs.dll
# #
@ -34,11 +34,15 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
--kill-at \ --kill-at \
--output-lib $(TARGET).a --output-lib $(TARGET).a
$(CC) \ $(CC) \
-specs=$(TARGET)_specs \ $(TARGET).o \
../ntdll/ntdll.a \
../kernel32/kernel32.a \
-nostartfiles \
-nostdlib \
-mdll \ -mdll \
-o junk.tmp \ -o junk.tmp \
-Wl,--base-file,base.tmp \ -Wl,--entry=_DllMain@12\
$(TARGET).o -Wl,--base-file,base.tmp
- $(RM) junk.tmp - $(RM) junk.tmp
$(DLLTOOL) \ $(DLLTOOL) \
--dllname $(TARGET).dll \ --dllname $(TARGET).dll \
@ -47,10 +51,14 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
--def $(TARGET).edf --def $(TARGET).edf
- $(RM) base.tmp - $(RM) base.tmp
$(CC) \ $(CC) \
-specs=$(TARGET)_specs \ $(TARGET).o \
../ntdll/ntdll.a \
../kernel32/kernel32.a \
-nostartfiles \
-nostdlib \
-mdll \ -mdll \
-o $(TARGET).dll \ -o $(TARGET).dll \
$(TARGET).o \ -Wl,--entry=_DllMain@12\
-Wl,--image-base,0x76df0000 \ -Wl,--image-base,0x76df0000 \
-Wl,--file-alignment,0x1000 \ -Wl,--file-alignment,0x1000 \
-Wl,--section-alignment,0x1000 \ -Wl,--section-alignment,0x1000 \