src/video/x11/SDL_x11messagebox.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7191 75360622e65f
     1.1 --- a/src/video/x11/SDL_x11messagebox.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/video/x11/SDL_x11messagebox.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -168,8 +168,7 @@
     1.4      const SDL_MessageBoxColor *colorhints;
     1.5  
     1.6      if ( numbuttons > MAX_BUTTONS ) {
     1.7 -        SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
     1.8 -        return -1;
     1.9 +        return SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
    1.10      }
    1.11  
    1.12      data->dialog_width = MIN_DIALOG_WIDTH;
    1.13 @@ -181,8 +180,7 @@
    1.14  
    1.15      data->display = XOpenDisplay( NULL );
    1.16      if ( !data->display ) {
    1.17 -        SDL_SetError("Couldn't open X11 display");
    1.18 -        return -1;
    1.19 +        return SDL_SetError("Couldn't open X11 display");
    1.20      }
    1.21  
    1.22      if (SDL_X11_HAVE_UTF8) {
    1.23 @@ -194,14 +192,12 @@
    1.24              XFreeStringList(missing);
    1.25          }
    1.26          if ( data->font_set == NULL ) {
    1.27 -            SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
    1.28 -            return -1;
    1.29 +            return SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
    1.30          }
    1.31      } else {
    1.32          data->font_struct = XLoadQueryFont( data->display, g_MessageBoxFontLatin1 );
    1.33          if ( data->font_struct == NULL ) {
    1.34 -            SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);
    1.35 -            return -1;
    1.36 +            return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);
    1.37          }
    1.38      }
    1.39  
    1.40 @@ -388,8 +384,7 @@
    1.41                         0, CopyFromParent, InputOutput, CopyFromParent,
    1.42                         CWEventMask, &wnd_attr );
    1.43      if ( data->window == None ) {
    1.44 -        SDL_SetError("Couldn't create X window");
    1.45 -        return -1;
    1.46 +        return SDL_SetError("Couldn't create X window");
    1.47      }
    1.48  
    1.49      if ( windowdata ) {
    1.50 @@ -520,8 +515,7 @@
    1.51  
    1.52      ctx = XCreateGC( data->display, data->window, gcflags, &ctx_vals );
    1.53      if ( ctx == None ) {
    1.54 -        SDL_SetError("Couldn't create graphics context");
    1.55 -        return -1;
    1.56 +        return SDL_SetError("Couldn't create graphics context");
    1.57      }
    1.58  
    1.59      data->button_press_index = -1;  /* Reset what button is currently depressed. */
    1.60 @@ -660,8 +654,7 @@
    1.61      if (origlocale != NULL) {
    1.62          origlocale = SDL_strdup(origlocale);
    1.63          if (origlocale == NULL) {
    1.64 -            SDL_OutOfMemory();
    1.65 -            return -1;
    1.66 +            return SDL_OutOfMemory();
    1.67          }
    1.68          setlocale(LC_ALL, "");
    1.69      }
    1.70 @@ -739,8 +732,7 @@
    1.71          SDL_assert(rc == pid);  /* not sure what to do if this fails. */
    1.72  
    1.73          if ((rc == -1) || (!WIFEXITED(status)) || (WEXITSTATUS(status) != 0)) {
    1.74 -            SDL_SetError("msgbox child process failed");
    1.75 -            return -1;
    1.76 +            return SDL_SetError("msgbox child process failed");
    1.77          }
    1.78  
    1.79          if (read(fds[0], &status, sizeof (int)) != sizeof (int))