[Mesa-dev] [PATCH 2/4] egl: Fix type errors in _eglParseSyncAttribList64()

Eric Engestrom eric.engestrom at imgtec.com
Wed Jul 13 09:28:46 UTC 2016


On Fri, Jul 08, 2016 at 03:44:19PM -0700, Chad Versace wrote:
> - The list elements have type EGLAttrib, not EGLint.
> - The array index iterator should be size_t, not EGLint.
> ---
>  src/egl/main/eglsync.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c
> index 33625e9..48714d1 100644
> --- a/src/egl/main/eglsync.c
> +++ b/src/egl/main/eglsync.c
> @@ -26,6 +26,7 @@
>   **************************************************************************/
>  
>  
> +#include <inttypes.h>
>  #include <string.h>
>  
>  #include "eglsync.h"
> @@ -69,14 +70,14 @@ _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list)
>  static EGLint
>  _eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
>  {
> -   EGLint i, err = EGL_SUCCESS;
> +   EGLint err = EGL_SUCCESS;
>  
>     if (!attrib_list)
>        return EGL_SUCCESS;
>  
> -   for (i = 0; attrib_list[i] != EGL_NONE; i++) {
> -      EGLint attr = attrib_list[i++];
> -      EGLint val = attrib_list[i];
> +   for (size_t i = 0; attrib_list[i] != EGL_NONE; i++) {
> +      EGLAttrib attr = attrib_list[i++];
> +      EGLAttrib val = attrib_list[i];
>  
>        switch (attr) {
>        case EGL_CL_EVENT_HANDLE_KHR:
> @@ -92,8 +93,8 @@ _eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
>        }
>  
>        if (err != EGL_SUCCESS) {
> -         _eglLog(_EGL_DEBUG, "bad sync attribute 0x%04x", attr);
> -         break;
> +         _eglLog(_EGL_DEBUG, "bad sync attribute 0x%" PRIxPTR, attr);

I think the _eglLog part of that hunk was meant to be in patch #3:
"fix the log message to work when EGLAttrib is 32-bit or 64-bit"
(The include would need to be moved to the other patch as well.)

With that and the other issue in patch #3 fixed, the series is:
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

> +         return err;
>        }
>     }
>  
> -- 
> 2.9.0.rc2


More information about the mesa-dev mailing list