dix: Fix logic for displaying deprecation warning only once.
As pointed out by Jamey Sharp (again), the logic is faulty: --warn is always going to be false. Replace it with warn-- accordingly, so that there's (at least, but also only) one warning showing up. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Cyril Brulebois <kibi@debian.org>
This commit is contained in:
parent
a937803c1f
commit
9f9c732311
|
@ -67,7 +67,7 @@ SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
static int warn = 1;
|
static int warn = 1;
|
||||||
dixLookupWindow(&pWin, id, client, access_mode);
|
dixLookupWindow(&pWin, id, client, access_mode);
|
||||||
if (warn > 0 && --warn)
|
if (warn > 0 && warn--)
|
||||||
ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
|
ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
|
||||||
"are deprecated. Please convert your driver/module "
|
"are deprecated. Please convert your driver/module "
|
||||||
"to use dixLookupWindow().\n");
|
"to use dixLookupWindow().\n");
|
||||||
|
@ -88,7 +88,7 @@ SecurityLookupDrawable(XID id, ClientPtr client, Mask access_mode)
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
static int warn = 1;
|
static int warn = 1;
|
||||||
dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
|
dixLookupDrawable(&pDraw, id, client, M_DRAWABLE, access_mode);
|
||||||
if (warn > 0 && --warn)
|
if (warn > 0 && warn--)
|
||||||
ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
|
ErrorF("Warning: LookupDrawable()/SecurityLookupDrawable() "
|
||||||
"are deprecated. Please convert your driver/module "
|
"are deprecated. Please convert your driver/module "
|
||||||
"to use dixLookupDrawable().\n");
|
"to use dixLookupDrawable().\n");
|
||||||
|
@ -109,7 +109,7 @@ LookupClient(XID id, ClientPtr client)
|
||||||
ClientPtr pClient;
|
ClientPtr pClient;
|
||||||
static int warn = 1;
|
static int warn = 1;
|
||||||
dixLookupClient(&pClient, id, client, DixUnknownAccess);
|
dixLookupClient(&pClient, id, client, DixUnknownAccess);
|
||||||
if (warn > 0 && --warn)
|
if (warn > 0 && warn--)
|
||||||
ErrorF("Warning: LookupClient() is deprecated. Please convert your "
|
ErrorF("Warning: LookupClient() is deprecated. Please convert your "
|
||||||
"driver/module to use dixLookupClient().\n");
|
"driver/module to use dixLookupClient().\n");
|
||||||
return pClient;
|
return pClient;
|
||||||
|
@ -123,7 +123,7 @@ SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype,
|
||||||
pointer retval;
|
pointer retval;
|
||||||
static int warn = 1;
|
static int warn = 1;
|
||||||
dixLookupResourceByType(&retval, id, rtype, client, access_mode);
|
dixLookupResourceByType(&retval, id, rtype, client, access_mode);
|
||||||
if (warn > 0 && --warn)
|
if (warn > 0 && warn--)
|
||||||
ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
|
ErrorF("Warning: LookupIDByType()/SecurityLookupIDByType() "
|
||||||
"are deprecated. Please convert your driver/module "
|
"are deprecated. Please convert your driver/module "
|
||||||
"to use dixLookupResourceByType().\n");
|
"to use dixLookupResourceByType().\n");
|
||||||
|
@ -137,7 +137,7 @@ SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes,
|
||||||
pointer retval;
|
pointer retval;
|
||||||
static int warn = 1;
|
static int warn = 1;
|
||||||
dixLookupResourceByClass(&retval, id, classes, client, access_mode);
|
dixLookupResourceByClass(&retval, id, classes, client, access_mode);
|
||||||
if (warn > 0 && --warn)
|
if (warn > 0 && warn--)
|
||||||
ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
|
ErrorF("Warning: LookupIDByClass()/SecurityLookupIDByClass() "
|
||||||
"are deprecated. Please convert your driver/module "
|
"are deprecated. Please convert your driver/module "
|
||||||
"to use dixLookupResourceByClass().\n");
|
"to use dixLookupResourceByClass().\n");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user