[Cogl] [PATCH 1/2] Fix a warning when building the SDL2 winsys

Robert Bragg robert at sixbynine.org
Wed Oct 3 06:01:34 PDT 2012


this looks good to land to me:

Robert Bragg <robert at linux.intel.com>

thanks,
- Robert

On Wed, Oct 3, 2012 at 12:12 PM, Neil Roberts <neil at linux.intel.com> wrote:
> The SDL2 winsys was using _cogl_set_error without including its header
> so it was giving an annoying warning. This patch also fixes some
> indentation issues.
> ---
>  cogl/winsys/cogl-winsys-sdl2.c | 41 +++++++++++++++++++++--------------------
>  1 file changed, 21 insertions(+), 20 deletions(-)
>
> diff --git a/cogl/winsys/cogl-winsys-sdl2.c b/cogl/winsys/cogl-winsys-sdl2.c
> index 3ebecf3..cd991a4 100644
> --- a/cogl/winsys/cogl-winsys-sdl2.c
> +++ b/cogl/winsys/cogl-winsys-sdl2.c
> @@ -37,6 +37,7 @@
>  #include "cogl-context-private.h"
>  #include "cogl-onscreen-private.h"
>  #include "cogl-winsys-sdl-private.h"
> +#include "cogl-error-private.h"
>
>  typedef struct _CoglContextSdl2
>  {
> @@ -91,9 +92,9 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
>    if (SDL_VideoInit (NULL) < 0)
>      {
>        _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                   COGL_WINSYS_ERROR_INIT,
> -                   "SDL_Init failed: %s",
> -                   SDL_GetError ());
> +                       COGL_WINSYS_ERROR_INIT,
> +                       "SDL_Init failed: %s",
> +                       SDL_GetError ());
>        return FALSE;
>      }
>
> @@ -169,9 +170,9 @@ _cogl_winsys_display_setup (CoglDisplay *display,
>    if (sdl_display->dummy_window == NULL)
>      {
>        _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                   COGL_WINSYS_ERROR_INIT,
> -                   "SDL_CreateWindow failed: %s",
> -                   SDL_GetError ());
> +                       COGL_WINSYS_ERROR_INIT,
> +                       "SDL_CreateWindow failed: %s",
> +                       SDL_GetError ());
>        goto error;
>      }
>
> @@ -180,9 +181,9 @@ _cogl_winsys_display_setup (CoglDisplay *display,
>    if (sdl_display->context == NULL)
>      {
>        _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                   COGL_WINSYS_ERROR_INIT,
> -                   "SDL_GL_CreateContext failed: %s",
> -                   SDL_GetError ());
> +                       COGL_WINSYS_ERROR_INIT,
> +                       "SDL_GL_CreateContext failed: %s",
> +                       SDL_GetError ());
>        goto error;
>      }
>
> @@ -202,8 +203,8 @@ _cogl_winsys_display_setup (CoglDisplay *display,
>        if (!g_ascii_isdigit (gl_version[0]))
>          {
>            _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                       COGL_WINSYS_ERROR_INIT,
> -                       "The GL driver was requested but SDL is using GLES");
> +                           COGL_WINSYS_ERROR_INIT,
> +                           "The GL driver was requested but SDL is using GLES");
>            goto error;
>          }
>
> @@ -235,9 +236,9 @@ _cogl_winsys_display_setup (CoglDisplay *display,
>        if (!g_str_has_prefix (gl_version, "OpenGL ES 2"))
>          {
>            _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                       COGL_WINSYS_ERROR_INIT,
> -                       "The GLES2 driver was requested but SDL is "
> -                       "not using GLES2");
> +                           COGL_WINSYS_ERROR_INIT,
> +                           "The GLES2 driver was requested but SDL is "
> +                           "not using GLES2");
>            goto error;
>          }
>        break;
> @@ -246,9 +247,9 @@ _cogl_winsys_display_setup (CoglDisplay *display,
>        if (!g_str_has_prefix (gl_version, "OpenGL ES 1"))
>          {
>            _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                       COGL_WINSYS_ERROR_INIT,
> -                       "The GLES1 driver was requested but SDL is "
> -                       "not using GLES1");
> +                           COGL_WINSYS_ERROR_INIT,
> +                           "The GLES1 driver was requested but SDL is "
> +                           "not using GLES1");
>            goto error;
>          }
>        break;
> @@ -365,9 +366,9 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
>    if (window == NULL)
>      {
>        _cogl_set_error (error, COGL_WINSYS_ERROR,
> -                   COGL_WINSYS_ERROR_CREATE_ONSCREEN,
> -                   "SDL_CreateWindow failed: %s",
> -                   SDL_GetError ());
> +                       COGL_WINSYS_ERROR_CREATE_ONSCREEN,
> +                       "SDL_CreateWindow failed: %s",
> +                       SDL_GetError ());
>        return FALSE;
>      }
>
> --
> 1.7.11.3.g3c3efa5
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl


More information about the Cogl mailing list