From 54fa5eceae237598d6fb329ec7cbe1d3a85e7d39 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sat, 2 Feb 2019 11:38:45 +0000 Subject: egl: use coherent variable names `EGLDisplay` variables (the opaque Khronos type) have mostly been consistently called `dpy`, as this is the name used in the Khronos specs. However, `_EGLDisplay` variables (our internal struct) have been randomly called `dpy` when there was no local variable clash with `EGLDisplay`s, and `disp` otherwise. Let's be consistent and use `dpy` for the Khronos type, and `disp` for our struct. Signed-off-by: Eric Engestrom Acked-by: Emil Velikov Acked-by: Eric Anholt --- src/egl/main/egldisplay.c | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/egl/main/egldisplay.c') diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 387df6a66d0..b26a9575087 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -184,25 +184,25 @@ _eglGetNativePlatform(void *nativeDisplay) void _eglFiniDisplay(void) { - _EGLDisplay *dpyList, *dpy; + _EGLDisplay *dispList, *disp; /* atexit function is called with global mutex locked */ - dpyList = _eglGlobal.DisplayList; - while (dpyList) { + dispList = _eglGlobal.DisplayList; + while (dispList) { EGLint i; /* pop list head */ - dpy = dpyList; - dpyList = dpyList->Next; + disp = dispList; + dispList = dispList->Next; for (i = 0; i < _EGL_NUM_RESOURCES; i++) { - if (dpy->ResourceLists[i]) { - _eglLog(_EGL_DEBUG, "Display %p is destroyed with resources", dpy); + if (disp->ResourceLists[i]) { + _eglLog(_EGL_DEBUG, "Display %p is destroyed with resources", disp); break; } } - free(dpy); + free(disp); } _eglGlobal.DisplayList = NULL; } @@ -215,7 +215,7 @@ _eglFiniDisplay(void) _EGLDisplay * _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) { - _EGLDisplay *dpy; + _EGLDisplay *disp; if (plat == _EGL_INVALID_PLATFORM) return NULL; @@ -223,30 +223,30 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) mtx_lock(_eglGlobal.Mutex); /* search the display list first */ - dpy = _eglGlobal.DisplayList; - while (dpy) { - if (dpy->Platform == plat && dpy->PlatformDisplay == plat_dpy) + disp = _eglGlobal.DisplayList; + while (disp) { + if (disp->Platform == plat && disp->PlatformDisplay == plat_dpy) break; - dpy = dpy->Next; + disp = disp->Next; } /* create a new display */ - if (!dpy) { - dpy = calloc(1, sizeof(_EGLDisplay)); - if (dpy) { - mtx_init(&dpy->Mutex, mtx_plain); - dpy->Platform = plat; - dpy->PlatformDisplay = plat_dpy; + if (!disp) { + disp = calloc(1, sizeof(_EGLDisplay)); + if (disp) { + mtx_init(&disp->Mutex, mtx_plain); + disp->Platform = plat; + disp->PlatformDisplay = plat_dpy; /* add to the display list */ - dpy->Next = _eglGlobal.DisplayList; - _eglGlobal.DisplayList = dpy; + disp->Next = _eglGlobal.DisplayList; + _eglGlobal.DisplayList = disp; } } mtx_unlock(_eglGlobal.Mutex); - return dpy; + return disp; } @@ -341,16 +341,16 @@ _eglCheckDisplayHandle(EGLDisplay dpy) * own the resource. */ EGLBoolean -_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy) +_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *disp) { - _EGLResource *list = dpy->ResourceLists[type]; + _EGLResource *list = disp->ResourceLists[type]; if (!res) return EGL_FALSE; while (list) { if (res == (void *) list) { - assert(list->Display == dpy); + assert(list->Display == disp); break; } list = list->Next; @@ -368,10 +368,10 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy) * _eglInitContext or _eglInitSurface. */ void -_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *dpy) +_eglInitResource(_EGLResource *res, EGLint size, _EGLDisplay *disp) { memset(res, 0, size); - res->Display = dpy; + res->Display = disp; res->RefCount = 1; } -- cgit v1.2.3