mirror of
https://github.com/reactos/reactos.git
synced 2024-08-27 05:38:41 +00:00
fix some warnings (gcc 4.2) thanks to w3seek
svn path=/trunk/; revision=25558
This commit is contained in:
parent
28df784f1a
commit
29043050ac
|
@ -1186,7 +1186,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
|||
|
||||
/**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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -416,7 +416,7 @@ static const struct op_mask
|
|||
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 */
|
||||
|
|
|
@ -152,7 +152,7 @@ ParseMemSettings(PVIRTMEM pVirtMem)
|
|||
NULL,
|
||||
0))
|
||||
{
|
||||
if (szVolume != _T('\0'))
|
||||
if (szVolume[0] != _T('\0'))
|
||||
{
|
||||
TCHAR szVol[MAX_PATH + 2];
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ typedef double GLclampd;
|
|||
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 @@ typedef struct tagGLDRIVERDATA
|
|||
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;
|
||||
|
|
|
@ -259,7 +259,7 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP
|
|||
}
|
||||
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));
|
||||
|
|
|
@ -73,56 +73,62 @@ typedef struct _USER_REFERENCE_ENTRY
|
|||
|
||||
#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);
|
||||
|
|
Loading…
Reference in a new issue