fix some warnings (gcc 4.2) thanks to w3seek

svn path=/trunk/; revision=25558
This commit is contained in:
Christoph von Wittich 2007-01-21 17:23:23 +00:00
parent 28df784f1a
commit 29043050ac
7 changed files with 75 additions and 69 deletions

View file

@ -1186,7 +1186,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
/**TODO launching autostart programs can be moved into a background thread. */ /**TODO launching autostart programs can be moved into a background thread. */
if (autostart) { if (autostart) {
char* argv[] = {"", "s"}; // call startup routine in SESSION_START mode const char* argv[] = {"", "s"}; // call startup routine in SESSION_START mode
startup(2, argv); startup(2, argv);
} }

View file

@ -27,7 +27,7 @@
// launch start programs // launch start programs
extern "C" int startup(int argc, char *argv[]); extern "C" int startup(int argc, const char *argv[]);
// load Shell Service Objects (volume control, printer/network icons, ...) // load Shell Service Objects (volume control, printer/network icons, ...)
struct SSOThread : public Thread struct SSOThread : public Thread

View file

@ -416,7 +416,7 @@ static const struct op_mask
SETUP = {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE}; SETUP = {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE};
#define DEFAULT SESSION_START #define DEFAULT SESSION_START
int startup(int argc, char *argv[]) int startup(int argc, const char *argv[])
{ {
struct op_mask ops; /* Which of the ops do we want to perform? */ struct op_mask ops; /* Which of the ops do we want to perform? */
/* First, set the current directory to SystemRoot */ /* First, set the current directory to SystemRoot */

View file

@ -152,7 +152,7 @@ ParseMemSettings(PVIRTMEM pVirtMem)
NULL, NULL,
0)) 0))
{ {
if (szVolume != _T('\0')) if (szVolume[0] != _T('\0'))
{ {
TCHAR szVol[MAX_PATH + 2]; TCHAR szVol[MAX_PATH + 2];

View file

@ -115,7 +115,7 @@ typedef double GLclampd;
typedef void GLvoid; typedef void GLvoid;
/* Called by the driver to set the dispatch table */ /* Called by the driver to set the dispatch table */
typedef DWORD APIENTRY (*SetContextCallBack)( const ICDTable * ); typedef DWORD WINAPI (*SetContextCallBack)( const ICDTable * );
/* OpenGL ICD data */ /* OpenGL ICD data */
typedef struct tagGLDRIVERDATA typedef struct tagGLDRIVERDATA
@ -129,23 +129,23 @@ typedef struct tagGLDRIVERDATA
DWORD driver_version; /*!< DriverVersion value from registry */ DWORD driver_version; /*!< DriverVersion value from registry */
DWORD flags; /*!< Flags value from registry */ DWORD flags; /*!< Flags value from registry */
BOOL APIENTRY (*DrvCopyContext)( HGLRC, HGLRC, UINT ); BOOL WINAPI (*DrvCopyContext)( HGLRC, HGLRC, UINT );
HGLRC APIENTRY (*DrvCreateContext)( HDC ); HGLRC WINAPI (*DrvCreateContext)( HDC );
HGLRC APIENTRY (*DrvCreateLayerContext)( HDC, int ); HGLRC WINAPI (*DrvCreateLayerContext)( HDC, int );
BOOL APIENTRY (*DrvDeleteContext)( HGLRC ); BOOL WINAPI (*DrvDeleteContext)( HGLRC );
BOOL APIENTRY (*DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR ); BOOL WINAPI (*DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR );
int APIENTRY (*DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT LPPIXELFORMATDESCRIPTOR ); int WINAPI (*DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT LPPIXELFORMATDESCRIPTOR );
int APIENTRY (*DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * ); int WINAPI (*DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
PROC APIENTRY (*DrvGetProcAddress)( LPCSTR lpProcName ); PROC WINAPI (*DrvGetProcAddress)( LPCSTR lpProcName );
void APIENTRY (*DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */ void WINAPI (*DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */
BOOL APIENTRY (*DrvRealizeLayerPalette)( HDC, int, BOOL ); BOOL WINAPI (*DrvRealizeLayerPalette)( HDC, int, BOOL );
PICDTable APIENTRY (*DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback ); PICDTable WINAPI (*DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback );
int APIENTRY (*DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * ); int WINAPI (*DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * );
BOOL APIENTRY (*DrvSetPixelFormat)( IN HDC, IN int ); /*, IN CONST PIXELFORMATDESCRIPTOR * );*/ BOOL WINAPI (*DrvSetPixelFormat)( IN HDC, IN int ); /*, IN CONST PIXELFORMATDESCRIPTOR * );*/
BOOL APIENTRY (*DrvShareLists)( HGLRC, HGLRC ); BOOL WINAPI (*DrvShareLists)( HGLRC, HGLRC );
BOOL APIENTRY (*DrvSwapBuffers)( HDC ); BOOL WINAPI (*DrvSwapBuffers)( HDC );
BOOL APIENTRY (*DrvSwapLayerBuffers)( HDC, UINT ); BOOL WINAPI (*DrvSwapLayerBuffers)( HDC, UINT );
BOOL APIENTRY (*DrvValidateVersion)( DWORD ); BOOL WINAPI (*DrvValidateVersion)( DWORD );
struct tagGLDRIVERDATA *next; /* next ICD -- linked list */ struct tagGLDRIVERDATA *next; /* next ICD -- linked list */
} GLDRIVERDATA; } GLDRIVERDATA;

View file

@ -259,7 +259,7 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP
} }
hRsrc = FindResourceW(hModule, hRsrc = FindResourceW(hModule,
MAKEINTRESOURCEW(VS_VERSION_INFO), MAKEINTRESOURCEW(VS_VERSION_INFO),
MAKEINTRESOURCEW(VS_FILE_INFO)); (LPCWSTR) VS_FILE_INFO);
if(!hRsrc) if(!hRsrc)
{ {
WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_w(filename)); WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_w(filename));

View file

@ -73,56 +73,62 @@ typedef struct _USER_REFERENCE_ENTRY
#include <malloc.h> #include <malloc.h>
#define ASSERT_LAST_REF(_obj_) \ #define USER_ASSERT(exp,file,line) \
{ \ if (!(exp)) {RtlAssert(#exp,(PVOID)file,line,"");}
PW32THREAD t; \
PSINGLE_LIST_ENTRY e; \ static __inline VOID
PUSER_REFERENCE_ENTRY ref; \ UserAssertLastRef(PVOID obj, const char *file, int line)
\ {
ASSERT(_obj_); \ PW32THREAD W32Thread;
t = PsGetCurrentThreadWin32Thread(); \ PSINGLE_LIST_ENTRY ReferenceEntry;
ASSERT(t); \ PUSER_REFERENCE_ENTRY UserReferenceEntry;
e = t->ReferencesList.Next; \
ASSERT(e); \ USER_ASSERT(obj != NULL, file, line);
ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \ W32Thread = PsGetCurrentThreadWin32Thread();
ASSERT(ref); \ USER_ASSERT(W32Thread != NULL, file, line);
\ ReferenceEntry = W32Thread->ReferencesList.Next;
ASSERT(_obj_ == ref->obj); \ USER_ASSERT(ReferenceEntry != NULL, file, line);
\ UserReferenceEntry = CONTAINING_RECORD(ReferenceEntry, USER_REFERENCE_ENTRY, Entry);
USER_ASSERT(UserReferenceEntry != NULL, file, line);
USER_ASSERT(obj == UserReferenceEntry->obj, file, line);
} }
#define UserRefObjectCo(_obj_, _ref_) \ #define ASSERT_LAST_REF(_obj_) UserAssertLastRef(_obj,__FILE__,__LINE__)
{ \
PW32THREAD t; \ #undef USER_ASSERT
\
ASSERT(_obj_); \ VOID FASTCALL ObmReferenceObject(PVOID obj);
t = PsGetCurrentThreadWin32Thread(); \ BOOL FASTCALL ObmDereferenceObject2(PVOID obj);
ASSERT(t); \
ASSERT(_ref_); \ static __inline VOID
(_ref_)->obj = _obj_; \ UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
ObmReferenceObject(_obj_); \ {
\ PW32THREAD W32Thread;
PushEntryList(&t->ReferencesList, &(_ref_)->Entry); \
\ W32Thread = PsGetCurrentThreadWin32Thread();
ASSERT(W32Thread != NULL);
ASSERT(UserReferenceEntry != NULL);
UserReferenceEntry->obj = obj;
ObmReferenceObject(obj);
PushEntryList(&W32Thread->ReferencesList, &UserReferenceEntry->Entry);
} }
static __inline VOID
UserDerefObjectCo(PVOID obj)
{
PW32THREAD W32Thread;
PSINGLE_LIST_ENTRY ReferenceEntry;
PUSER_REFERENCE_ENTRY UserReferenceEntry;
#define UserDerefObjectCo(_obj_) \ ASSERT(obj != NULL);
{ \ W32Thread = PsGetCurrentThreadWin32Thread();
PW32THREAD t; \ ASSERT(W32Thread != NULL);
PSINGLE_LIST_ENTRY e; \ ReferenceEntry = PopEntryList(&W32Thread->ReferencesList);
PUSER_REFERENCE_ENTRY ref; \ ASSERT(ReferenceEntry != NULL);
\ UserReferenceEntry = CONTAINING_RECORD(ReferenceEntry, USER_REFERENCE_ENTRY, Entry);
ASSERT(_obj_); \ ASSERT(UserReferenceEntry != NULL);
t = PsGetCurrentThreadWin32Thread(); \
ASSERT(t); \ ASSERT(obj == UserReferenceEntry->obj);
e = PopEntryList(&t->ReferencesList); \ ObmDereferenceObject2(obj);
ASSERT(e); \
ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \
ASSERT(ref); \
\
ASSERT(_obj_ == ref->obj); \
ObmDereferenceObject(_obj_); \
\
} }
HANDLE FASTCALL ObmObjectToHandle(PVOID obj); HANDLE FASTCALL ObmObjectToHandle(PVOID obj);