Browse Source

Some small fixes and corrections: comment typos, a wrong return value.

Just a few things I stumbled upon this week.
Ryan C. Gordon 1 month ago
parent
commit
4217d62fa2
3 changed files with 4 additions and 4 deletions
  1. 1 1
      src/video/SDL_sysvideo.h
  2. 2 2
      src/video/SDL_video.c
  3. 1 1
      src/video/kmsdrm/SDL_kmsdrmvideo.c

+ 1 - 1
src/video/SDL_sysvideo.h

@@ -220,7 +220,7 @@ struct SDL_VideoDevice
 
 
     /*
     /*
      * Initialize the native video subsystem, filling in the list of
      * Initialize the native video subsystem, filling in the list of
-     * displays for this driver, returning 0 or -1 if there's an error.
+     * displays for this driver, returning true (success) or false (error).
      */
      */
     bool (*VideoInit)(SDL_VideoDevice *_this);
     bool (*VideoInit)(SDL_VideoDevice *_this);
 
 

+ 2 - 2
src/video/SDL_video.c

@@ -843,13 +843,13 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, bool send_eve
 
 
     new_display = (SDL_VideoDisplay *)SDL_malloc(sizeof(*new_display));
     new_display = (SDL_VideoDisplay *)SDL_malloc(sizeof(*new_display));
     if (!new_display) {
     if (!new_display) {
-        return true;
+        return 0;
     }
     }
 
 
     displays = (SDL_VideoDisplay **)SDL_realloc(_this->displays, (_this->num_displays + 1) * sizeof(*displays));
     displays = (SDL_VideoDisplay **)SDL_realloc(_this->displays, (_this->num_displays + 1) * sizeof(*displays));
     if (!displays) {
     if (!displays) {
         SDL_free(new_display);
         SDL_free(new_display);
-        return true;
+        return 0;
     }
     }
     _this->displays = displays;
     _this->displays = displays;
     _this->displays[_this->num_displays++] = new_display;
     _this->displays[_this->num_displays++] = new_display;

+ 1 - 1
src/video/kmsdrm/SDL_kmsdrmvideo.c

@@ -1543,7 +1543,7 @@ void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
 
 
 /**********************************************************************/
 /**********************************************************************/
 // We simply IGNORE if it's a fullscreen window, window->flags don't
 // We simply IGNORE if it's a fullscreen window, window->flags don't
-// reflect it: if it's fullscreen, KMSDRM_SetWindwoFullscreen() will
+// reflect it: if it's fullscreen, KMSDRM_SetWindowFullscreen() will
 // be called by SDL later, and we can manage it there.
 // be called by SDL later, and we can manage it there.
 /**********************************************************************/
 /**********************************************************************/
 bool KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
 bool KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)