hw/xwin: Tidy-up of winmsg.h

- winVMsg() has no uses, so remove
- winMsgVerb() has only one use, with default verbosity, so remove
- winMsg() is identical to LogMessage()
- Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
- Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon Turney 2014-01-03 13:21:40 +00:00
parent 519b98765f
commit d11fdff50c
3 changed files with 14 additions and 41 deletions

View File

@ -264,8 +264,9 @@ winConfigKeyboard(DeviceIntPtr pDevice)
break; break;
} }
g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1; g_winInfo.keyboard.rate = (kbd_speed > 0) ? kbd_speed : 1;
winMsgVerb(X_PROBED, 1, "Setting autorepeat to delay=%ld, rate=%ld\n", winMsg(X_PROBED, "Setting autorepeat to delay=%ld, rate=%ld\n",
g_winInfo.keyboard.delay, g_winInfo.keyboard.rate); g_winInfo.keyboard.delay, g_winInfo.keyboard.rate);
} }
} }

View File

@ -38,17 +38,7 @@
#endif #endif
#include <stdarg.h> #include <stdarg.h>
void #ifdef XWIN_XF86CONFIG
winVMsg(int, MessageType, int verb, const char *, va_list)
_X_ATTRIBUTE_PRINTF(4, 0);
void
winVMsg(int scrnIndex, MessageType type, int verb, const char *format,
va_list ap)
{
LogVMessageVerb(type, verb, format, ap);
}
void void
winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
{ {
@ -59,16 +49,6 @@ winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
va_end(ap); va_end(ap);
} }
void
winMsg(MessageType type, const char *format, ...)
{
va_list ap;
va_start(ap, format);
LogVMessageVerb(type, 1, format, ap);
va_end(ap);
}
void void
winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
...) ...)
@ -79,16 +59,7 @@ winDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
LogVMessageVerb(type, verb, format, ap); LogVMessageVerb(type, verb, format, ap);
va_end(ap); va_end(ap);
} }
#endif
void
winMsgVerb(MessageType type, int verb, const char *format, ...)
{
va_list ap;
va_start(ap, format);
LogVMessageVerb(type, verb, format, ap);
va_end(ap);
}
void void
winErrorFVerb(int verb, const char *format, ...) winErrorFVerb(int verb, const char *format, ...)

View File

@ -1,5 +1,3 @@
#ifndef __WIN_MSG_H__
#define __WIN_MSG_H__
/* /*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
* *
@ -30,12 +28,17 @@
* Authors: Alexander Gottwald * Authors: Alexander Gottwald
*/ */
#ifndef __WIN_MSG_H__
#define __WIN_MSG_H__
#include <X11/Xwindows.h> #include <X11/Xwindows.h>
#include <X11/Xfuncproto.h>
/* /*
* Function prototypes * Function prototypes
*/ */
#ifdef XWIN_XF86CONFIG
void void
winDrvMsgVerb(int scrnIndex, winDrvMsgVerb(int scrnIndex,
MessageType type, int verb, const char *format, ...) MessageType type, int verb, const char *format, ...)
@ -43,12 +46,10 @@ _X_ATTRIBUTE_PRINTF(4, 5);
void void
winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
_X_ATTRIBUTE_PRINTF(3, 4); _X_ATTRIBUTE_PRINTF(3, 4);
void #endif
winMsgVerb(MessageType type, int verb, const char *format, ...)
_X_ATTRIBUTE_PRINTF(3, 4); #define winMsg LogMessage
void
winMsg(MessageType type, const char *format, ...)
_X_ATTRIBUTE_PRINTF(2, 3);
void void
winDebug(const char *format, ...) winDebug(const char *format, ...)
_X_ATTRIBUTE_PRINTF(1, 2); _X_ATTRIBUTE_PRINTF(1, 2);