summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-09 22:23:31 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-09 22:23:31 -0800
commite13937ebf1da3c062c9d9731f2b49207d9e4ea2a (patch)
treeb260772f120b7edb6a35b02f052e3f83cf880ebe
parent723f4a1430dad0d495e3c83c7c95edb94e9f4304 (diff)
Tell the compiler it's unlikely we're talking to an XFree86 3.x server
Hint that the current (XFree86 4.0 & later) version of the protocol is most common today. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XF86VMode.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/XF86VMode.c b/src/XF86VMode.c
index d13da14..00eeb26 100644
--- a/src/XF86VMode.c
+++ b/src/XF86VMode.c
@@ -218,7 +218,7 @@ XF86VidModeGetModeLine(Display* dpy, int screen, int* dotclock,
req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
req->screen = screen;
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
xXF86OldVidModeGetModeLineReply oldrep;
if (!_XReply(dpy, (xReply *)&oldrep,
@@ -346,7 +346,7 @@ XF86VidModeGetAllModeLines(Display* dpy, int screen, int* modecount,
for (i = 0; i < rep.modecount; i++) {
modelines[i] = mdinfptr++;
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
_XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
modelines[i]->dotclock = oldxmdline.dotclock;
modelines[i]->hdisplay = oldxmdline.hdisplay;
@@ -441,7 +441,7 @@ XF86VidModeAddModeLine(Display *dpy, int screen,
XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
LockDisplay(dpy);
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
oldreq->reqType = info->codes->major_opcode;
oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
@@ -551,7 +551,7 @@ XF86VidModeDeleteModeLine(Display *dpy, int screen,
XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
LockDisplay(dpy);
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
oldreq->reqType = info->codes->major_opcode;
oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
@@ -612,7 +612,7 @@ XF86VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine* modeline)
XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
LockDisplay(dpy);
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
oldreq->reqType = info->codes->major_opcode;
oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
@@ -674,7 +674,7 @@ XF86VidModeValidateModeLine(Display *dpy, int screen,
LockDisplay(dpy);
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
oldreq->reqType = info->codes->major_opcode;
oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
@@ -766,7 +766,7 @@ XF86VidModeSwitchToMode(Display* dpy, int screen, XF86VidModeModeInfo* modeline)
*/
XF86VidModeQueryVersion(dpy, &majorVersion, &minorVersion);
- if (majorVersion == 0 && minorVersion < 8) {
+ if (_X_UNLIKELY(majorVersion == 0 && minorVersion < 8)) {
protocolBug = True;
#ifdef DEBUG
fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
@@ -776,7 +776,7 @@ XF86VidModeSwitchToMode(Display* dpy, int screen, XF86VidModeModeInfo* modeline)
}
LockDisplay(dpy);
- if (majorVersion < 2) {
+ if (_X_UNLIKELY(majorVersion < 2)) {
GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq);
oldreq->reqType = info->codes->major_opcode;
oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;