[PATCH xserver 1/3] glx: Remove True/False defines
Alex Deucher
alexdeucher at gmail.com
Wed Aug 16 18:57:01 UTC 2017
On Wed, Aug 16, 2017 at 2:49 PM, Adam Jackson <ajax at redhat.com> wrote:
> Those are xlib spellings, we say TRUE/FALSE pretty consistently
> elsewhere in the server.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> glx/createcontext.c | 16 ++++++++--------
> glx/glxdri2.c | 16 ++++++++--------
> glx/glxext.c | 16 ++++++++--------
> glx/glxserver.h | 7 -------
> glx/indirect_program.c | 4 ++--
> hw/xwin/glx/indirect.c | 2 +-
> 6 files changed, 27 insertions(+), 34 deletions(-)
>
> diff --git a/glx/createcontext.c b/glx/createcontext.c
> index 068b35fa7..1216f9412 100644
> --- a/glx/createcontext.c
> +++ b/glx/createcontext.c
> @@ -37,29 +37,29 @@ static Bool
> validate_GL_version(int major_version, int minor_version)
> {
> if (major_version <= 0 || minor_version < 0)
> - return False;
> + return FALSE;
>
> switch (major_version) {
> case 1:
> if (minor_version > 5)
> - return False;
> + return FALSE;
> break;
>
> case 2:
> if (minor_version > 1)
> - return False;
> + return FALSE;
> break;
>
> case 3:
> if (minor_version > 3)
> - return False;
> + return FALSE;
> break;
>
> default:
> break;
> }
>
> - return True;
> + return TRUE;
> }
>
> static Bool
> @@ -70,9 +70,9 @@ validate_render_type(uint32_t render_type)
> case GLX_COLOR_INDEX_TYPE:
> case GLX_RGBA_FLOAT_TYPE_ARB:
> case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT:
> - return True;
> + return TRUE;
> default:
> - return False;
> + return FALSE;
> }
> }
>
> @@ -316,7 +316,7 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
> ctx->config = config;
> ctx->id = req->context;
> ctx->share_id = req->shareList;
> - ctx->idExists = True;
> + ctx->idExists = TRUE;
> ctx->isDirect = req->isDirect;
> ctx->renderMode = GL_RENDER;
> ctx->resetNotificationStrategy = reset;
> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index 701944283..9961c1bfb 100644
> --- a/glx/glxdri2.c
> +++ b/glx/glxdri2.c
> @@ -344,11 +344,11 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
> unsigned i;
>
> if (num_attribs == 0)
> - return True;
> + return TRUE;
>
> if (attribs == NULL) {
> *error = BadImplementation;
> - return False;
> + return FALSE;
> }
>
> *major_ver = 1;
> @@ -381,13 +381,13 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
> break;
> default:
> *error = __glXError(GLXBadProfileARB);
> - return False;
> + return FALSE;
> }
> break;
> case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
> if (screen->dri2->base.version >= 4) {
> *error = BadValue;
> - return False;
> + return FALSE;
> }
>
> switch (attribs[i * 2 + 1]) {
> @@ -399,14 +399,14 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
> break;
> default:
> *error = BadValue;
> - return False;
> + return FALSE;
> }
> break;
> default:
> /* If an unknown attribute is received, fail.
> */
> *error = BadValue;
> - return False;
> + return FALSE;
> }
> }
>
> @@ -414,7 +414,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
> */
> if ((*flags & ~ALL_DRI_CTX_FLAGS) != 0) {
> *error = BadValue;
> - return False;
> + return FALSE;
> }
>
> /* If the core profile is requested for a GL version is less than 3.2,
> @@ -428,7 +428,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
> }
>
> *error = Success;
> - return True;
> + return TRUE;
> }
>
> static void
> diff --git a/glx/glxext.c b/glx/glxext.c
> index e88bbd107..9b4d81641 100644
> --- a/glx/glxext.c
> +++ b/glx/glxext.c
> @@ -97,7 +97,7 @@ ContextGone(__GLXcontext * cx, XID id)
> __glXFreeContext(cx);
> }
>
> - return True;
> + return TRUE;
> }
>
> static __GLXcontext *glxPendingDestroyContexts;
> @@ -146,7 +146,7 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
>
> glxPriv->destroy(glxPriv);
>
> - return True;
> + return TRUE;
> }
>
> Bool
> @@ -155,12 +155,12 @@ __glXAddContext(__GLXcontext * cx)
> /* Register this context as a resource.
> */
> if (!AddResource(cx->id, __glXContextRes, (void *)cx)) {
> - return False;
> + return FALSE;
> }
>
> cx->next = glxAllContexts;
> glxAllContexts = cx;
> - return True;
> + return TRUE;
> }
>
> static void
> @@ -321,11 +321,11 @@ checkScreenVisuals(void)
> for (j = 0; j < screen->numVisuals; j++) {
> if (screen->visuals[j].class == TrueColor ||
> screen->visuals[j].class == DirectColor)
> - return True;
> + return TRUE;
> }
> }
>
> - return False;
> + return FALSE;
> }
>
> static void
> @@ -355,7 +355,7 @@ GlxExtensionInit(void)
> ScreenPtr pScreen;
> int i;
> __GLXprovider *p, **stack;
> - Bool glx_provided = False;
> + Bool glx_provided = FALSE;
>
> if (serverGeneration == 1) {
> for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next)
> @@ -402,7 +402,7 @@ GlxExtensionInit(void)
> LogMessage(X_INFO,
> "GLX: no usable GL providers found for screen %d\n", i);
> else
> - glx_provided = True;
> + glx_provided = TRUE;
> }
>
> /* don't register extension if GL is not provided on any screen */
> diff --git a/glx/glxserver.h b/glx/glxserver.h
> index 732ed9d8e..547826bd9 100644
> --- a/glx/glxserver.h
> +++ b/glx/glxserver.h
> @@ -65,13 +65,6 @@ typedef struct __GLXcontext __GLXcontext;
> #include "glxdrawable.h"
> #include "glxcontext.h"
>
> -#ifndef True
> -#define True 1
> -#endif
> -#ifndef False
> -#define False 0
> -#endif
> -
> extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
> extern __GLXclientState *glxGetClient(ClientPtr pClient);
>
> diff --git a/glx/indirect_program.c b/glx/indirect_program.c
> index 69a050820..c7bfa03ca 100644
> --- a/glx/indirect_program.c
> +++ b/glx/indirect_program.c
> @@ -112,7 +112,7 @@ __glXDisp_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc)
> PFNGLGETPROGRAMSTRINGARBPROC get_program_string =
> __glGetProcAddress("glGetProgramStringARB");
>
> - return DoGetProgramString(cl, pc, get_program, get_program_string, False);
> + return DoGetProgramString(cl, pc, get_program, get_program_string, FALSE);
> }
>
> int
> @@ -123,5 +123,5 @@ __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc)
> PFNGLGETPROGRAMSTRINGARBPROC get_program_string =
> __glGetProcAddress("glGetProgramStringARB");
>
> - return DoGetProgramString(cl, pc, get_program, get_program_string, True);
> + return DoGetProgramString(cl, pc, get_program, get_program_string, TRUE);
> }
> diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
> index ad79d249d..d6640700e 100644
> --- a/hw/xwin/glx/indirect.c
> +++ b/hw/xwin/glx/indirect.c
> @@ -1403,7 +1403,7 @@ glxWinContextMakeCurrent(__GLXcontext * base)
> * feature so just error out if it can't work.
> */
> if (!scr->has_WGL_ARB_make_current_read)
> - return False;
> + return FALSE;
>
> /*
> If there is a separate read drawable, create a separate read DC, and
> --
> 2.13.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
More information about the xorg-devel
mailing list