Author: cwittich
Date: Sun Jan 21 20:23:23 2007
New Revision: 25558
URL:
http://svn.reactos.org/svn/reactos?rev=25558&view=rev
Log:
fix some warnings (gcc 4.2) thanks to w3seek
Modified:
trunk/reactos/base/shell/explorer/explorer.cpp
trunk/reactos/base/shell/explorer/services/shellservices.h
trunk/reactos/base/shell/explorer/services/startup.c
trunk/reactos/dll/cpl/sysdm/virtmem.c
trunk/reactos/dll/win32/opengl32/opengl32.h
trunk/reactos/dll/win32/version/info.c
trunk/reactos/subsystems/win32/win32k/include/object.h
Modified: trunk/reactos/base/shell/explorer/explorer.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
==============================================================================
--- trunk/reactos/base/shell/explorer/explorer.cpp (original)
+++ trunk/reactos/base/shell/explorer/explorer.cpp Sun Jan 21 20:23:23 2007
@@ -1186,7 +1186,7 @@
/**TODO launching autostart programs can be moved into a background thread. */
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);
}
Modified: trunk/reactos/base/shell/explorer/services/shellservices.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/servic…
==============================================================================
--- trunk/reactos/base/shell/explorer/services/shellservices.h (original)
+++ trunk/reactos/base/shell/explorer/services/shellservices.h Sun Jan 21 20:23:23 2007
@@ -27,7 +27,7 @@
// 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, ...)
struct SSOThread : public Thread
Modified: trunk/reactos/base/shell/explorer/services/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/servic…
==============================================================================
--- trunk/reactos/base/shell/explorer/services/startup.c (original)
+++ trunk/reactos/base/shell/explorer/services/startup.c Sun Jan 21 20:23:23 2007
@@ -416,7 +416,7 @@
SETUP = {FALSE, FALSE, FALSE, TRUE, TRUE, TRUE};
#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? */
/* First, set the current directory to SystemRoot */
Modified: trunk/reactos/dll/cpl/sysdm/virtmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/virtmem.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/virtmem.c (original)
+++ trunk/reactos/dll/cpl/sysdm/virtmem.c Sun Jan 21 20:23:23 2007
@@ -152,7 +152,7 @@
NULL,
0))
{
- if (szVolume != _T('\0'))
+ if (szVolume[0] != _T('\0'))
{
TCHAR szVol[MAX_PATH + 2];
Modified: trunk/reactos/dll/win32/opengl32/opengl32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl3…
==============================================================================
--- trunk/reactos/dll/win32/opengl32/opengl32.h (original)
+++ trunk/reactos/dll/win32/opengl32/opengl32.h Sun Jan 21 20:23:23 2007
@@ -115,7 +115,7 @@
typedef void GLvoid;
/* Called by the driver to set the dispatch table */
-typedef DWORD APIENTRY (*SetContextCallBack)( const ICDTable * );
+typedef DWORD WINAPI (*SetContextCallBack)( const ICDTable * );
/* OpenGL ICD data */
typedef struct tagGLDRIVERDATA
@@ -129,23 +129,23 @@
DWORD driver_version; /*!< DriverVersion value from registry */
DWORD flags; /*!< Flags value from registry */
- BOOL APIENTRY (*DrvCopyContext)( HGLRC, HGLRC, UINT );
- HGLRC APIENTRY (*DrvCreateContext)( HDC );
- HGLRC APIENTRY (*DrvCreateLayerContext)( HDC, int );
- BOOL APIENTRY (*DrvDeleteContext)( HGLRC );
- BOOL APIENTRY (*DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR
);
- int APIENTRY (*DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT
LPPIXELFORMATDESCRIPTOR );
- int APIENTRY (*DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
- PROC APIENTRY (*DrvGetProcAddress)( LPCSTR lpProcName );
- void APIENTRY (*DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */
- BOOL APIENTRY (*DrvRealizeLayerPalette)( HDC, int, BOOL );
- PICDTable APIENTRY (*DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback
);
- int APIENTRY (*DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF *
);
- BOOL APIENTRY (*DrvSetPixelFormat)( IN HDC, IN int ); /*, IN CONST
PIXELFORMATDESCRIPTOR * );*/
- BOOL APIENTRY (*DrvShareLists)( HGLRC, HGLRC );
- BOOL APIENTRY (*DrvSwapBuffers)( HDC );
- BOOL APIENTRY (*DrvSwapLayerBuffers)( HDC, UINT );
- BOOL APIENTRY (*DrvValidateVersion)( DWORD );
+ BOOL WINAPI (*DrvCopyContext)( HGLRC, HGLRC, UINT );
+ HGLRC WINAPI (*DrvCreateContext)( HDC );
+ HGLRC WINAPI (*DrvCreateLayerContext)( HDC, int );
+ BOOL WINAPI (*DrvDeleteContext)( HGLRC );
+ BOOL WINAPI (*DrvDescribeLayerPlane)( HDC, int, int, UINT, LPLAYERPLANEDESCRIPTOR
);
+ int WINAPI (*DrvDescribePixelFormat)( IN HDC, IN int, IN UINT, OUT
LPPIXELFORMATDESCRIPTOR );
+ int WINAPI (*DrvGetLayerPaletteEntries)( HDC, int, int, int, COLORREF * );
+ PROC WINAPI (*DrvGetProcAddress)( LPCSTR lpProcName );
+ void WINAPI (*DrvReleaseContext)( HGLRC hglrc ); /* maybe returns BOOL? */
+ BOOL WINAPI (*DrvRealizeLayerPalette)( HDC, int, BOOL );
+ PICDTable WINAPI (*DrvSetContext)( HDC hdc, HGLRC hglrc, SetContextCallBack callback );
+ int WINAPI (*DrvSetLayerPaletteEntries)( HDC, int, int, int, CONST COLORREF * );
+ BOOL WINAPI (*DrvSetPixelFormat)( IN HDC, IN int ); /*, IN CONST
PIXELFORMATDESCRIPTOR * );*/
+ BOOL WINAPI (*DrvShareLists)( HGLRC, HGLRC );
+ BOOL WINAPI (*DrvSwapBuffers)( HDC );
+ BOOL WINAPI (*DrvSwapLayerBuffers)( HDC, UINT );
+ BOOL WINAPI (*DrvValidateVersion)( DWORD );
struct tagGLDRIVERDATA *next; /* next ICD -- linked list */
} GLDRIVERDATA;
Modified: trunk/reactos/dll/win32/version/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/info.c?r…
==============================================================================
--- trunk/reactos/dll/win32/version/info.c (original)
+++ trunk/reactos/dll/win32/version/info.c Sun Jan 21 20:23:23 2007
@@ -259,7 +259,7 @@
}
hRsrc = FindResourceW(hModule,
MAKEINTRESOURCEW(VS_VERSION_INFO),
- MAKEINTRESOURCEW(VS_FILE_INFO));
+ (LPCWSTR) VS_FILE_INFO);
if(!hRsrc)
{
WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_w(filename));
Modified: trunk/reactos/subsystems/win32/win32k/include/object.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/object.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/object.h Sun Jan 21 20:23:23 2007
@@ -73,56 +73,62 @@
#include <malloc.h>
-#define ASSERT_LAST_REF(_obj_) \
-{ \
- PW32THREAD t; \
- PSINGLE_LIST_ENTRY e; \
- PUSER_REFERENCE_ENTRY ref; \
- \
- ASSERT(_obj_); \
- t = PsGetCurrentThreadWin32Thread(); \
- ASSERT(t); \
- e = t->ReferencesList.Next; \
- ASSERT(e); \
- ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \
- ASSERT(ref); \
- \
- ASSERT(_obj_ == ref->obj); \
- \
+#define USER_ASSERT(exp,file,line) \
+ if (!(exp)) {RtlAssert(#exp,(PVOID)file,line,"");}
+
+static __inline VOID
+UserAssertLastRef(PVOID obj, const char *file, int line)
+{
+ PW32THREAD W32Thread;
+ PSINGLE_LIST_ENTRY ReferenceEntry;
+ PUSER_REFERENCE_ENTRY UserReferenceEntry;
+
+ USER_ASSERT(obj != NULL, file, line);
+ W32Thread = PsGetCurrentThreadWin32Thread();
+ USER_ASSERT(W32Thread != NULL, file, line);
+ ReferenceEntry = W32Thread->ReferencesList.Next;
+ 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_) \
-{ \
- PW32THREAD t; \
- \
- ASSERT(_obj_); \
- t = PsGetCurrentThreadWin32Thread(); \
- ASSERT(t); \
- ASSERT(_ref_); \
- (_ref_)->obj = _obj_; \
- ObmReferenceObject(_obj_); \
- \
- PushEntryList(&t->ReferencesList, &(_ref_)->Entry); \
- \
+#define ASSERT_LAST_REF(_obj_) UserAssertLastRef(_obj,__FILE__,__LINE__)
+
+#undef USER_ASSERT
+
+VOID FASTCALL ObmReferenceObject(PVOID obj);
+BOOL FASTCALL ObmDereferenceObject2(PVOID obj);
+
+static __inline VOID
+UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
+{
+ PW32THREAD W32Thread;
+
+ 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_) \
-{ \
- PW32THREAD t; \
- PSINGLE_LIST_ENTRY e; \
- PUSER_REFERENCE_ENTRY ref; \
- \
- ASSERT(_obj_); \
- t = PsGetCurrentThreadWin32Thread(); \
- ASSERT(t); \
- e = PopEntryList(&t->ReferencesList); \
- ASSERT(e); \
- ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \
- ASSERT(ref); \
- \
- ASSERT(_obj_ == ref->obj); \
- ObmDereferenceObject(_obj_); \
- \
+ ASSERT(obj != NULL);
+ W32Thread = PsGetCurrentThreadWin32Thread();
+ ASSERT(W32Thread != NULL);
+ ReferenceEntry = PopEntryList(&W32Thread->ReferencesList);
+ ASSERT(ReferenceEntry != NULL);
+ UserReferenceEntry = CONTAINING_RECORD(ReferenceEntry, USER_REFERENCE_ENTRY, Entry);
+ ASSERT(UserReferenceEntry != NULL);
+
+ ASSERT(obj == UserReferenceEntry->obj);
+ ObmDereferenceObject2(obj);
}
HANDLE FASTCALL ObmObjectToHandle(PVOID obj);