summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-04-29 20:13:31 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-04-29 20:13:31 +0000
commit8a073b2292bedcd480bc57bb566ac3acf52441e1 (patch)
tree418a39161e60f496a505f304149165dd8f5baacd
parent2fcb025e5e193abce7b7322e1568c4b15a013b46 (diff)
simplify use of winW32Error function
-rw-r--r--hw/xwin/wincursor.c6
-rw-r--r--hw/xwin/winmsg.c10
-rw-r--r--hw/xwin/winmsg.h3
3 files changed, 13 insertions, 6 deletions
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 3c16bd14f..40ffe7364 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -369,7 +369,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
hCursor = (HCURSOR) CreateIconIndirect( &ii );
if (hCursor == NULL)
- winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
+ winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
else
{
if (GetIconInfo(hCursor, &ii))
@@ -386,7 +386,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
hCursor = (HCURSOR) CreateIconIndirect( &ii );
if (hCursor == NULL)
- winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
+ winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
}
/* GetIconInfo creates new bitmaps. Destroy them again */
if (ii.hbmMask)
@@ -412,7 +412,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
pAnd, pXor);
if (hCursor == NULL)
- winW32Error(2, GetLastError(), "winLoadCursor - CreateCursor failed: %s\n");
+ winW32Error(2, "winLoadCursor - CreateCursor failed:");
}
free (pAnd);
free (pXor);
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 23252612c..49ecd09f9 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -103,7 +103,13 @@ winDebug (const char *format, ...)
}
void
-winW32Error(int verb, DWORD errorcode, const char *format)
+winW32Error(int verb, const char *msg)
+{
+ winW32ErrorEx(verb, msg, GetLastError());
+}
+
+void
+winW32ErrorEx(int verb, const char *msg, DWORD errorcode)
{
LPVOID buffer;
if (!FormatMessage(
@@ -121,7 +127,7 @@ winW32Error(int verb, DWORD errorcode, const char *format)
}
else
{
- winErrorFVerb(verb, format, (char *)buffer);
+ winErrorFVerb(verb, "%s %s", msg, (char *)buffer);
LocalFree(buffer);
}
}
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
index a42d6467c..f29972004 100644
--- a/hw/xwin/winmsg.h
+++ b/hw/xwin/winmsg.h
@@ -44,6 +44,7 @@ void winMsg (MessageType type, const char *format, ...);
void winDebug (const char *format, ...);
void winErrorFVerb (int verb, const char *format, ...);
-void winW32Error(int verb, DWORD errorcode, const char *format);
+void winW32Error(int verb, const char *message);
+void winW32ErrorEx(int verb, const char *message, DWORD errorcode);
#endif