analysis: None used in pointer context
While this is totally fine (None is 0L and, in the pointer context, will be converted in the right internal NULL representation, which could be a value with some bits to 1), I believe it's clearer to use NULL instead of None when we talk about pointers.
This commit is contained in:
parent
52a78a7220
commit
ec59af290c
@ -159,7 +159,7 @@ clutter_backend_glx_dispose (GObject *gobject)
|
|||||||
{
|
{
|
||||||
glXMakeContextCurrent (backend_x11->xdpy, None, None, NULL);
|
glXMakeContextCurrent (backend_x11->xdpy, None, None, NULL);
|
||||||
glXDestroyContext (backend_x11->xdpy, backend_glx->gl_context);
|
glXDestroyContext (backend_x11->xdpy, backend_glx->gl_context);
|
||||||
backend_glx->gl_context = None;
|
backend_glx->gl_context = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backend_glx->dummy_glxwin)
|
if (backend_glx->dummy_glxwin)
|
||||||
@ -222,7 +222,7 @@ clutter_backend_glx_get_features (ClutterBackend *backend)
|
|||||||
flags |= CLUTTER_FEATURE_STAGE_MULTIPLE;
|
flags |= CLUTTER_FEATURE_STAGE_MULTIPLE;
|
||||||
|
|
||||||
/* this will make sure that the GL context exists */
|
/* this will make sure that the GL context exists */
|
||||||
g_assert (backend_glx->gl_context != None);
|
g_assert (backend_glx->gl_context != NULL);
|
||||||
g_assert (glXGetCurrentDrawable () != None);
|
g_assert (glXGetCurrentDrawable () != None);
|
||||||
|
|
||||||
CLUTTER_NOTE (BACKEND,
|
CLUTTER_NOTE (BACKEND,
|
||||||
@ -394,7 +394,7 @@ _clutter_backend_glx_get_fbconfig (ClutterBackendGLX *backend_glx,
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
if (backend_x11->xdpy == None || backend_x11->xscreen == None)
|
if (backend_x11->xdpy == NULL || backend_x11->xscreen == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* If we don't already have a cached config then try to get one */
|
/* If we don't already have a cached config then try to get one */
|
||||||
@ -420,7 +420,7 @@ _clutter_backend_glx_get_fbconfig (ClutterBackendGLX *backend_glx,
|
|||||||
|
|
||||||
vinfo = glXGetVisualFromFBConfig (backend_x11->xdpy,
|
vinfo = glXGetVisualFromFBConfig (backend_x11->xdpy,
|
||||||
configs[i]);
|
configs[i]);
|
||||||
if (vinfo == None)
|
if (vinfo == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (vinfo->depth == 32 &&
|
if (vinfo->depth == 32 &&
|
||||||
@ -492,7 +492,7 @@ clutter_backend_glx_create_context (ClutterBackend *backend,
|
|||||||
int minor;
|
int minor;
|
||||||
GLXDrawable dummy_drawable;
|
GLXDrawable dummy_drawable;
|
||||||
|
|
||||||
if (backend_glx->gl_context != None)
|
if (backend_glx->gl_context != NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
xdisplay = clutter_x11_get_default_display ();
|
xdisplay = clutter_x11_get_default_display ();
|
||||||
@ -513,7 +513,7 @@ clutter_backend_glx_create_context (ClutterBackend *backend,
|
|||||||
GLX_RGBA_TYPE,
|
GLX_RGBA_TYPE,
|
||||||
NULL,
|
NULL,
|
||||||
True);
|
True);
|
||||||
if (backend_glx->gl_context == None)
|
if (backend_glx->gl_context == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, CLUTTER_INIT_ERROR,
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
||||||
CLUTTER_INIT_ERROR_BACKEND,
|
CLUTTER_INIT_ERROR_BACKEND,
|
||||||
@ -540,7 +540,7 @@ clutter_backend_glx_create_context (ClutterBackend *backend,
|
|||||||
* now this is the best solution available.
|
* now this is the best solution available.
|
||||||
*/
|
*/
|
||||||
xvisinfo = glXGetVisualFromFBConfig (xdisplay, config);
|
xvisinfo = glXGetVisualFromFBConfig (xdisplay, config);
|
||||||
if (xvisinfo == None)
|
if (xvisinfo == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, CLUTTER_INIT_ERROR,
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
||||||
CLUTTER_INIT_ERROR_BACKEND,
|
CLUTTER_INIT_ERROR_BACKEND,
|
||||||
@ -649,7 +649,7 @@ clutter_backend_glx_ensure_context (ClutterBackend *backend,
|
|||||||
(unsigned int) drawable);
|
(unsigned int) drawable);
|
||||||
|
|
||||||
/* no GL context to set */
|
/* no GL context to set */
|
||||||
if (backend_glx->gl_context == None)
|
if (backend_glx->gl_context == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
clutter_x11_trap_x_errors ();
|
clutter_x11_trap_x_errors ();
|
||||||
|
@ -142,7 +142,7 @@ clutter_backend_x11_post_parse (ClutterBackend *backend,
|
|||||||
CLUTTER_NOTE (BACKEND, "XOpenDisplay on '%s'",
|
CLUTTER_NOTE (BACKEND, "XOpenDisplay on '%s'",
|
||||||
clutter_display_name);
|
clutter_display_name);
|
||||||
backend_x11->xdpy = XOpenDisplay (clutter_display_name);
|
backend_x11->xdpy = XOpenDisplay (clutter_display_name);
|
||||||
if (backend_x11->xdpy == None)
|
if (backend_x11->xdpy == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, CLUTTER_INIT_ERROR,
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
||||||
CLUTTER_INIT_ERROR_BACKEND,
|
CLUTTER_INIT_ERROR_BACKEND,
|
||||||
|
@ -105,7 +105,7 @@ create_pixmap (guint *width, guint *height, guint *depth)
|
|||||||
|
|
||||||
data = g_malloc (w * h * 4);
|
data = g_malloc (w * h * 4);
|
||||||
image = XCreateImage (dpy,
|
image = XCreateImage (dpy,
|
||||||
None,
|
NULL,
|
||||||
32,
|
32,
|
||||||
ZPixmap,
|
ZPixmap,
|
||||||
0,
|
0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user