Fixed whitespace
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Sep 2018 11:49:25 -0700
changeset 122018bdc4d340419
parent 12200 c0b17b32b95e
child 12202 453f55c56b16
Fixed whitespace
src/SDL.c
src/audio/alsa/SDL_alsa_audio.c
src/audio/arts/SDL_artsaudio.c
src/audio/directsound/SDL_directsound.c
src/audio/pulseaudio/SDL_pulseaudio.c
src/audio/winmm/SDL_winmm.c
src/core/android/SDL_android.c
src/core/linux/SDL_dbus.h
src/core/linux/SDL_udev.h
src/core/winrt/SDL_winrtapp_xaml.cpp
src/joystick/SDL_gamecontroller.c
src/joystick/SDL_joystick.c
src/joystick/controller_type.h
src/joystick/haiku/SDL_haikujoystick.cc
src/joystick/windows/SDL_windowsjoystick.c
src/main/haiku/SDL_BApp.h
src/main/haiku/SDL_BeApp.cc
src/stdlib/SDL_iconv.c
src/video/SDL_blit_1.c
src/video/SDL_blit_A.c
src/video/SDL_egl.c
src/video/SDL_pixels.c
src/video/SDL_shape_internals.h
src/video/SDL_video.c
src/video/SDL_vulkan_utils.c
src/video/SDL_yuv.c
src/video/android/SDL_androidvideo.c
src/video/cocoa/SDL_cocoaevents.m
src/video/cocoa/SDL_cocoametalview.m
src/video/cocoa/SDL_cocoamousetap.m
src/video/cocoa/SDL_cocoawindow.m
src/video/directfb/SDL_DirectFB_video.c
src/video/haiku/SDL_BWin.h
src/video/haiku/SDL_bclipboard.cc
src/video/haiku/SDL_bevents.cc
src/video/haiku/SDL_bframebuffer.cc
src/video/haiku/SDL_bkeyboard.cc
src/video/haiku/SDL_bmodes.cc
src/video/haiku/SDL_bvideo.cc
src/video/haiku/SDL_bwindow.cc
src/video/kmsdrm/SDL_kmsdrmmouse.c
src/video/kmsdrm/SDL_kmsdrmopengles.c
src/video/raspberry/SDL_rpivideo.c
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitmodes.m
src/video/uikit/SDL_uikitview.m
src/video/wayland/SDL_waylandevents.c
src/video/wayland/SDL_waylandtouch.c
src/video/wayland/SDL_waylandvideo.c
src/video/wayland/SDL_waylandwindow.c
src/video/windows/SDL_windowsopengl.h
src/video/windows/SDL_windowsvulkan.c
src/video/x11/SDL_x11opengl.h
src/video/x11/SDL_x11sym.h
     1.1 --- a/src/SDL.c	Sat Aug 18 17:23:40 2018 -0400
     1.2 +++ b/src/SDL.c	Mon Sep 24 11:49:25 2018 -0700
     1.3 @@ -124,11 +124,11 @@
     1.4      }
     1.5  
     1.6  #if SDL_VIDEO_DRIVER_WINDOWS
     1.7 -	if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
     1.8 -		if (SDL_HelperWindowCreate() < 0) {
     1.9 -			return -1;
    1.10 -		}
    1.11 -	}
    1.12 +    if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
    1.13 +        if (SDL_HelperWindowCreate() < 0) {
    1.14 +            return -1;
    1.15 +        }
    1.16 +    }
    1.17  #endif
    1.18  
    1.19  #if !SDL_TIMERS_DISABLED
    1.20 @@ -263,8 +263,8 @@
    1.21  #if !SDL_SENSOR_DISABLED
    1.22      if ((flags & SDL_INIT_SENSOR)) {
    1.23          if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_SENSOR)) {
    1.24 -			SDL_SensorQuit();
    1.25 -		}
    1.26 +            SDL_SensorQuit();
    1.27 +        }
    1.28          SDL_PrivateSubsystemRefCountDecr(SDL_INIT_SENSOR);
    1.29      }
    1.30  #endif
     2.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Sat Aug 18 17:23:40 2018 -0400
     2.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Sep 24 11:49:25 2018 -0700
     2.3 @@ -445,7 +445,7 @@
     2.4  ALSA_CloseDevice(_THIS)
     2.5  {
     2.6      if (this->hidden->pcm_handle) {
     2.7 -	/* Wait for the submitted audio to drain
     2.8 +        /* Wait for the submitted audio to drain
     2.9             ALSA_snd_pcm_drop() can hang, so don't use that.
    2.10           */
    2.11          Uint32 delay = ((this->spec.samples * 1000) / this->spec.freq) * 2;
     3.1 --- a/src/audio/arts/SDL_artsaudio.c	Sat Aug 18 17:23:40 2018 -0400
     3.2 +++ b/src/audio/arts/SDL_artsaudio.c	Mon Sep 24 11:49:25 2018 -0700
     3.3 @@ -39,7 +39,7 @@
     3.4  #include "SDL_name.h"
     3.5  #include "SDL_loadso.h"
     3.6  #else
     3.7 -#define SDL_NAME(X)	X
     3.8 +#define SDL_NAME(X) X
     3.9  #endif
    3.10  
    3.11  #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
     4.1 --- a/src/audio/directsound/SDL_directsound.c	Sat Aug 18 17:23:40 2018 -0400
     4.2 +++ b/src/audio/directsound/SDL_directsound.c	Mon Sep 24 11:49:25 2018 -0700
     4.3 @@ -477,8 +477,8 @@
     4.4      SDL_bool tried_format = SDL_FALSE;
     4.5      SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
     4.6      LPGUID guid = (LPGUID) handle;
     4.7 -	DWORD bufsize;
     4.8 -	
     4.9 +    DWORD bufsize;
    4.10 +
    4.11      /* Initialize all variables that we clean on shutdown */
    4.12      this->hidden = (struct SDL_PrivateAudioData *)
    4.13          SDL_malloc((sizeof *this->hidden));
    4.14 @@ -526,7 +526,7 @@
    4.15                               (int) (DSBSIZE_MAX / numchunks));
    4.16              } else {
    4.17                  int rc;
    4.18 -				WAVEFORMATEX wfmt;
    4.19 +                WAVEFORMATEX wfmt;
    4.20                  SDL_zero(wfmt);
    4.21                  if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
    4.22                      wfmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
     5.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c	Sat Aug 18 17:23:40 2018 -0400
     5.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Mon Sep 24 11:49:25 2018 -0700
     5.3 @@ -109,7 +109,7 @@
     5.4      pa_stream_success_cb_t, void *);
     5.5  static int (*PULSEAUDIO_pa_stream_peek) (pa_stream *, const void **, size_t *);
     5.6  static int (*PULSEAUDIO_pa_stream_drop) (pa_stream *);
     5.7 -static pa_operation * (*PULSEAUDIO_pa_stream_flush)	(pa_stream *,
     5.8 +static pa_operation * (*PULSEAUDIO_pa_stream_flush) (pa_stream *,
     5.9      pa_stream_success_cb_t, void *);
    5.10  static int (*PULSEAUDIO_pa_stream_disconnect) (pa_stream *);
    5.11  static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *);
     6.1 --- a/src/audio/winmm/SDL_winmm.c	Sat Aug 18 17:23:40 2018 -0400
     6.2 +++ b/src/audio/winmm/SDL_winmm.c	Mon Sep 24 11:49:25 2018 -0700
     6.3 @@ -78,7 +78,7 @@
     6.4      capstyp##2W caps; \
     6.5      UINT i; \
     6.6      for (i = 0; i < devcount; i++) { \
     6.7 -	if (wave##typ##GetDevCaps(i,(LP##capstyp##W)&caps,sizeof(caps))==MMSYSERR_NOERROR) { \
     6.8 +        if (wave##typ##GetDevCaps(i,(LP##capstyp##W)&caps,sizeof(caps))==MMSYSERR_NOERROR) { \
     6.9              char *name = WIN_LookupAudioDeviceName(caps.szPname,&caps.NameGuid); \
    6.10              if (name != NULL) { \
    6.11                  SDL_AddAudioDevice((int) iscapture, name, (void *) ((size_t) i+1)); \
    6.12 @@ -375,8 +375,7 @@
    6.13  #endif
    6.14  
    6.15      /* Create the audio buffer semaphore */
    6.16 -    this->hidden->audio_sem =
    6.17 -		CreateSemaphore(NULL, iscapture ? 0 : NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
    6.18 +    this->hidden->audio_sem = CreateSemaphore(NULL, iscapture ? 0 : NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
    6.19      if (this->hidden->audio_sem == NULL) {
    6.20          return SDL_SetError("Couldn't create semaphore");
    6.21      }
     7.1 --- a/src/core/android/SDL_android.c	Sat Aug 18 17:23:40 2018 -0400
     7.2 +++ b/src/core/android/SDL_android.c	Mon Sep 24 11:49:25 2018 -0700
     7.3 @@ -77,7 +77,7 @@
     7.4  JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
     7.5          JNIEnv* env, jclass jcls,
     7.6          jint surfaceWidth, jint surfaceHeight,
     7.7 -		jint deviceWidth, jint deviceHeight, jint format, jfloat rate);
     7.8 +        jint deviceWidth, jint deviceHeight, jint format, jfloat rate);
     7.9  
    7.10  JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(
    7.11          JNIEnv* env, jclass jcls);
    7.12 @@ -537,7 +537,7 @@
    7.13  JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
    7.14                                      JNIEnv* env, jclass jcls,
    7.15                                      jint surfaceWidth, jint surfaceHeight,
    7.16 -									jint deviceWidth, jint deviceHeight, jint format, jfloat rate)
    7.17 +                                    jint deviceWidth, jint deviceHeight, jint format, jfloat rate)
    7.18  {
    7.19      Android_SetScreenResolution(surfaceWidth, surfaceHeight, deviceWidth, deviceHeight, format, rate);
    7.20  }
     8.1 --- a/src/core/linux/SDL_dbus.h	Sat Aug 18 17:23:40 2018 -0400
     8.2 +++ b/src/core/linux/SDL_dbus.h	Mon Sep 24 11:49:25 2018 -0700
     8.3 @@ -39,9 +39,8 @@
     8.4      void (*bus_add_match)(DBusConnection *, const char *, DBusError *);
     8.5      DBusConnection * (*connection_open_private)(const char *, DBusError *);
     8.6      void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
     8.7 -    dbus_bool_t (*connection_get_is_connected)(DBusConnection *); 	
     8.8 -    dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction,
     8.9 -	    void *, DBusFreeFunction);
    8.10 +    dbus_bool_t (*connection_get_is_connected)(DBusConnection *);
    8.11 +    dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction, void *, DBusFreeFunction);
    8.12      dbus_bool_t (*connection_try_register_object_path)(DBusConnection *, const char *,
    8.13          const DBusObjectPathVTable *, void *, DBusError *);
    8.14      dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *);
    8.15 @@ -51,7 +50,7 @@
    8.16      void (*connection_flush)(DBusConnection *);
    8.17      dbus_bool_t (*connection_read_write)(DBusConnection *, int);
    8.18      DBusDispatchStatus (*connection_dispatch)(DBusConnection *);
    8.19 -    dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); 	
    8.20 +    dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); 
    8.21      DBusMessage *(*message_new_method_call)(const char *, const char *, const char *, const char *);
    8.22      dbus_bool_t (*message_append_args)(DBusMessage *, int, ...);
    8.23      dbus_bool_t (*message_append_args_valist)(DBusMessage *, int, va_list);
    8.24 @@ -61,7 +60,7 @@
    8.25      dbus_bool_t (*message_iter_next)(DBusMessageIter *);
    8.26      void (*message_iter_get_basic)(DBusMessageIter *, void *);
    8.27      int (*message_iter_get_arg_type)(DBusMessageIter *);
    8.28 -    void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); 	 	
    8.29 +    void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); 
    8.30      void (*message_unref)(DBusMessage *);
    8.31      void (*error_init)(DBusError *);
    8.32      dbus_bool_t (*error_is_set)(const DBusError *);
     9.1 --- a/src/core/linux/SDL_udev.h	Sat Aug 18 17:23:40 2018 -0400
     9.2 +++ b/src/core/linux/SDL_udev.h	Mon Sep 24 11:49:25 2018 -0700
     9.3 @@ -77,9 +77,9 @@
     9.4      const char *(*udev_device_get_action)(struct udev_device *);
     9.5      const char *(*udev_device_get_devnode)(struct udev_device *);
     9.6      const char *(*udev_device_get_subsystem)(struct udev_device *);
     9.7 -	struct udev_device *(*udev_device_get_parent_with_subsystem_devtype)(struct udev_device *udev_device, const char *subsystem, const char *devtype);
     9.8 +    struct udev_device *(*udev_device_get_parent_with_subsystem_devtype)(struct udev_device *udev_device, const char *subsystem, const char *devtype);
     9.9      const char *(*udev_device_get_property_value)(struct udev_device *, const char *);
    9.10 -	const char *(*udev_device_get_sysattr_value)(struct udev_device *udev_device, const char *sysattr);
    9.11 +    const char *(*udev_device_get_sysattr_value)(struct udev_device *udev_device, const char *sysattr);
    9.12      struct udev_device *(*udev_device_new_from_syspath)(struct udev *, const char *);
    9.13      void (*udev_device_unref)(struct udev_device *);
    9.14      int (*udev_enumerate_add_match_property)(struct udev_enumerate *, const char *, const char *);
    10.1 --- a/src/core/winrt/SDL_winrtapp_xaml.cpp	Sat Aug 18 17:23:40 2018 -0400
    10.2 +++ b/src/core/winrt/SDL_winrtapp_xaml.cpp	Mon Sep 24 11:49:25 2018 -0700
    10.3 @@ -44,7 +44,7 @@
    10.4  #if WINAPI_FAMILY == WINAPI_FAMILY_APP
    10.5  extern "C"
    10.6  ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
    10.7 -static Windows::Foundation::EventRegistrationToken	WINRT_XAMLAppEventToken;
    10.8 +static Windows::Foundation::EventRegistrationToken  WINRT_XAMLAppEventToken;
    10.9  #endif
   10.10  
   10.11  
    11.1 --- a/src/joystick/SDL_gamecontroller.c	Sat Aug 18 17:23:40 2018 -0400
    11.2 +++ b/src/joystick/SDL_gamecontroller.c	Mon Sep 24 11:49:25 2018 -0700
    11.3 @@ -1027,7 +1027,7 @@
    11.4      }
    11.5  #ifdef __ANDROID__
    11.6      if (!mapping && name && !SDL_IsJoystickHIDAPI(guid)) {
    11.7 -		mapping = SDL_CreateMappingForAndroidController(name, guid);
    11.8 +        mapping = SDL_CreateMappingForAndroidController(name, guid);
    11.9      }
   11.10  #endif
   11.11      if (!mapping) {
    12.1 --- a/src/joystick/SDL_joystick.c	Sat Aug 18 17:23:40 2018 -0400
    12.2 +++ b/src/joystick/SDL_joystick.c	Mon Sep 24 11:49:25 2018 -0700
    12.3 @@ -1141,13 +1141,13 @@
    12.4  SDL_bool
    12.5  SDL_IsJoystickXbox360(Uint16 vendor, Uint16 product)
    12.6  {
    12.7 -	/* Filter out some bogus values here */
    12.8 -	if (vendor == 0x0000 && product == 0x0000) {
    12.9 -		return SDL_FALSE;
   12.10 -	}
   12.11 -	if (vendor == 0x0001 && product == 0x0001) {
   12.12 -		return SDL_FALSE;
   12.13 -	}
   12.14 +    /* Filter out some bogus values here */
   12.15 +    if (vendor == 0x0000 && product == 0x0000) {
   12.16 +        return SDL_FALSE;
   12.17 +    }
   12.18 +    if (vendor == 0x0001 && product == 0x0001) {
   12.19 +        return SDL_FALSE;
   12.20 +    }
   12.21      return (GuessControllerType(vendor, product) == k_eControllerType_XBox360Controller);
   12.22  }
   12.23  
    13.1 --- a/src/joystick/controller_type.h	Sat Aug 18 17:23:40 2018 -0400
    13.2 +++ b/src/joystick/controller_type.h	Mon Sep 24 11:49:25 2018 -0700
    13.3 @@ -43,9 +43,6 @@
    13.4  	k_eControllerType_SteamController = 2,
    13.5  	k_eControllerType_SteamControllerV2 = 3,
    13.6  
    13.7 -	// IR Remote controls on Steambox
    13.8 -	k_eControllerType_FrontPanelBoard = 20,
    13.9 -
   13.10  	// Other Controllers
   13.11  	k_eControllerType_UnknownNonSteamController = 30,
   13.12  	k_eControllerType_XBox360Controller = 31,
   13.13 @@ -73,49 +70,6 @@
   13.14  	return ( eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2 );
   13.15  }
   13.16  
   13.17 -#if 0  /* these are currently unused, so #if 0'd out to prevent compiler warnings for now */
   13.18 -static inline bool BIsSteamHardwareDevice( EControllerType eType )
   13.19 -{
   13.20 -	return ( eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2 || eType == k_eControllerType_FrontPanelBoard );
   13.21 -}
   13.22 -
   13.23 -static inline bool BIsXInputController( EControllerType eType )
   13.24 -{
   13.25 -	return ( eType == k_eControllerType_XBox360Controller || eType == k_eControllerType_XBoxOneController || eType == k_eControllerType_UnknownNonSteamController );
   13.26 -}
   13.27 -
   13.28 -static inline bool BIsSwitchController( EControllerType eType )
   13.29 -{
   13.30 -    return ( eType == k_eControllerType_SwitchJoyConLeft || eType == k_eControllerType_SwitchJoyConRight ||
   13.31 -             eType == k_eControllerType_SwitchJoyConPair || eType == k_eControllerType_SwitchProController ||
   13.32 -             eType == k_eControllerType_SwitchInputOnlyController );
   13.33 -}
   13.34 -
   13.35 -/* XXX: this should be updated when we ship nintentdo switch controller support */
   13.36 -static inline bool BIsRawHIDDevice( EControllerType eType )
   13.37 -{
   13.38 -	return BIsSteamHardwareDevice( eType) || eType == k_eControllerType_PS4Controller || BIsSwitchController( eType );
   13.39 -}
   13.40 -
   13.41 -// 'Full' here means that the controller has a full complement of buttons, joysticks, etc, as compared to
   13.42 -// the single Joy-Con's that only have around half of the controls that a normal controller has
   13.43 -static inline bool BIsFullSwitchController( EControllerType eType )
   13.44 -{
   13.45 -    return ( eType == k_eControllerType_SwitchJoyConPair || eType == k_eControllerType_SwitchProController );
   13.46 -}
   13.47 -
   13.48 -static inline bool BIsCompatibleType( EControllerType eTypeA, EControllerType eTypeB )
   13.49 -{
   13.50 -	if ( BIsSteamController( eTypeA ) && BIsSteamController( eTypeB ) )
   13.51 -		return true;
   13.52 -	if ( BIsXInputController( eTypeA ) && BIsXInputController( eTypeB ) )
   13.53 -		return true;
   13.54 -	if ( eTypeA == eTypeB )
   13.55 -		return true;
   13.56 -	return false;
   13.57 -}
   13.58 -#endif
   13.59 -
   13.60  #define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( nVID << 16 | nPID )
   13.61  typedef struct
   13.62  {
   13.63 @@ -168,7 +122,6 @@
   13.64  	{ MAKE_CONTROLLER_ID( 0x146b, 0x0603 ), k_eControllerType_PS3Controller },		// From SDL
   13.65  	{ MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller },		// Firestorm Dual Analog 3
   13.66  	{ MAKE_CONTROLLER_ID( 0x0925, 0x8888 ), k_eControllerType_PS3Controller },		// Actually ps2 -maybe break out later Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad
   13.67 -	{ MAKE_CONTROLLER_ID( 0x146b, 0x0602 ), k_eControllerType_PS3Controller },		// From SDL
   13.68  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x004d ), k_eControllerType_PS3Controller },		// Horipad 3
   13.69  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0009 ), k_eControllerType_PS3Controller },		// HORI BDA GP1
   13.70  	{ MAKE_CONTROLLER_ID( 0x0e8f, 0x0008 ), k_eControllerType_PS3Controller },		// Green Asia
   13.71 @@ -214,8 +167,8 @@
   13.72  	{ MAKE_CONTROLLER_ID( 0x1532, 0x1000 ), k_eControllerType_PS4Controller },		// Razer Raiju PS4 Controller
   13.73  	{ MAKE_CONTROLLER_ID( 0x1532, 0X0401 ), k_eControllerType_PS4Controller },		// Razer Panthera PS4 Controller
   13.74  	{ MAKE_CONTROLLER_ID( 0x054c, 0x05c5 ), k_eControllerType_PS4Controller },		// STRIKEPAD PS4 Grip Add-on
   13.75 -	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller
   13.76 -	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller v2
   13.77 +	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller - has gyro
   13.78 +	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller v2 - has gyro
   13.79  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00a0 ), k_eControllerType_PS4Controller },		// HORI TAC4 mousething
   13.80  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x009c ), k_eControllerType_PS4Controller },		// HORI TAC PRO mousething
   13.81  	{ MAKE_CONTROLLER_ID( 0x0c12, 0x0ef6 ), k_eControllerType_PS4Controller },		// Hitbox Arcade Stick
   13.82 @@ -224,7 +177,15 @@
   13.83  	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00ee ), k_eControllerType_PS4Controller },		// Hori mini wired https://www.playstation.com/en-us/explore/accessories/gaming-controllers/mini-wired-gamepad/
   13.84  	{ MAKE_CONTROLLER_ID( 0x0738, 0x8481 ), k_eControllerType_PS4Controller },		// Mad Catz FightStick TE 2+ PS4
   13.85  	{ MAKE_CONTROLLER_ID( 0x0738, 0x8480 ), k_eControllerType_PS4Controller },		// Mad Catz FightStick TE 2 PS4
   13.86 -	{ MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller },		// Armor 3 or Level Up Cobra
   13.87 +	{ MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller },		// Armor 3 or Level Up Cobra - At least one variant has gyro
   13.88 +	{ MAKE_CONTROLLER_ID( 0x0c12, 0x0e15 ), k_eControllerType_PS4Controller },		// Game:Pad 4
   13.89 +	{ MAKE_CONTROLLER_ID( 0x11c0, 0x4001 ), k_eControllerType_PS4Controller },		// "PS4 Fun Controller" added from user log
   13.90 +
   13.91 +	{ MAKE_CONTROLLER_ID( 0x1532, 0x1007 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Tournament edition USB- untested and added for razer
   13.92 +	{ MAKE_CONTROLLER_ID( 0x1532, 0x100A ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Tournament edition BT - untested and added for razer
   13.93 +	{ MAKE_CONTROLLER_ID( 0x1532, 0x1004 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Ultimate USB - untested and added for razer
   13.94 +	{ MAKE_CONTROLLER_ID( 0x1532, 0x1009 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Ultimate BT - untested and added for razer
   13.95 +	{ MAKE_CONTROLLER_ID( 0x1532, 0x1008 ), k_eControllerType_PS4Controller },		// Razer Panthera Evo Fightstick - untested and added for razer
   13.96  
   13.97  	{ MAKE_CONTROLLER_ID( 0x056e, 0x2004 ), k_eControllerType_XBox360Controller },	// Elecom JC-U3613M
   13.98  	{ MAKE_CONTROLLER_ID( 0x06a3, 0xf51a ), k_eControllerType_XBox360Controller },	// Saitek P3600
   13.99 @@ -400,32 +361,42 @@
  13.100  	{ MAKE_CONTROLLER_ID( 0x0079, 0x187c ), k_eControllerType_XBox360Controller },	// Unknown Controller
  13.101  	{ MAKE_CONTROLLER_ID( 0x0079, 0x189c ), k_eControllerType_XBox360Controller },	// Unknown Controller
  13.102  	{ MAKE_CONTROLLER_ID( 0x0079, 0x1874 ), k_eControllerType_XBox360Controller },	// Unknown Controller
  13.103 +
  13.104 +	{ MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_XBox360Controller },	// SteelSeries Nimbus/Stratus XL
  13.105 +
  13.106  																					
  13.107  	//{ MAKE_CONTROLLER_ID( 0x1949, 0x0402 ), /*android*/ },	// Unknown Controller
  13.108  
  13.109  	{ MAKE_CONTROLLER_ID( 0x05ac, 0x0001 ), k_eControllerType_AppleController },	// MFI Extended Gamepad (generic entry for iOS/tvOS)
  13.110  	{ MAKE_CONTROLLER_ID( 0x05ac, 0x0002 ), k_eControllerType_AppleController },	// MFI Standard Gamepad (generic entry for iOS/tvOS)
  13.111 -	{ MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_AppleController },	// SteelSeries Nimbus
  13.112  
  13.113      // We currently don't support using a pair of Switch Joy-Con's as a single
  13.114      // controller and we don't want to support using them individually for the
  13.115      // time being, so these should be disabled until one of the above is true
  13.116      // { MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft },    // Nintendo Switch Joy-Con (Left)
  13.117      // { MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight },   // Nintendo Switch Joy-Con (Right)
  13.118 +
  13.119 +    // This same controller ID is spoofed by many 3rd-party Switch controllers.
  13.120 +    // The ones we currently know of are:
  13.121 +    // * Any 8bitdo controller with Switch support
  13.122 +    // * ORTZ Gaming Wireless Pro Controller
  13.123 +    // * ZhiXu Gamepad Wireless
  13.124 +    // * Sunwaytek Wireless Motion Controller for Nintendo Switch
  13.125  	{ MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController },        // Nintendo Switch Pro Controller
  13.126 +    
  13.127      { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c1 ), k_eControllerType_SwitchInputOnlyController },  // HORIPAD for Nintendo Switch
  13.128      { MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController },  // PowerA Wired Controller Plus
  13.129 +    { MAKE_CONTROLLER_ID( 0x0f0d, 0x0092 ), k_eControllerType_SwitchInputOnlyController },  // HORI Pokken Tournament DX Pro Pad
  13.130  
  13.131  
  13.132  	// Valve products - don't add to public list
  13.133 -    { MAKE_CONTROLLER_ID( 0x0000, 0x11fa ), k_eControllerType_MobileTouch },		// Streaming mobile touch virtual controls
  13.134 +    { MAKE_CONTROLLER_ID( 0x0000, 0x11fb ), k_eControllerType_MobileTouch },		// Streaming mobile touch virtual controls
  13.135  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1101 ), k_eControllerType_SteamController },	// Valve Legacy Steam Controller (CHELL)
  13.136  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1102 ), k_eControllerType_SteamController },	// Valve wired Steam Controller (D0G)
  13.137  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1105 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (D0G)
  13.138  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1106 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (D0G)
  13.139  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1142 ), k_eControllerType_SteamController },	// Valve wireless Steam Controller
  13.140  	{ MAKE_CONTROLLER_ID( 0x28de, 0x1201 ), k_eControllerType_SteamController },	// Valve wired Steam Controller (HEADCRAB)
  13.141 -	{ MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (HEADCRAB)
  13.142  };
  13.143  
  13.144  
    14.1 --- a/src/joystick/haiku/SDL_haikujoystick.cc	Sat Aug 18 17:23:40 2018 -0400
    14.2 +++ b/src/joystick/haiku/SDL_haikujoystick.cc	Mon Sep 24 11:49:25 2018 -0700
    14.3 @@ -36,7 +36,7 @@
    14.4  
    14.5  
    14.6  /* The maximum number of joysticks we'll detect */
    14.7 -#define MAX_JOYSTICKS	16
    14.8 +#define MAX_JOYSTICKS   16
    14.9  
   14.10  /* A list of available joysticks */
   14.11      static char *SDL_joyport[MAX_JOYSTICKS];
    15.1 --- a/src/joystick/windows/SDL_windowsjoystick.c	Sat Aug 18 17:23:40 2018 -0400
    15.2 +++ b/src/joystick/windows/SDL_windowsjoystick.c	Mon Sep 24 11:49:25 2018 -0700
    15.3 @@ -255,7 +255,7 @@
    15.4              /* WM_DEVICECHANGE not working, no XINPUT, no point in keeping thread alive */
    15.5              break;
    15.6  #endif /* SDL_JOYSTICK_XINPUT */
    15.7 -		}
    15.8 +        }
    15.9  
   15.10          if (s_bWindowsDeviceChanged || bXInputChanged) {
   15.11              s_bDeviceRemoved = SDL_TRUE;
    16.1 --- a/src/main/haiku/SDL_BApp.h	Sat Aug 18 17:23:40 2018 -0400
    16.2 +++ b/src/main/haiku/SDL_BApp.h	Mon Sep 24 11:49:25 2018 -0700
    16.3 @@ -198,7 +198,7 @@
    16.4              _current_context->UnlockGL();
    16.5          _current_context = newContext;
    16.6          if (_current_context)
    16.7 -	        _current_context->LockGL();
    16.8 +            _current_context->LockGL();
    16.9      }
   16.10  #endif
   16.11  
    17.1 --- a/src/main/haiku/SDL_BeApp.cc	Sat Aug 18 17:23:40 2018 -0400
    17.2 +++ b/src/main/haiku/SDL_BeApp.cc	Mon Sep 24 11:49:25 2018 -0700
    17.3 @@ -31,7 +31,7 @@
    17.4  #include <storage/File.h>
    17.5  #include <unistd.h>
    17.6  
    17.7 -#include "SDL_BApp.h"	/* SDL_BApp class definition */
    17.8 +#include "SDL_BApp.h"   /* SDL_BApp class definition */
    17.9  #include "SDL_BeApp.h"
   17.10  #include "SDL_timer.h"
   17.11  #include "SDL_error.h"
   17.12 @@ -53,24 +53,24 @@
   17.13  {
   17.14      BApplication *App;
   17.15  
   17.16 -	// default application signature
   17.17 -	const char *signature = "application/x-SDL-executable";
   17.18 -	// dig resources for correct signature
   17.19 -	image_info info;
   17.20 -	int32 cookie = 0;
   17.21 -	if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
   17.22 -		BFile f(info.name, O_RDONLY);
   17.23 -		if (f.InitCheck() == B_OK) {
   17.24 -			BAppFileInfo app_info(&f);
   17.25 -			if (app_info.InitCheck() == B_OK) {
   17.26 -				char sig[B_MIME_TYPE_LENGTH];
   17.27 -				if (app_info.GetSignature(sig) == B_OK)
   17.28 -					signature = strndup(sig, B_MIME_TYPE_LENGTH);
   17.29 -			}
   17.30 -		}
   17.31 -	}
   17.32 +    // default application signature
   17.33 +    const char *signature = "application/x-SDL-executable";
   17.34 +    // dig resources for correct signature
   17.35 +    image_info info;
   17.36 +    int32 cookie = 0;
   17.37 +    if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
   17.38 +        BFile f(info.name, O_RDONLY);
   17.39 +        if (f.InitCheck() == B_OK) {
   17.40 +            BAppFileInfo app_info(&f);
   17.41 +            if (app_info.InitCheck() == B_OK) {
   17.42 +                char sig[B_MIME_TYPE_LENGTH];
   17.43 +                if (app_info.GetSignature(sig) == B_OK)
   17.44 +                    signature = strndup(sig, B_MIME_TYPE_LENGTH);
   17.45 +            }
   17.46 +        }
   17.47 +    }
   17.48  
   17.49 -	App = new SDL_BApp(signature);
   17.50 +    App = new SDL_BApp(signature);
   17.51  
   17.52      App->Run();
   17.53      delete App;
   17.54 @@ -144,12 +144,12 @@
   17.55  
   17.56  /* SDL_BApp functions */
   17.57  void SDL_BApp::ClearID(SDL_BWin *bwin) {
   17.58 -	_SetSDLWindow(NULL, bwin->GetID());
   17.59 -	int32 i = _GetNumWindowSlots() - 1;
   17.60 -	while(i >= 0 && GetSDLWindow(i) == NULL) {
   17.61 -		_PopBackWindow();
   17.62 -		--i;
   17.63 -	}
   17.64 +    _SetSDLWindow(NULL, bwin->GetID());
   17.65 +    int32 i = _GetNumWindowSlots() - 1;
   17.66 +    while(i >= 0 && GetSDLWindow(i) == NULL) {
   17.67 +        _PopBackWindow();
   17.68 +        --i;
   17.69 +    }
   17.70  }
   17.71  
   17.72  #endif /* __HAIKU__ */
    18.1 --- a/src/stdlib/SDL_iconv.c	Sat Aug 18 17:23:40 2018 -0400
    18.2 +++ b/src/stdlib/SDL_iconv.c	Mon Sep 24 11:49:25 2018 -0700
    18.3 @@ -89,13 +89,13 @@
    18.4  #else
    18.5  
    18.6  /* Lots of useful information on Unicode at:
    18.7 -	http://www.cl.cam.ac.uk/~mgk25/unicode.html
    18.8 +    http://www.cl.cam.ac.uk/~mgk25/unicode.html
    18.9  */
   18.10  
   18.11 -#define UNICODE_BOM	0xFEFF
   18.12 +#define UNICODE_BOM    0xFEFF
   18.13  
   18.14 -#define UNKNOWN_ASCII	'?'
   18.15 -#define UNKNOWN_UNICODE	0xFFFD
   18.16 +#define UNKNOWN_ASCII    '?'
   18.17 +#define UNKNOWN_UNICODE    0xFFFD
   18.18  
   18.19  enum
   18.20  {
   18.21 @@ -115,13 +115,13 @@
   18.22      ENCODING_UCS4LE,
   18.23  };
   18.24  #if SDL_BYTEORDER == SDL_BIG_ENDIAN
   18.25 -#define ENCODING_UTF16NATIVE	ENCODING_UTF16BE
   18.26 -#define ENCODING_UTF32NATIVE	ENCODING_UTF32BE
   18.27 +#define ENCODING_UTF16NATIVE    ENCODING_UTF16BE
   18.28 +#define ENCODING_UTF32NATIVE    ENCODING_UTF32BE
   18.29  #define ENCODING_UCS2NATIVE     ENCODING_UCS2BE
   18.30  #define ENCODING_UCS4NATIVE     ENCODING_UCS4BE
   18.31  #else
   18.32 -#define ENCODING_UTF16NATIVE	ENCODING_UTF16LE
   18.33 -#define ENCODING_UTF32NATIVE	ENCODING_UTF32LE
   18.34 +#define ENCODING_UTF16NATIVE    ENCODING_UTF16LE
   18.35 +#define ENCODING_UTF32NATIVE    ENCODING_UTF32LE
   18.36  #define ENCODING_UCS2NATIVE     ENCODING_UCS2LE
   18.37  #define ENCODING_UCS4NATIVE     ENCODING_UCS4LE
   18.38  #endif
    19.1 --- a/src/video/SDL_blit_1.c	Sat Aug 18 17:23:40 2018 -0400
    19.2 +++ b/src/video/SDL_blit_1.c	Mon Sep 24 11:49:25 2018 -0700
    19.3 @@ -49,13 +49,13 @@
    19.4      while (height--) {
    19.5  #ifdef USE_DUFFS_LOOP
    19.6          /* *INDENT-OFF* */
    19.7 -		DUFFS_LOOP(
    19.8 -			{
    19.9 -			  *dst = map[*src];
   19.10 -			}
   19.11 -			dst++;
   19.12 -			src++;
   19.13 -		, width);
   19.14 +        DUFFS_LOOP(
   19.15 +            {
   19.16 +              *dst = map[*src];
   19.17 +            }
   19.18 +            dst++;
   19.19 +            src++;
   19.20 +        , width);
   19.21          /* *INDENT-ON* */
   19.22  #else
   19.23          for (c = width; c; --c) {
   19.24 @@ -72,11 +72,11 @@
   19.25  /* This is now endian dependent */
   19.26  #ifndef USE_DUFFS_LOOP
   19.27  # if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
   19.28 -#  define HI	1
   19.29 -#  define LO	0
   19.30 +#  define HI    1
   19.31 +#  define LO    0
   19.32  # else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
   19.33 -#  define HI	0
   19.34 -#  define LO	1
   19.35 +#  define HI    0
   19.36 +#  define LO    1
   19.37  # endif
   19.38  #endif
   19.39  static void
   19.40 @@ -101,14 +101,14 @@
   19.41  
   19.42  #ifdef USE_DUFFS_LOOP
   19.43      while (height--) {
   19.44 -		/* *INDENT-OFF* */
   19.45 -		DUFFS_LOOP(
   19.46 -		{
   19.47 -			*(Uint16 *)dst = map[*src++];
   19.48 -			dst += 2;
   19.49 -		},
   19.50 -		width);
   19.51 -		/* *INDENT-ON* */
   19.52 +        /* *INDENT-OFF* */
   19.53 +        DUFFS_LOOP(
   19.54 +        {
   19.55 +            *(Uint16 *)dst = map[*src++];
   19.56 +            dst += 2;
   19.57 +        },
   19.58 +        width);
   19.59 +        /* *INDENT-ON* */
   19.60          src += srcskip;
   19.61          dst += dstskip;
   19.62      }
   19.63 @@ -208,18 +208,18 @@
   19.64  
   19.65      while (height--) {
   19.66  #ifdef USE_DUFFS_LOOP
   19.67 -		/* *INDENT-OFF* */
   19.68 -		DUFFS_LOOP(
   19.69 -			{
   19.70 -				o = *src * 4;
   19.71 -				dst[0] = map[o++];
   19.72 -				dst[1] = map[o++];
   19.73 -				dst[2] = map[o++];
   19.74 -			}
   19.75 -			src++;
   19.76 -			dst += 3;
   19.77 -		, width);
   19.78 -		/* *INDENT-ON* */
   19.79 +        /* *INDENT-OFF* */
   19.80 +        DUFFS_LOOP(
   19.81 +            {
   19.82 +                o = *src * 4;
   19.83 +                dst[0] = map[o++];
   19.84 +                dst[1] = map[o++];
   19.85 +                dst[2] = map[o++];
   19.86 +            }
   19.87 +            src++;
   19.88 +            dst += 3;
   19.89 +        , width);
   19.90 +        /* *INDENT-ON* */
   19.91  #else
   19.92          for (c = width; c; --c) {
   19.93              o = *src * 4;
   19.94 @@ -257,11 +257,11 @@
   19.95  
   19.96      while (height--) {
   19.97  #ifdef USE_DUFFS_LOOP
   19.98 -		/* *INDENT-OFF* */
   19.99 -		DUFFS_LOOP(
  19.100 -			*dst++ = map[*src++];
  19.101 -		, width);
  19.102 -		/* *INDENT-ON* */
  19.103 +        /* *INDENT-OFF* */
  19.104 +        DUFFS_LOOP(
  19.105 +            *dst++ = map[*src++];
  19.106 +        , width);
  19.107 +        /* *INDENT-ON* */
  19.108  #else
  19.109          for (c = width / 4; c; --c) {
  19.110              *dst++ = map[*src++];
  19.111 @@ -297,33 +297,33 @@
  19.112  
  19.113      if (palmap) {
  19.114          while (height--) {
  19.115 -			/* *INDENT-OFF* */
  19.116 -			DUFFS_LOOP(
  19.117 -			{
  19.118 -				if ( *src != ckey ) {
  19.119 -				  *dst = palmap[*src];
  19.120 -				}
  19.121 -				dst++;
  19.122 -				src++;
  19.123 -			},
  19.124 -			width);
  19.125 -			/* *INDENT-ON* */
  19.126 +            /* *INDENT-OFF* */
  19.127 +            DUFFS_LOOP(
  19.128 +            {
  19.129 +                if ( *src != ckey ) {
  19.130 +                  *dst = palmap[*src];
  19.131 +                }
  19.132 +                dst++;
  19.133 +                src++;
  19.134 +            },
  19.135 +            width);
  19.136 +            /* *INDENT-ON* */
  19.137              src += srcskip;
  19.138              dst += dstskip;
  19.139          }
  19.140      } else {
  19.141          while (height--) {
  19.142 -			/* *INDENT-OFF* */
  19.143 -			DUFFS_LOOP(
  19.144 -			{
  19.145 -				if ( *src != ckey ) {
  19.146 -				  *dst = *src;
  19.147 -				}
  19.148 -				dst++;
  19.149 -				src++;
  19.150 -			},
  19.151 -			width);
  19.152 -			/* *INDENT-ON* */
  19.153 +            /* *INDENT-OFF* */
  19.154 +            DUFFS_LOOP(
  19.155 +            {
  19.156 +                if ( *src != ckey ) {
  19.157 +                  *dst = *src;
  19.158 +                }
  19.159 +                dst++;
  19.160 +                src++;
  19.161 +            },
  19.162 +            width);
  19.163 +            /* *INDENT-ON* */
  19.164              src += srcskip;
  19.165              dst += dstskip;
  19.166          }
  19.167 @@ -346,17 +346,17 @@
  19.168      dstskip /= 2;
  19.169  
  19.170      while (height--) {
  19.171 -		/* *INDENT-OFF* */
  19.172 -		DUFFS_LOOP(
  19.173 -		{
  19.174 -			if ( *src != ckey ) {
  19.175 -				*dstp=palmap[*src];
  19.176 -			}
  19.177 -			src++;
  19.178 -			dstp++;
  19.179 -		},
  19.180 -		width);
  19.181 -		/* *INDENT-ON* */
  19.182 +        /* *INDENT-OFF* */
  19.183 +        DUFFS_LOOP(
  19.184 +        {
  19.185 +            if ( *src != ckey ) {
  19.186 +                *dstp=palmap[*src];
  19.187 +            }
  19.188 +            src++;
  19.189 +            dstp++;
  19.190 +        },
  19.191 +        width);
  19.192 +        /* *INDENT-ON* */
  19.193          src += srcskip;
  19.194          dstp += dstskip;
  19.195      }
  19.196 @@ -376,20 +376,20 @@
  19.197      int o;
  19.198  
  19.199      while (height--) {
  19.200 -		/* *INDENT-OFF* */
  19.201 -		DUFFS_LOOP(
  19.202 -		{
  19.203 -			if ( *src != ckey ) {
  19.204 -				o = *src * 4;
  19.205 -				dst[0] = palmap[o++];
  19.206 -				dst[1] = palmap[o++];
  19.207 -				dst[2] = palmap[o++];
  19.208 -			}
  19.209 -			src++;
  19.210 -			dst += 3;
  19.211 -		},
  19.212 -		width);
  19.213 -		/* *INDENT-ON* */
  19.214 +        /* *INDENT-OFF* */
  19.215 +        DUFFS_LOOP(
  19.216 +        {
  19.217 +            if ( *src != ckey ) {
  19.218 +                o = *src * 4;
  19.219 +                dst[0] = palmap[o++];
  19.220 +                dst[1] = palmap[o++];
  19.221 +                dst[2] = palmap[o++];
  19.222 +            }
  19.223 +            src++;
  19.224 +            dst += 3;
  19.225 +        },
  19.226 +        width);
  19.227 +        /* *INDENT-ON* */
  19.228          src += srcskip;
  19.229          dst += dstskip;
  19.230      }
  19.231 @@ -411,17 +411,17 @@
  19.232      dstskip /= 4;
  19.233  
  19.234      while (height--) {
  19.235 -		/* *INDENT-OFF* */
  19.236 -		DUFFS_LOOP(
  19.237 -		{
  19.238 -			if ( *src != ckey ) {
  19.239 -				*dstp = palmap[*src];
  19.240 -			}
  19.241 -			src++;
  19.242 -			dstp++;
  19.243 -		},
  19.244 -		width);
  19.245 -		/* *INDENT-ON* */
  19.246 +        /* *INDENT-OFF* */
  19.247 +        DUFFS_LOOP(
  19.248 +        {
  19.249 +            if ( *src != ckey ) {
  19.250 +                *dstp = palmap[*src];
  19.251 +            }
  19.252 +            src++;
  19.253 +            dstp++;
  19.254 +        },
  19.255 +        width);
  19.256 +        /* *INDENT-ON* */
  19.257          src += srcskip;
  19.258          dstp += dstskip;
  19.259      }
  19.260 @@ -489,22 +489,22 @@
  19.261      dstbpp = dstfmt->BytesPerPixel;
  19.262  
  19.263      while (height--) {
  19.264 -		/* *INDENT-OFF* */
  19.265 -		DUFFS_LOOP(
  19.266 -		{
  19.267 -			if ( *src != ckey ) {
  19.268 -				sR = srcpal[*src].r;
  19.269 -				sG = srcpal[*src].g;
  19.270 -				sB = srcpal[*src].b;
  19.271 -				DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
  19.272 -				ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
  19.273 -			  	ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
  19.274 -			}
  19.275 -			src++;
  19.276 -			dst += dstbpp;
  19.277 -		},
  19.278 -		width);
  19.279 -		/* *INDENT-ON* */
  19.280 +        /* *INDENT-OFF* */
  19.281 +        DUFFS_LOOP(
  19.282 +        {
  19.283 +            if ( *src != ckey ) {
  19.284 +                sR = srcpal[*src].r;
  19.285 +                sG = srcpal[*src].g;
  19.286 +                sB = srcpal[*src].b;
  19.287 +                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
  19.288 +                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
  19.289 +                  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
  19.290 +            }
  19.291 +            src++;
  19.292 +            dst += dstbpp;
  19.293 +        },
  19.294 +        width);
  19.295 +        /* *INDENT-ON* */
  19.296          src += srcskip;
  19.297          dst += dstskip;
  19.298      }
    20.1 --- a/src/video/SDL_blit_A.c	Sat Aug 18 17:23:40 2018 -0400
    20.2 +++ b/src/video/SDL_blit_A.c	Mon Sep 24 11:49:25 2018 -0700
    20.3 @@ -45,28 +45,28 @@
    20.4      const unsigned A = info->a;
    20.5  
    20.6      while (height--) {
    20.7 -	    /* *INDENT-OFF* */
    20.8 -	    DUFFS_LOOP4(
    20.9 -	    {
   20.10 -		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
   20.11 -		dR = dstfmt->palette->colors[*dst].r;
   20.12 -		dG = dstfmt->palette->colors[*dst].g;
   20.13 -		dB = dstfmt->palette->colors[*dst].b;
   20.14 -		ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
   20.15 -		dR &= 0xff;
   20.16 -		dG &= 0xff;
   20.17 -		dB &= 0xff;
   20.18 -		/* Pack RGB into 8bit pixel */
   20.19 -		if ( palmap == NULL ) {
   20.20 -		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
   20.21 -		} else {
   20.22 -		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
   20.23 -		}
   20.24 -		dst++;
   20.25 -		src += srcbpp;
   20.26 -	    },
   20.27 -	    width);
   20.28 -	    /* *INDENT-ON* */
   20.29 +        /* *INDENT-OFF* */
   20.30 +        DUFFS_LOOP4(
   20.31 +        {
   20.32 +        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
   20.33 +        dR = dstfmt->palette->colors[*dst].r;
   20.34 +        dG = dstfmt->palette->colors[*dst].g;
   20.35 +        dB = dstfmt->palette->colors[*dst].b;
   20.36 +        ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
   20.37 +        dR &= 0xff;
   20.38 +        dG &= 0xff;
   20.39 +        dB &= 0xff;
   20.40 +        /* Pack RGB into 8bit pixel */
   20.41 +        if ( palmap == NULL ) {
   20.42 +            *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
   20.43 +        } else {
   20.44 +            *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
   20.45 +        }
   20.46 +        dst++;
   20.47 +        src += srcbpp;
   20.48 +        },
   20.49 +        width);
   20.50 +        /* *INDENT-ON* */
   20.51          src += srcskip;
   20.52          dst += dstskip;
   20.53      }
   20.54 @@ -91,28 +91,28 @@
   20.55      unsigned dR, dG, dB;
   20.56  
   20.57      while (height--) {
   20.58 -	    /* *INDENT-OFF* */
   20.59 -	    DUFFS_LOOP4(
   20.60 -	    {
   20.61 -		DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA);
   20.62 -		dR = dstfmt->palette->colors[*dst].r;
   20.63 -		dG = dstfmt->palette->colors[*dst].g;
   20.64 -		dB = dstfmt->palette->colors[*dst].b;
   20.65 -		ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB);
   20.66 -		dR &= 0xff;
   20.67 -		dG &= 0xff;
   20.68 -		dB &= 0xff;
   20.69 -		/* Pack RGB into 8bit pixel */
   20.70 -		if ( palmap == NULL ) {
   20.71 -		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
   20.72 -		} else {
   20.73 -		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
   20.74 -		}
   20.75 -		dst++;
   20.76 -		src += srcbpp;
   20.77 -	    },
   20.78 -	    width);
   20.79 -	    /* *INDENT-ON* */
   20.80 +        /* *INDENT-OFF* */
   20.81 +        DUFFS_LOOP4(
   20.82 +        {
   20.83 +        DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA);
   20.84 +        dR = dstfmt->palette->colors[*dst].r;
   20.85 +        dG = dstfmt->palette->colors[*dst].g;
   20.86 +        dB = dstfmt->palette->colors[*dst].b;
   20.87 +        ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB);
   20.88 +        dR &= 0xff;
   20.89 +        dG &= 0xff;
   20.90 +        dB &= 0xff;
   20.91 +        /* Pack RGB into 8bit pixel */
   20.92 +        if ( palmap == NULL ) {
   20.93 +            *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
   20.94 +        } else {
   20.95 +            *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
   20.96 +        }
   20.97 +        dst++;
   20.98 +        src += srcbpp;
   20.99 +        },
  20.100 +        width);
  20.101 +        /* *INDENT-ON* */
  20.102          src += srcskip;
  20.103          dst += dstskip;
  20.104      }
  20.105 @@ -139,30 +139,30 @@
  20.106      const unsigned A = info->a;
  20.107  
  20.108      while (height--) {
  20.109 -	    /* *INDENT-OFF* */
  20.110 -	    DUFFS_LOOP(
  20.111 -	    {
  20.112 -		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
  20.113 -		if ( Pixel != ckey ) {
  20.114 -		    dR = dstfmt->palette->colors[*dst].r;
  20.115 -		    dG = dstfmt->palette->colors[*dst].g;
  20.116 -		    dB = dstfmt->palette->colors[*dst].b;
  20.117 -		    ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
  20.118 -		    dR &= 0xff;
  20.119 -		    dG &= 0xff;
  20.120 -		    dB &= 0xff;
  20.121 -		    /* Pack RGB into 8bit pixel */
  20.122 -		    if ( palmap == NULL ) {
  20.123 +        /* *INDENT-OFF* */
  20.124 +        DUFFS_LOOP(
  20.125 +        {
  20.126 +        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
  20.127 +        if ( Pixel != ckey ) {
  20.128 +            dR = dstfmt->palette->colors[*dst].r;
  20.129 +            dG = dstfmt->palette->colors[*dst].g;
  20.130 +            dB = dstfmt->palette->colors[*dst].b;
  20.131 +            ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
  20.132 +            dR &= 0xff;
  20.133 +            dG &= 0xff;
  20.134 +            dB &= 0xff;
  20.135 +            /* Pack RGB into 8bit pixel */
  20.136 +            if ( palmap == NULL ) {
  20.137                  *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
  20.138 -		    } else {
  20.139 +            } else {
  20.140                  *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
  20.141 -		    }
  20.142 -		}
  20.143 -		dst++;
  20.144 -		src += srcbpp;
  20.145 -	    },
  20.146 -	    width);
  20.147 -	    /* *INDENT-ON* */
  20.148 +            }
  20.149 +        }
  20.150 +        dst++;
  20.151 +        src += srcbpp;
  20.152 +        },
  20.153 +        width);
  20.154 +        /* *INDENT-ON* */
  20.155          src += srcskip;
  20.156          dst += dstskip;
  20.157      }
  20.158 @@ -342,45 +342,45 @@
  20.159  
  20.160      mm_zero = _mm_setzero_si64();       /* 0 -> mm_zero */
  20.161      multmask = 0x00FF;
  20.162 -	multmask <<= (ashift * 2);
  20.163 -	multmask2 = 0x00FF00FF00FF00FFULL;
  20.164 +    multmask <<= (ashift * 2);
  20.165 +    multmask2 = 0x00FF00FF00FF00FFULL;
  20.166  
  20.167      while (height--) {
  20.168 -		/* *INDENT-OFF* */
  20.169 -		DUFFS_LOOP4({
  20.170 -		Uint32 alpha = *srcp & amask;
  20.171 -		if (alpha == 0) {
  20.172 -			/* do nothing */
  20.173 -		} else if (alpha == amask) {
  20.174 -			*dstp = *srcp;
  20.175 -		} else {
  20.176 -			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
  20.177 -			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
  20.178 +        /* *INDENT-OFF* */
  20.179 +        DUFFS_LOOP4({
  20.180 +        Uint32 alpha = *srcp & amask;
  20.181 +        if (alpha == 0) {
  20.182 +            /* do nothing */
  20.183 +        } else if (alpha == amask) {
  20.184 +            *dstp = *srcp;
  20.185 +        } else {
  20.186 +            src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
  20.187 +            src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
  20.188  
  20.189 -			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
  20.190 -			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
  20.191 +            dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
  20.192 +            dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
  20.193  
  20.194 -			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
  20.195 -			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
  20.196 -			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
  20.197 -			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
  20.198 -			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
  20.199 -			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
  20.200 +            mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
  20.201 +            mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
  20.202 +            mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
  20.203 +            mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
  20.204 +            mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);    /* 0F0A0A0A -> mm_alpha */
  20.205 +            mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);    /* 255 - mm_alpha -> mm_alpha */
  20.206  
  20.207 -			/* blend */		    
  20.208 -			src1 = _mm_mullo_pi16(src1, mm_alpha);
  20.209 -			src1 = _mm_srli_pi16(src1, 8);
  20.210 -			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
  20.211 -			dst1 = _mm_srli_pi16(dst1, 8);
  20.212 -			dst1 = _mm_add_pi16(src1, dst1);
  20.213 -			dst1 = _mm_packs_pu16(dst1, mm_zero);
  20.214 -			
  20.215 -			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
  20.216 -		}
  20.217 -		++srcp;
  20.218 -		++dstp;
  20.219 -	    }, width);
  20.220 -		/* *INDENT-ON* */
  20.221 +            /* blend */            
  20.222 +            src1 = _mm_mullo_pi16(src1, mm_alpha);
  20.223 +            src1 = _mm_srli_pi16(src1, 8);
  20.224 +            dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
  20.225 +            dst1 = _mm_srli_pi16(dst1, 8);
  20.226 +            dst1 = _mm_add_pi16(src1, dst1);
  20.227 +            dst1 = _mm_packs_pu16(dst1, mm_zero);
  20.228 +            
  20.229 +            *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
  20.230 +        }
  20.231 +        ++srcp;
  20.232 +        ++dstp;
  20.233 +        }, width);
  20.234 +        /* *INDENT-ON* */
  20.235          srcp += srcskip;
  20.236          dstp += dstskip;
  20.237      }
  20.238 @@ -401,14 +401,14 @@
  20.239      int dstskip = info->dst_skip >> 2;
  20.240  
  20.241      while (height--) {
  20.242 -	    /* *INDENT-OFF* */
  20.243 -	    DUFFS_LOOP4({
  20.244 -		    Uint32 s = *srcp++;
  20.245 -		    Uint32 d = *dstp;
  20.246 -		    *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
  20.247 -			       + (s & d & 0x00010101)) | 0xff000000;
  20.248 -	    }, width);
  20.249 -	    /* *INDENT-ON* */
  20.250 +        /* *INDENT-OFF* */
  20.251 +        DUFFS_LOOP4({
  20.252 +            Uint32 s = *srcp++;
  20.253 +            Uint32 d = *dstp;
  20.254 +            *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
  20.255 +                   + (s & d & 0x00010101)) | 0xff000000;
  20.256 +        }, width);
  20.257 +        /* *INDENT-ON* */
  20.258          srcp += srcskip;
  20.259          dstp += dstskip;
  20.260      }
  20.261 @@ -434,22 +434,22 @@
  20.262          Uint32 d1;
  20.263  
  20.264          while (height--) {
  20.265 -			/* *INDENT-OFF* */
  20.266 -			DUFFS_LOOP4({
  20.267 -				s = *srcp;
  20.268 -				d = *dstp;
  20.269 -				s1 = s & 0xff00ff;
  20.270 -				d1 = d & 0xff00ff;
  20.271 -				d1 = (d1 + ((s1 - d1) * alpha >> 8))
  20.272 -				     & 0xff00ff;
  20.273 -				s &= 0xff00;
  20.274 -				d &= 0xff00;
  20.275 -				d = (d + ((s - d) * alpha >> 8)) & 0xff00;
  20.276 -				*dstp = d1 | d | 0xff000000;
  20.277 -				++srcp;
  20.278 -				++dstp;
  20.279 -			}, width);
  20.280 -			/* *INDENT-ON* */
  20.281 +            /* *INDENT-OFF* */
  20.282 +            DUFFS_LOOP4({
  20.283 +                s = *srcp;
  20.284 +                d = *dstp;
  20.285 +                s1 = s & 0xff00ff;
  20.286 +                d1 = d & 0xff00ff;
  20.287 +                d1 = (d1 + ((s1 - d1) * alpha >> 8))
  20.288 +                     & 0xff00ff;
  20.289 +                s &= 0xff00;
  20.290 +                d &= 0xff00;
  20.291 +                d = (d + ((s - d) * alpha >> 8)) & 0xff00;
  20.292 +                *dstp = d1 | d | 0xff000000;
  20.293 +                ++srcp;
  20.294 +                ++dstp;
  20.295 +            }, width);
  20.296 +            /* *INDENT-ON* */
  20.297              srcp += srcskip;
  20.298              dstp += dstskip;
  20.299          }
  20.300 @@ -468,42 +468,42 @@
  20.301      int dstskip = info->dst_skip >> 2;
  20.302  
  20.303      while (height--) {
  20.304 -	    /* *INDENT-OFF* */
  20.305 -	    DUFFS_LOOP4({
  20.306 -		Uint32 dalpha;
  20.307 -		Uint32 d;
  20.308 -		Uint32 s1;
  20.309 -		Uint32 d1;
  20.310 -		Uint32 s = *srcp;
  20.311 -		Uint32 alpha = s >> 24;
  20.312 -		/* FIXME: Here we special-case opaque alpha since the
  20.313 -		   compositioning used (>>8 instead of /255) doesn't handle
  20.314 -		   it correctly. Also special-case alpha=0 for speed?
  20.315 -		   Benchmark this! */
  20.316 -		if (alpha) {
  20.317 -		  if (alpha == SDL_ALPHA_OPAQUE) {
  20.318 -			  *dstp = *srcp;
  20.319 -		  } else {
  20.320 -		    /*
  20.321 -		     * take out the middle component (green), and process
  20.322 -		     * the other two in parallel. One multiply less.
  20.323 -		     */
  20.324 -		    d = *dstp;
  20.325 -			dalpha = d >> 24;
  20.326 -		    s1 = s & 0xff00ff;
  20.327 -		    d1 = d & 0xff00ff;
  20.328 -		    d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
  20.329 -		    s &= 0xff00;
  20.330 -		    d &= 0xff00;
  20.331 -		    d = (d + ((s - d) * alpha >> 8)) & 0xff00;
  20.332 -			dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8);
  20.333 -		    *dstp = d1 | d | (dalpha << 24);
  20.334 -		  }
  20.335 -		}
  20.336 -		++srcp;
  20.337 -		++dstp;
  20.338 -	    }, width);
  20.339 -	    /* *INDENT-ON* */
  20.340 +        /* *INDENT-OFF* */
  20.341 +        DUFFS_LOOP4({
  20.342 +        Uint32 dalpha;
  20.343 +        Uint32 d;
  20.344 +        Uint32 s1;
  20.345 +        Uint32 d1;
  20.346 +        Uint32 s = *srcp;
  20.347 +        Uint32 alpha = s >> 24;
  20.348 +        /* FIXME: Here we special-case opaque alpha since the
  20.349 +           compositioning used (>>8 instead of /255) doesn't handle
  20.350 +           it correctly. Also special-case alpha=0 for speed?
  20.351 +           Benchmark this! */
  20.352 +        if (alpha) {
  20.353 +          if (alpha == SDL_ALPHA_OPAQUE) {
  20.354 +              *dstp = *srcp;
  20.355 +          } else {
  20.356 +            /*
  20.357 +             * take out the middle component (green), and process
  20.358 +             * the other two in parallel. One multiply less.
  20.359 +             */
  20.360 +            d = *dstp;
  20.361 +            dalpha = d >> 24;
  20.362 +            s1 = s & 0xff00ff;
  20.363 +            d1 = d & 0xff00ff;
  20.364 +            d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
  20.365 +            s &= 0xff00;
  20.366 +            d &= 0xff00;
  20.367 +            d = (d + ((s - d) * alpha >> 8)) & 0xff00;
  20.368 +            dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8);
  20.369 +            *dstp = d1 | d | (dalpha << 24);
  20.370 +          }
  20.371 +        }
  20.372 +        ++srcp;
  20.373 +        ++dstp;
  20.374 +        }, width);
  20.375 +        /* *INDENT-ON* */
  20.376          srcp += srcskip;
  20.377          dstp += dstskip;
  20.378      }
  20.379 @@ -533,47 +533,47 @@
  20.380      multmask2 = 0x00FF00FF00FF00FFULL;
  20.381  
  20.382      while (height--) {
  20.383 -	    /* *INDENT-OFF* */
  20.384 -	    DUFFS_LOOP4({
  20.385 -		Uint32 alpha;
  20.386 +        /* *INDENT-OFF* */
  20.387 +        DUFFS_LOOP4({
  20.388 +        Uint32 alpha;
  20.389  
  20.390 -		_m_prefetch(srcp + 16);
  20.391 -		_m_prefetch(dstp + 16);
  20.392 +        _m_prefetch(srcp + 16);
  20.393 +        _m_prefetch(dstp + 16);
  20.394  
  20.395 -		alpha = *srcp & amask;
  20.396 -		if (alpha == 0) {
  20.397 -			/* do nothing */
  20.398 -		} else if (alpha == amask) {
  20.399 -			*dstp = *srcp;
  20.400 -		} else {
  20.401 -			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
  20.402 -			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
  20.403 +        alpha = *srcp & amask;
  20.404 +        if (alpha == 0) {
  20.405 +            /* do nothing */
  20.406 +        } else if (alpha == amask) {
  20.407 +            *dstp = *srcp;
  20.408 +        } else {
  20.409 +            src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
  20.410 +            src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
  20.411  
  20.412 -			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
  20.413 -			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
  20.414 +            dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
  20.415 +            dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
  20.416  
  20.417 -			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
  20.418 -			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
  20.419 -			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
  20.420 -			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
  20.421 -			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
  20.422 -			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
  20.423 +            mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
  20.424 +            mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
  20.425 +            mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
  20.426 +            mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
  20.427 +            mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);    /* 0F0A0A0A -> mm_alpha */
  20.428 +            mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);    /* 255 - mm_alpha -> mm_alpha */
  20.429  
  20.430  
  20.431 -			/* blend */		    
  20.432 -			src1 = _mm_mullo_pi16(src1, mm_alpha);
  20.433 -			src1 = _mm_srli_pi16(src1, 8);
  20.434 -			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
  20.435 -			dst1 = _mm_srli_pi16(dst1, 8);
  20.436 -			dst1 = _mm_add_pi16(src1, dst1);
  20.437 -			dst1 = _mm_packs_pu16(dst1, mm_zero);
  20.438 -			
  20.439 -			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
  20.440 -		}
  20.441 -		++srcp;
  20.442 -		++dstp;
  20.443 -	    }, width);
  20.444 -	    /* *INDENT-ON* */
  20.445 +            /* blend */            
  20.446 +            src1 = _mm_mullo_pi16(src1, mm_alpha);
  20.447 +            src1 = _mm_srli_pi16(src1, 8);
  20.448 +            dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
  20.449 +            dst1 = _mm_srli_pi16(dst1, 8);
  20.450 +            dst1 = _mm_add_pi16(src1, dst1);
  20.451 +            dst1 = _mm_packs_pu16(dst1, mm_zero);
  20.452 +            
  20.453 +            *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
  20.454 +        }
  20.455 +        ++srcp;
  20.456 +        ++dstp;
  20.457 +        }, width);
  20.458 +        /* *INDENT-ON* */
  20.459          srcp += srcskip;
  20.460          dstp += dstskip;
  20.461      }
  20.462 @@ -585,13 +585,13 @@
  20.463  /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
  20.464  
  20.465  /* blend a single 16 bit pixel at 50% */
  20.466 -#define BLEND16_50(d, s, mask)						\
  20.467 -	((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
  20.468 +#define BLEND16_50(d, s, mask)                        \
  20.469 +    ((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
  20.470  
  20.471  /* blend two 16 bit pixels at 50% */
  20.472 -#define BLEND2x16_50(d, s, mask)					     \
  20.473 -	(((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
  20.474 -	 + (s & d & (~(mask | mask << 16))))
  20.475 +#define BLEND2x16_50(d, s, mask)                         \
  20.476 +    (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
  20.477 +     + (s & d & (~(mask | mask << 16))))
  20.478  
  20.479  static void
  20.480  Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask)
  20.481 @@ -727,103 +727,103 @@
  20.482          bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
  20.483  
  20.484          while (height--) {
  20.485 -			/* *INDENT-OFF* */
  20.486 -			DUFFS_LOOP_124(
  20.487 -			{
  20.488 -				s = *srcp++;
  20.489 -				d = *dstp;
  20.490 -				/*
  20.491 -				 * shift out the middle component (green) to
  20.492 -				 * the high 16 bits, and process all three RGB
  20.493 -				 * components at the same time.
  20.494 -				 */
  20.495 -				s = (s | s << 16) & 0x07e0f81f;
  20.496 -				d = (d | d << 16) & 0x07e0f81f;
  20.497 -				d += (s - d) * alpha >> 5;
  20.498 -				d &= 0x07e0f81f;
  20.499 -				*dstp++ = (Uint16)(d | d >> 16);
  20.500 -			},{
  20.501 -				s = *srcp++;
  20.502 -				d = *dstp;
  20.503 -				/*
  20.504 -				 * shift out the middle component (green) to
  20.505 -				 * the high 16 bits, and process all three RGB
  20.506 -				 * components at the same time.
  20.507 -				 */
  20.508 -				s = (s | s << 16) & 0x07e0f81f;
  20.509 -				d = (d | d << 16) & 0x07e0f81f;
  20.510 -				d += (s - d) * alpha >> 5;
  20.511 -				d &= 0x07e0f81f;
  20.512 -				*dstp++ = (Uint16)(d | d >> 16);
  20.513 -				s = *srcp++;
  20.514 -				d = *dstp;
  20.515 -				/*
  20.516 -				 * shift out the middle component (green) to
  20.517 -				 * the high 16 bits, and process all three RGB
  20.518 -				 * components at the same time.
  20.519 -				 */
  20.520 -				s = (s | s << 16) & 0x07e0f81f;
  20.521 -				d = (d | d << 16) & 0x07e0f81f;
  20.522 -				d += (s - d) * alpha >> 5;
  20.523 -				d &= 0x07e0f81f;
  20.524 -				*dstp++ = (Uint16)(d | d >> 16);
  20.525 -			},{
  20.526 -				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
  20.527 -				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
  20.528 +            /* *INDENT-OFF* */
  20.529 +            DUFFS_LOOP_124(
  20.530 +            {
  20.531 +                s = *srcp++;
  20.532 +                d = *dstp;
  20.533 +                /*
  20.534 +                 * shift out the middle component (green) to
  20.535 +                 * the high 16 bits, and process all three RGB
  20.536 +                 * components at the same time.
  20.537 +                 */
  20.538 +                s = (s | s << 16) & 0x07e0f81f;
  20.539 +                d = (d | d << 16) & 0x07e0f81f;
  20.540 +                d += (s - d) * alpha >> 5;
  20.541 +                d &= 0x07e0f81f;
  20.542 +                *dstp++ = (Uint16)(d | d >> 16);
  20.543 +            },{
  20.544 +                s = *srcp++;
  20.545 +                d = *dstp;
  20.546 +                /*
  20.547 +                 * shift out the middle component (green) to
  20.548 +                 * the high 16 bits, and process all three RGB
  20.549 +                 * components at the same time.
  20.550 +                 */
  20.551 +                s = (s | s << 16) & 0x07e0f81f;
  20.552 +                d = (d | d << 16) & 0x07e0f81f;
  20.553 +                d += (s - d) * alpha >> 5;
  20.554 +                d &= 0x07e0f81f;
  20.555 +                *dstp++ = (Uint16)(d | d >> 16);
  20.556 +                s = *srcp++;
  20.557 +                d = *dstp;
  20.558 +                /*
  20.559 +                 * shift out the middle component (green) to
  20.560 +                 * the high 16 bits, and process all three RGB
  20.561 +                 * components at the same time.
  20.562 +                 */
  20.563 +                s = (s | s << 16) & 0x07e0f81f;
  20.564 +                d = (d | d << 16) & 0x07e0f81f;
  20.565 +                d += (s - d) * alpha >> 5;
  20.566 +                d &= 0x07e0f81f;
  20.567 +                *dstp++ = (Uint16)(d | d >> 16);
  20.568 +            },{
  20.569 +                src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
  20.570 +                dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
  20.571  
  20.572 -				/* red */
  20.573 -				src2 = src1;
  20.574 -				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
  20.575 +                /* red */
  20.576 +                src2 = src1;
  20.577 +                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
  20.578  
  20.579 -				dst2 = dst1;
  20.580 -				dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
  20.581 +                dst2 = dst1;
  20.582 +                dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
  20.583  
  20.584 -				/* blend */
  20.585 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.586 -				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.587 -				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.588 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.589 -				dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
  20.590 +                /* blend */
  20.591 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.592 +                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.593 +                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.594 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.595 +                dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
  20.596  
  20.597 -				mm_res = dst2; /* RED -> mm_res */
  20.598 +                mm_res = dst2; /* RED -> mm_res */
  20.599  
  20.600 -				/* green -- process the bits in place */
  20.601 -				src2 = src1;
  20.602 -				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
  20.603 +                /* green -- process the bits in place */
  20.604 +                src2 = src1;
  20.605 +                src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
  20.606  
  20.607 -				dst2 = dst1;
  20.608 -				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
  20.609 +                dst2 = dst1;
  20.610 +                dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
  20.611  
  20.612 -				/* blend */
  20.613 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.614 -				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.615 -				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.616 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.617 +                /* blend */
  20.618 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.619 +                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.620 +                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.621 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.622  
  20.623 -				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
  20.624 +                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
  20.625  
  20.626 -				/* blue */
  20.627 -				src2 = src1;
  20.628 -				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
  20.629 +                /* blue */
  20.630 +                src2 = src1;
  20.631 +                src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
  20.632  
  20.633 -				dst2 = dst1;
  20.634 -				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
  20.635 +                dst2 = dst1;
  20.636 +                dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
  20.637  
  20.638 -				/* blend */
  20.639 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.640 -				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.641 -				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.642 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.643 -				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
  20.644 +                /* blend */
  20.645 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.646 +                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.647 +                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.648 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.649 +                dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
  20.650  
  20.651 -				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
  20.652 +                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
  20.653  
  20.654 -				*(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
  20.655 +                *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
  20.656  
  20.657 -				srcp += 4;
  20.658 -				dstp += 4;
  20.659 -			}, width);
  20.660 -			/* *INDENT-ON* */
  20.661 +                srcp += 4;
  20.662 +                dstp += 4;
  20.663 +            }, width);
  20.664 +            /* *INDENT-ON* */
  20.665              srcp += srcskip;
  20.666              dstp += dstskip;
  20.667          }
  20.668 @@ -865,103 +865,103 @@
  20.669          bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
  20.670  
  20.671          while (height--) {
  20.672 -			/* *INDENT-OFF* */
  20.673 -			DUFFS_LOOP_124(
  20.674 -			{
  20.675 -				s = *srcp++;
  20.676 -				d = *dstp;
  20.677 -				/*
  20.678 -				 * shift out the middle component (green) to
  20.679 -				 * the high 16 bits, and process all three RGB
  20.680 -				 * components at the same time.
  20.681 -				 */
  20.682 -				s = (s | s << 16) & 0x03e07c1f;
  20.683 -				d = (d | d << 16) & 0x03e07c1f;
  20.684 -				d += (s - d) * alpha >> 5;
  20.685 -				d &= 0x03e07c1f;
  20.686 -				*dstp++ = (Uint16)(d | d >> 16);
  20.687 -			},{
  20.688 -				s = *srcp++;
  20.689 -				d = *dstp;
  20.690 -				/*
  20.691 -				 * shift out the middle component (green) to
  20.692 -				 * the high 16 bits, and process all three RGB
  20.693 -				 * components at the same time.
  20.694 -				 */
  20.695 -				s = (s | s << 16) & 0x03e07c1f;
  20.696 -				d = (d | d << 16) & 0x03e07c1f;
  20.697 -				d += (s - d) * alpha >> 5;
  20.698 -				d &= 0x03e07c1f;
  20.699 -				*dstp++ = (Uint16)(d | d >> 16);
  20.700 -			        s = *srcp++;
  20.701 -				d = *dstp;
  20.702 -				/*
  20.703 -				 * shift out the middle component (green) to
  20.704 -				 * the high 16 bits, and process all three RGB
  20.705 -				 * components at the same time.
  20.706 -				 */
  20.707 -				s = (s | s << 16) & 0x03e07c1f;
  20.708 -				d = (d | d << 16) & 0x03e07c1f;
  20.709 -				d += (s - d) * alpha >> 5;
  20.710 -				d &= 0x03e07c1f;
  20.711 -				*dstp++ = (Uint16)(d | d >> 16);
  20.712 -			},{
  20.713 -				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
  20.714 -				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
  20.715 +            /* *INDENT-OFF* */
  20.716 +            DUFFS_LOOP_124(
  20.717 +            {
  20.718 +                s = *srcp++;
  20.719 +                d = *dstp;
  20.720 +                /*
  20.721 +                 * shift out the middle component (green) to
  20.722 +                 * the high 16 bits, and process all three RGB
  20.723 +                 * components at the same time.
  20.724 +                 */
  20.725 +                s = (s | s << 16) & 0x03e07c1f;
  20.726 +                d = (d | d << 16) & 0x03e07c1f;
  20.727 +                d += (s - d) * alpha >> 5;
  20.728 +                d &= 0x03e07c1f;
  20.729 +                *dstp++ = (Uint16)(d | d >> 16);
  20.730 +            },{
  20.731 +                s = *srcp++;
  20.732 +                d = *dstp;
  20.733 +                /*
  20.734 +                 * shift out the middle component (green) to
  20.735 +                 * the high 16 bits, and process all three RGB
  20.736 +                 * components at the same time.
  20.737 +                 */
  20.738 +                s = (s | s << 16) & 0x03e07c1f;
  20.739 +                d = (d | d << 16) & 0x03e07c1f;
  20.740 +                d += (s - d) * alpha >> 5;
  20.741 +                d &= 0x03e07c1f;
  20.742 +                *dstp++ = (Uint16)(d | d >> 16);
  20.743 +                    s = *srcp++;
  20.744 +                d = *dstp;
  20.745 +                /*
  20.746 +                 * shift out the middle component (green) to
  20.747 +                 * the high 16 bits, and process all three RGB
  20.748 +                 * components at the same time.
  20.749 +                 */
  20.750 +                s = (s | s << 16) & 0x03e07c1f;
  20.751 +                d = (d | d << 16) & 0x03e07c1f;
  20.752 +                d += (s - d) * alpha >> 5;
  20.753 +                d &= 0x03e07c1f;
  20.754 +                *dstp++ = (Uint16)(d | d >> 16);
  20.755 +            },{
  20.756 +                src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
  20.757 +                dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
  20.758  
  20.759 -				/* red -- process the bits in place */
  20.760 -				src2 = src1;
  20.761 -				src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
  20.762 +                /* red -- process the bits in place */
  20.763 +                src2 = src1;
  20.764 +                src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
  20.765  
  20.766 -				dst2 = dst1;
  20.767 -				dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
  20.768 +                dst2 = dst1;
  20.769 +                dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
  20.770  
  20.771 -				/* blend */
  20.772 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.773 -				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.774 -				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.775 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.776 -				dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
  20.777 +                /* blend */
  20.778 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.779 +                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.780 +                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.781 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.782 +                dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
  20.783  
  20.784 -				mm_res = dst2; /* RED -> mm_res */
  20.785 -				
  20.786 -				/* green -- process the bits in place */
  20.787 -				src2 = src1;
  20.788 -				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
  20.789 +                mm_res = dst2; /* RED -> mm_res */
  20.790 +                
  20.791 +                /* green -- process the bits in place */
  20.792 +                src2 = src1;
  20.793 +                src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
  20.794  
  20.795 -				dst2 = dst1;
  20.796 -				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
  20.797 +                dst2 = dst1;
  20.798 +                dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
  20.799  
  20.800 -				/* blend */
  20.801 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.802 -				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.803 -				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.804 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.805 +                /* blend */
  20.806 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.807 +                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.808 +                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
  20.809 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.810  
  20.811 -				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
  20.812 +                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
  20.813  
  20.814 -				/* blue */
  20.815 -				src2 = src1; /* src -> src2 */
  20.816 -				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
  20.817 +                /* blue */
  20.818 +                src2 = src1; /* src -> src2 */
  20.819 +                src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
  20.820  
  20.821 -				dst2 = dst1; /* dst -> dst2 */
  20.822 -				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
  20.823 +                dst2 = dst1; /* dst -> dst2 */
  20.824 +                dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
  20.825  
  20.826 -				/* blend */
  20.827 -				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.828 -				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.829 -				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.830 -				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.831 -				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
  20.832 +                /* blend */
  20.833 +                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
  20.834 +                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
  20.835 +                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
  20.836 +                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
  20.837 +                dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
  20.838  
  20.839 -				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
  20.840 +                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
  20.841  
  20.842 -				*(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
  20.843 +                *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
  20.844  
  20.845 -				srcp += 4;
  20.846 -				dstp += 4;
  20.847 -			}, width);
  20.848 -			/* *INDENT-ON* */
  20.849 +                srcp += 4;
  20.850 +                dstp += 4;
  20.851 +            }, width);
  20.852 +            /* *INDENT-ON* */
  20.853              srcp += srcskip;
  20.854              dstp += dstskip;
  20.855          }
  20.856 @@ -988,22 +988,22 @@
  20.857          alpha >>= 3;            /* downscale alpha to 5 bits */
  20.858  
  20.859          while (height--) {
  20.860 -			/* *INDENT-OFF* */
  20.861 -			DUFFS_LOOP4({
  20.862 -				Uint32 s = *srcp++;
  20.863 -				Uint32 d = *dstp;
  20.864 -				/*
  20.865 -				 * shift out the middle component (green) to
  20.866 -				 * the high 16 bits, and process all three RGB
  20.867 -				 * components at the same time.
  20.868 -				 */
  20.869 -				s = (s | s << 16) & 0x07e0f81f;
  20.870 -				d = (d | d << 16) & 0x07e0f81f;
  20.871 -				d += (s - d) * alpha >> 5;
  20.872 -				d &= 0x07e0f81f;
  20.873 -				*dstp++ = (Uint16)(d | d >> 16);
  20.874 -			}, width);
  20.875 -			/* *INDENT-ON* */
  20.876 +            /* *INDENT-OFF* */
  20.877 +            DUFFS_LOOP4({
  20.878 +                Uint32 s = *srcp++;
  20.879 +                Uint32 d = *dstp;
  20.880 +                /*
  20.881 +                 * shift out the middle component (green) to
  20.882 +                 * the high 16 bits, and process all three RGB
  20.883 +                 * components at the same time.
  20.884 +                 */
  20.885 +                s = (s | s << 16) & 0x07e0f81f;
  20.886 +                d = (d | d << 16) & 0x07e0f81f;
  20.887 +                d += (s - d) * alpha >> 5;
  20.888 +                d &= 0x07e0f81f;
  20.889 +                *dstp++ = (Uint16)(d | d >> 16);
  20.890 +            }, width);
  20.891 +            /* *INDENT-ON* */
  20.892              srcp += srcskip;
  20.893              dstp += dstskip;
  20.894          }
  20.895 @@ -1027,22 +1027,22 @@
  20.896          alpha >>= 3;            /* downscale alpha to 5 bits */
  20.897  
  20.898          while (height--) {
  20.899 -			/* *INDENT-OFF* */
  20.900 -			DUFFS_LOOP4({
  20.901 -				Uint32 s = *srcp++;
  20.902 -				Uint32 d = *dstp;
  20.903 -				/*
  20.904 -				 * shift out the middle component (green) to
  20.905 -				 * the high 16 bits, and process all three RGB
  20.906 -				 * components at the same time.
  20.907 -				 */
  20.908 -				s = (s | s << 16) & 0x03e07c1f;
  20.909 -				d = (d | d << 16) & 0x03e07c1f;
  20.910 -				d += (s - d) * alpha >> 5;
  20.911 -				d &= 0x03e07c1f;
  20.912 -				*dstp++ = (Uint16)(d | d >> 16);
  20.913 -			}, width);
  20.914 -			/* *INDENT-ON* */
  20.915 +            /* *INDENT-OFF* */
  20.916 +            DUFFS_LOOP4({
  20.917 +                Uint32 s = *srcp++;
  20.918 +                Uint32 d = *dstp;
  20.919 +                /*
  20.920 +                 * shift out the middle component (green) to
  20.921 +                 * the high 16 bits, and process all three RGB
  20.922 +                 * components at the same time.
  20.923 +                 */
  20.924 +                s = (s | s << 16) & 0x03e07c1f;
  20.925 +                d = (d | d << 16) & 0x03e07c1f;
  20.926 +                d += (s - d) * alpha >> 5;
  20.927 +                d &= 0x03e07c1f;
  20.928 +                *dstp++ = (Uint16)(d | d >> 16);
  20.929 +            }, width);
  20.930 +            /* *INDENT-ON* */
  20.931              srcp += srcskip;
  20.932              dstp += dstskip;
  20.933          }
  20.934 @@ -1061,35 +1061,35 @@
  20.935      int dstskip = info->dst_skip >> 1;
  20.936  
  20.937      while (height--) {
  20.938 -	    /* *INDENT-OFF* */
  20.939 -	    DUFFS_LOOP4({
  20.940 -		Uint32 s = *srcp;
  20.941 -		unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
  20.942 -		/* FIXME: Here we special-case opaque alpha since the
  20.943 -		   compositioning used (>>8 instead of /255) doesn't handle
  20.944 -		   it correctly. Also special-case alpha=0 for speed?
  20.945 -		   Benchmark this! */
  20.946 -		if(alpha) {   
  20.947 -		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
  20.948 -		    *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
  20.949 -		  } else {
  20.950 -		    Uint32 d = *dstp;
  20.951 -		    /*
  20.952 -		     * convert source and destination to G0RAB65565
  20.953 -		     * and blend all components at the same time
  20.954 -		     */
  20.955 -		    s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
  20.956 -		      + (s >> 3 & 0x1f);
  20.957 -		    d = (d | d << 16) & 0x07e0f81f;
  20.958 -		    d += (s - d) * alpha >> 5;
  20.959 -		    d &= 0x07e0f81f;
  20.960 -		    *dstp = (Uint16)(d | d >> 16);
  20.961 -		  }
  20.962 -		}
  20.963 -		srcp++;
  20.964 -		dstp++;
  20.965 -	    }, width);
  20.966 -	    /* *INDENT-ON* */
  20.967 +        /* *INDENT-OFF* */
  20.968 +        DUFFS_LOOP4({
  20.969 +        Uint32 s = *srcp;
  20.970 +        unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
  20.971 +        /* FIXME: Here we special-case opaque alpha since the
  20.972 +           compositioning used (>>8 instead of /255) doesn't handle
  20.973 +           it correctly. Also special-case alpha=0 for speed?
  20.974 +           Benchmark this! */
  20.975 +        if(alpha) {   
  20.976 +          if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
  20.977 +            *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
  20.978 +          } else {
  20.979 +            Uint32 d = *dstp;
  20.980 +            /*
  20.981 +             * convert source and destination to G0RAB65565
  20.982 +             * and blend all components at the same time
  20.983 +             */
  20.984 +            s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
  20.985 +              + (s >> 3 & 0x1f);
  20.986 +            d = (d | d << 16) & 0x07e0f81f;
  20.987 +            d += (s - d) * alpha >> 5;
  20.988 +            d &= 0x07e0f81f;
  20.989 +            *dstp = (Uint16)(d | d >> 16);
  20.990 +          }
  20.991 +        }
  20.992 +        srcp++;
  20.993 +        dstp++;
  20.994 +        }, width);
  20.995 +        /* *INDENT-ON* */
  20.996          srcp += srcskip;
  20.997          dstp += dstskip;
  20.998      }
  20.999 @@ -1107,36 +1107,36 @@
 20.1000      int dstskip = info->dst_skip >> 1;
 20.1001  
 20.1002      while (height--) {
 20.1003 -	    /* *INDENT-OFF* */
 20.1004 -	    DUFFS_LOOP4({
 20.1005 -		unsigned alpha;
 20.1006 -		Uint32 s = *srcp;
 20.1007 -		alpha = s >> 27; /* downscale alpha to 5 bits */
 20.1008 -		/* FIXME: Here we special-case opaque alpha since the
 20.1009 -		   compositioning used (>>8 instead of /255) doesn't handle
 20.1010 -		   it correctly. Also special-case alpha=0 for speed?
 20.1011 -		   Benchmark this! */
 20.1012 -		if(alpha) {   
 20.1013 -		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
 20.1014 -		    *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
 20.1015 -		  } else {
 20.1016 -		    Uint32 d = *dstp;
 20.1017 -		    /*
 20.1018 -		     * convert source and destination to G0RAB65565
 20.1019 -		     * and blend all components at the same time
 20.1020 -		     */
 20.1021 -		    s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
 20.1022 -		      + (s >> 3 & 0x1f);
 20.1023 -		    d = (d | d << 16) & 0x03e07c1f;
 20.1024 -		    d += (s - d) * alpha >> 5;
 20.1025 -		    d &= 0x03e07c1f;
 20.1026 -		    *dstp = (Uint16)(d | d >> 16);
 20.1027 -		  }
 20.1028 -		}
 20.1029 -		srcp++;
 20.1030 -		dstp++;
 20.1031 -	    }, width);
 20.1032 -	    /* *INDENT-ON* */
 20.1033 +        /* *INDENT-OFF* */
 20.1034 +        DUFFS_LOOP4({
 20.1035 +        unsigned alpha;
 20.1036 +        Uint32 s = *srcp;
 20.1037 +        alpha = s >> 27; /* downscale alpha to 5 bits */
 20.1038 +        /* FIXME: Here we special-case opaque alpha since the
 20.1039 +           compositioning used (>>8 instead of /255) doesn't handle
 20.1040 +           it correctly. Also special-case alpha=0 for speed?
 20.1041 +           Benchmark this! */
 20.1042 +        if(alpha) {   
 20.1043 +          if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
 20.1044 +            *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
 20.1045 +          } else {
 20.1046 +            Uint32 d = *dstp;
 20.1047 +            /*
 20.1048 +             * convert source and destination to G0RAB65565
 20.1049 +             * and blend all components at the same time
 20.1050 +             */
 20.1051 +            s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
 20.1052 +              + (s >> 3 & 0x1f);
 20.1053 +            d = (d | d << 16) & 0x03e07c1f;
 20.1054 +            d += (s - d) * alpha >> 5;
 20.1055 +            d &= 0x03e07c1f;
 20.1056 +            *dstp = (Uint16)(d | d >> 16);
 20.1057 +          }
 20.1058 +        }
 20.1059 +        srcp++;
 20.1060 +        dstp++;
 20.1061 +        }, width);
 20.1062 +        /* *INDENT-ON* */
 20.1063          srcp += srcskip;
 20.1064          dstp += dstskip;
 20.1065      }
 20.1066 @@ -1163,18 +1163,18 @@
 20.1067  
 20.1068      if (sA) {
 20.1069          while (height--) {
 20.1070 -	    /* *INDENT-OFF* */
 20.1071 -	    DUFFS_LOOP4(
 20.1072 -	    {
 20.1073 -		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
 20.1074 -		DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1075 -		ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1076 -		ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1077 -		src += srcbpp;
 20.1078 -		dst += dstbpp;
 20.1079 -	    },
 20.1080 -	    width);
 20.1081 -	    /* *INDENT-ON* */
 20.1082 +        /* *INDENT-OFF* */
 20.1083 +        DUFFS_LOOP4(
 20.1084 +        {
 20.1085 +        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
 20.1086 +        DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1087 +        ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1088 +        ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1089 +        src += srcbpp;
 20.1090 +        dst += dstbpp;
 20.1091 +        },
 20.1092 +        width);
 20.1093 +        /* *INDENT-ON* */
 20.1094              src += srcskip;
 20.1095              dst += dstskip;
 20.1096          }
 20.1097 @@ -1202,21 +1202,21 @@
 20.1098      const unsigned sA = info->a;
 20.1099  
 20.1100      while (height--) {
 20.1101 -	    /* *INDENT-OFF* */
 20.1102 -	    DUFFS_LOOP4(
 20.1103 -	    {
 20.1104 -		RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
 20.1105 -		if(sA && Pixel != ckey) {
 20.1106 -		    RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
 20.1107 -		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1108 -		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1109 -		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1110 -		}
 20.1111 -		src += srcbpp;
 20.1112 -		dst += dstbpp;
 20.1113 -	    },
 20.1114 -	    width);
 20.1115 -	    /* *INDENT-ON* */
 20.1116 +        /* *INDENT-OFF* */
 20.1117 +        DUFFS_LOOP4(
 20.1118 +        {
 20.1119 +        RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
 20.1120 +        if(sA && Pixel != ckey) {
 20.1121 +            RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
 20.1122 +            DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1123 +            ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1124 +            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1125 +        }
 20.1126 +        src += srcbpp;
 20.1127 +        dst += dstbpp;
 20.1128 +        },
 20.1129 +        width);
 20.1130 +        /* *INDENT-ON* */
 20.1131          src += srcskip;
 20.1132          dst += dstskip;
 20.1133      }
 20.1134 @@ -1245,20 +1245,20 @@
 20.1135      dstbpp = dstfmt->BytesPerPixel;
 20.1136  
 20.1137      while (height--) {
 20.1138 -	    /* *INDENT-OFF* */
 20.1139 -	    DUFFS_LOOP4(
 20.1140 -	    {
 20.1141 -		DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
 20.1142 -		if(sA) {
 20.1143 -		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1144 -		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1145 -		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1146 -		}
 20.1147 -		src += srcbpp;
 20.1148 -		dst += dstbpp;
 20.1149 -	    },
 20.1150 -	    width);
 20.1151 -	    /* *INDENT-ON* */
 20.1152 +        /* *INDENT-OFF* */
 20.1153 +        DUFFS_LOOP4(
 20.1154 +        {
 20.1155 +        DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
 20.1156 +        if(sA) {
 20.1157 +            DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
 20.1158 +            ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
 20.1159 +            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
 20.1160 +        }
 20.1161 +        src += srcbpp;
 20.1162 +        dst += dstbpp;
 20.1163 +        },
 20.1164 +        width);
 20.1165 +        /* *INDENT-ON* */
 20.1166          src += srcskip;
 20.1167          dst += dstskip;
 20.1168      }
    21.1 --- a/src/video/SDL_egl.c	Sat Aug 18 17:23:40 2018 -0400
    21.2 +++ b/src/video/SDL_egl.c	Mon Sep 24 11:49:25 2018 -0700
    21.3 @@ -836,7 +836,7 @@
    21.4      /* max 2 values plus terminator. */
    21.5      EGLint attribs[3];
    21.6      int attr = 0;
    21.7 -	
    21.8 +
    21.9      EGLSurface * surface;
   21.10  
   21.11      if (SDL_EGL_ChooseConfig(_this) != 0) {
   21.12 @@ -868,7 +868,7 @@
   21.13              return EGL_NO_SURFACE;
   21.14          }
   21.15      }
   21.16 -	
   21.17 +
   21.18      attribs[attr++] = EGL_NONE;
   21.19      
   21.20      surface = _this->egl_data->eglCreateWindowSurface(
    22.1 --- a/src/video/SDL_pixels.c	Sat Aug 18 17:23:40 2018 -0400
    22.2 +++ b/src/video/SDL_pixels.c	Mon Sep 24 11:49:25 2018 -0700
    22.3 @@ -326,7 +326,7 @@
    22.4          if (Rmask == 0) {
    22.5              return SDL_PIXELFORMAT_RGB555;
    22.6          }
    22.7 -	/* fallthrough */
    22.8 +    /* fallthrough */
    22.9      case 16:
   22.10          if (Rmask == 0) {
   22.11              return SDL_PIXELFORMAT_RGB565;
    23.1 --- a/src/video/SDL_shape_internals.h	Sat Aug 18 17:23:40 2018 -0400
    23.2 +++ b/src/video/SDL_shape_internals.h	Mon Sep 24 11:49:25 2018 -0700
    23.3 @@ -36,21 +36,21 @@
    23.4  #endif
    23.5  
    23.6  typedef struct {
    23.7 -	struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
    23.8 +    struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
    23.9  } SDL_QuadTreeChildren;
   23.10  
   23.11  typedef union {
   23.12 -	SDL_QuadTreeChildren children;
   23.13 -	SDL_Rect shape;
   23.14 +    SDL_QuadTreeChildren children;
   23.15 +    SDL_Rect shape;
   23.16  } SDL_ShapeUnion;
   23.17  
   23.18  typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind;
   23.19  
   23.20  typedef struct {
   23.21 -	SDL_ShapeKind kind;
   23.22 -	SDL_ShapeUnion data;
   23.23 +    SDL_ShapeKind kind;
   23.24 +    SDL_ShapeUnion data;
   23.25  } SDL_ShapeTree;
   23.26 -	
   23.27 +
   23.28  typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
   23.29  
   23.30  extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
    24.1 --- a/src/video/SDL_video.c	Sat Aug 18 17:23:40 2018 -0400
    24.2 +++ b/src/video/SDL_video.c	Mon Sep 24 11:49:25 2018 -0700
    24.3 @@ -1540,11 +1540,12 @@
    24.4          return NULL;
    24.5      }
    24.6  
    24.7 -	// Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
    24.8 -	// but it's important or window focus will get broken on windows!
    24.9 +    /* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
   24.10 +     * but it's important or window focus will get broken on windows!
   24.11 +     */
   24.12  #if !defined(__WIN32__)
   24.13 -	if (window->flags & SDL_WINDOW_MINIMIZED) {
   24.14 -		window->flags &= ~SDL_WINDOW_MINIMIZED;
   24.15 +    if (window->flags & SDL_WINDOW_MINIMIZED) {
   24.16 +        window->flags &= ~SDL_WINDOW_MINIMIZED;
   24.17      }
   24.18  #endif
   24.19  
    25.1 --- a/src/video/SDL_vulkan_utils.c	Sat Aug 18 17:23:40 2018 -0400
    25.2 +++ b/src/video/SDL_vulkan_utils.c	Mon Sep 24 11:49:25 2018 -0700
    25.3 @@ -123,10 +123,10 @@
    25.4      {
    25.5          retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
    25.6      }
    25.7 -	else
    25.8 -	{
    25.9 -		retval = SDL_calloc(count, sizeof(VkExtensionProperties));
   25.10 -	}
   25.11 +    else
   25.12 +    {
   25.13 +        retval = SDL_calloc(count, sizeof(VkExtensionProperties));
   25.14 +    }
   25.15      if(!retval)
   25.16      {
   25.17          SDL_OutOfMemory();
    26.1 --- a/src/video/SDL_yuv.c	Sat Aug 18 17:23:40 2018 -0400
    26.2 +++ b/src/video/SDL_yuv.c	Mon Sep 24 11:49:25 2018 -0700
    26.3 @@ -89,10 +89,10 @@
    26.4  }
    26.5  
    26.6  static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, int yuv_pitch,
    26.7 -	                    const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride)
    26.8 +                        const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride)
    26.9  {
   26.10 -	const Uint8 *planes[3] = { NULL, NULL, NULL };
   26.11 -	int pitches[3] = { 0, 0, 0 };
   26.12 +    const Uint8 *planes[3] = { NULL, NULL, NULL };
   26.13 +    int pitches[3] = { 0, 0, 0 };
   26.14  
   26.15      switch (format) {
   26.16      case SDL_PIXELFORMAT_YV12:
   26.17 @@ -180,10 +180,10 @@
   26.18  
   26.19  static SDL_bool yuv_rgb_sse(
   26.20      Uint32 src_format, Uint32 dst_format,
   26.21 -	Uint32 width, Uint32 height, 
   26.22 -	const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
   26.23 -	Uint8 *rgb, Uint32 rgb_stride, 
   26.24 -	YCbCrType yuv_type)
   26.25 +    Uint32 width, Uint32 height, 
   26.26 +    const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
   26.27 +    Uint8 *rgb, Uint32 rgb_stride, 
   26.28 +    YCbCrType yuv_type)
   26.29  {
   26.30  #ifdef __SSE2__
   26.31      if (!SDL_HasSSE2()) {
   26.32 @@ -289,10 +289,10 @@
   26.33  
   26.34  static SDL_bool yuv_rgb_std(
   26.35      Uint32 src_format, Uint32 dst_format,
   26.36 -	Uint32 width, Uint32 height, 
   26.37 -	const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
   26.38 -	Uint8 *rgb, Uint32 rgb_stride, 
   26.39 -	YCbCrType yuv_type)
   26.40 +    Uint32 width, Uint32 height, 
   26.41 +    const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
   26.42 +    Uint8 *rgb, Uint32 rgb_stride, 
   26.43 +    YCbCrType yuv_type)
   26.44  {
   26.45      if (src_format == SDL_PIXELFORMAT_YV12 ||
   26.46          src_format == SDL_PIXELFORMAT_IYUV) {
   26.47 @@ -395,7 +395,7 @@
   26.48           Uint32 src_format, const void *src, int src_pitch,
   26.49           Uint32 dst_format, void *dst, int dst_pitch)
   26.50  {
   26.51 -	const Uint8 *y = NULL;
   26.52 +    const Uint8 *y = NULL;
   26.53      const Uint8 *u = NULL;
   26.54      const Uint8 *v = NULL;
   26.55      Uint32 y_stride = 0;
   26.56 @@ -553,7 +553,7 @@
   26.57              Uint32 y_stride, uv_stride, y_skip, uv_skip;
   26.58  
   26.59              GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
   26.60 -	                     (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v,
   26.61 +                         (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v,
   26.62                           &y_stride, &uv_stride);
   26.63              plane_interleaved_uv = (plane_y + height * y_stride);
   26.64              y_skip = (y_stride - width);
    27.1 --- a/src/video/android/SDL_androidvideo.c	Sat Aug 18 17:23:40 2018 -0400
    27.2 +++ b/src/video/android/SDL_androidvideo.c	Mon Sep 24 11:49:25 2018 -0700
    27.3 @@ -214,12 +214,12 @@
    27.4  void
    27.5  Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate)
    27.6  {
    27.7 -	SDL_VideoDevice* device;
    27.8 -	SDL_VideoDisplay *display;
    27.9 +    SDL_VideoDevice* device;
   27.10 +    SDL_VideoDisplay *display;
   27.11      Android_SurfaceWidth = surfaceWidth;
   27.12      Android_SurfaceHeight = surfaceHeight;
   27.13 -	Android_DeviceWidth = deviceWidth;
   27.14 -	Android_DeviceHeight = deviceHeight;
   27.15 +    Android_DeviceWidth = deviceWidth;
   27.16 +    Android_DeviceHeight = deviceHeight;
   27.17      Android_ScreenFormat = format;
   27.18      Android_ScreenRate = rate;
   27.19  
    28.1 --- a/src/video/cocoa/SDL_cocoaevents.m	Sat Aug 18 17:23:40 2018 -0400
    28.2 +++ b/src/video/cocoa/SDL_cocoaevents.m	Mon Sep 24 11:49:25 2018 -0700
    28.3 @@ -390,8 +390,8 @@
    28.4  
    28.5          if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, SDL_FALSE)) {
    28.6              [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
    28.7 -		}
    28.8 -		
    28.9 +        }
   28.10 +
   28.11          if ([NSApp mainMenu] == nil) {
   28.12              CreateApplicationMenus();
   28.13          }
    29.1 --- a/src/video/cocoa/SDL_cocoametalview.m	Sat Aug 18 17:23:40 2018 -0400
    29.2 +++ b/src/video/cocoa/SDL_cocoametalview.m	Mon Sep 24 11:49:25 2018 -0700
    29.3 @@ -39,7 +39,7 @@
    29.4  /* Return a Metal-compatible layer. */
    29.5  + (Class)layerClass
    29.6  {
    29.7 -	return NSClassFromString(@"CAMetalLayer");
    29.8 +    return NSClassFromString(@"CAMetalLayer");
    29.9  }
   29.10  
   29.11  /* Indicate the view wants to draw using a backing layer instead of drawRect. */
   29.12 @@ -59,7 +59,7 @@
   29.13  - (instancetype)initWithFrame:(NSRect)frame
   29.14                          scale:(CGFloat)scale
   29.15  {
   29.16 -	if ((self = [super initWithFrame:frame])) {
   29.17 +    if ((self = [super initWithFrame:frame])) {
   29.18          _tag = METALVIEW_TAG;
   29.19          self.wantsLayer = YES;
   29.20  
   29.21 @@ -71,7 +71,7 @@
   29.22          self.layer.contentsScale = scale;
   29.23      }
   29.24    
   29.25 -	return self;
   29.26 +    return self;
   29.27  }
   29.28  
   29.29  /* Set the size of the metal drawables when the view is resized. */
    30.1 --- a/src/video/cocoa/SDL_cocoamousetap.m	Sat Aug 18 17:23:40 2018 -0400
    30.2 +++ b/src/video/cocoa/SDL_cocoamousetap.m	Mon Sep 24 11:49:25 2018 -0700
    30.3 @@ -211,7 +211,7 @@
    30.4              tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
    30.5              if (tapdata->thread) {
    30.6                  /* Success - early out. Ownership transferred to thread. */
    30.7 -            	return;
    30.8 +                return;
    30.9              }
   30.10              CFRelease(tapdata->tap);
   30.11          }
    31.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Aug 18 17:23:40 2018 -0400
    31.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Sep 24 11:49:25 2018 -0700
    31.3 @@ -241,7 +241,7 @@
    31.4  static int
    31.5  GetHintCtrlClickEmulateRightClick()
    31.6  {
    31.7 -	return SDL_GetHintBoolean(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, SDL_FALSE);
    31.8 +    return SDL_GetHintBoolean(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, SDL_FALSE);
    31.9  }
   31.10  
   31.11  static NSUInteger
   31.12 @@ -908,7 +908,7 @@
   31.13      switch ([theEvent buttonNumber]) {
   31.14      case 0:
   31.15          if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
   31.16 -		    GetHintCtrlClickEmulateRightClick()) {
   31.17 +            GetHintCtrlClickEmulateRightClick()) {
   31.18              wasCtrlLeft = YES;
   31.19              button = SDL_BUTTON_RIGHT;
   31.20          } else {
    32.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Sat Aug 18 17:23:40 2018 -0400
    32.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Mon Sep 24 11:49:25 2018 -0700
    32.3 @@ -324,7 +324,7 @@
    32.4      { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
    32.5      { DSPF_UYVY, SDL_PIXELFORMAT_UYVY },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
    32.6      { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 },            /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) */
    32.7 -    { DSPF_ABGR, SDL_PIXELFORMAT_ABGR8888 },		/* 32 bit ABGR (4  byte, alpha 8@24, blue 8@16, green 8@8, red 8@0) */
    32.8 +    { DSPF_ABGR, SDL_PIXELFORMAT_ABGR8888 },            /* 32 bit ABGR (4  byte, alpha 8@24, blue 8@16, green 8@8, red 8@0) */
    32.9  #if (ENABLE_LUT8)
   32.10      { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 },              /* 8 bit LUT (8 bit color and alpha lookup from palette) */
   32.11  #endif
    33.1 --- a/src/video/haiku/SDL_BWin.h	Sat Aug 18 17:23:40 2018 -0400
    33.2 +++ b/src/video/haiku/SDL_BWin.h	Mon Sep 24 11:49:25 2018 -0700
    33.3 @@ -538,7 +538,7 @@
    33.4          msg.AddInt32("key-state", keyState);
    33.5          msg.AddInt32("key-scancode", keyCode);
    33.6          if (keyUtf8 != NULL) {
    33.7 -        	msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
    33.8 +            msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
    33.9          }
   33.10          be_app->PostMessage(&msg);
   33.11      }
    34.1 --- a/src/video/haiku/SDL_bclipboard.cc	Sat Aug 18 17:23:40 2018 -0400
    34.2 +++ b/src/video/haiku/SDL_bclipboard.cc	Mon Sep 24 11:49:25 2018 -0700
    34.3 @@ -36,54 +36,54 @@
    34.4  #endif
    34.5  
    34.6  int HAIKU_SetClipboardText(_THIS, const char *text) {
    34.7 -	BMessage *clip = NULL;
    34.8 -	if(be_clipboard->Lock()) {
    34.9 -		be_clipboard->Clear();
   34.10 -		if((clip = be_clipboard->Data())) {
   34.11 -			/* Presumably the string of characters is ascii-format */
   34.12 -			ssize_t asciiLength = 0;
   34.13 -			for(; text[asciiLength] != 0; ++asciiLength) {}
   34.14 -			clip->AddData("text/plain", B_MIME_TYPE, text, asciiLength);
   34.15 -			be_clipboard->Commit();
   34.16 -		}
   34.17 -		be_clipboard->Unlock();
   34.18 -	}
   34.19 -	return 0;
   34.20 +    BMessage *clip = NULL;
   34.21 +    if(be_clipboard->Lock()) {
   34.22 +        be_clipboard->Clear();
   34.23 +        if((clip = be_clipboard->Data())) {
   34.24 +            /* Presumably the string of characters is ascii-format */
   34.25 +            ssize_t asciiLength = 0;
   34.26 +            for(; text[asciiLength] != 0; ++asciiLength) {}
   34.27 +            clip->AddData("text/plain", B_MIME_TYPE, text, asciiLength);
   34.28 +            be_clipboard->Commit();
   34.29 +        }
   34.30 +        be_clipboard->Unlock();
   34.31 +    }
   34.32 +    return 0;
   34.33  }
   34.34  
   34.35  char *HAIKU_GetClipboardText(_THIS) {
   34.36 -	BMessage *clip = NULL;
   34.37 -	const char *text = NULL;	
   34.38 -	ssize_t length;
   34.39 -	char *result;
   34.40 -	if(be_clipboard->Lock()) {
   34.41 -		if((clip = be_clipboard->Data())) {
   34.42 -			/* Presumably the string of characters is ascii-format */
   34.43 -			clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
   34.44 -				&length);
   34.45 -		}
   34.46 -		be_clipboard->Unlock();
   34.47 -	} 
   34.48 -	
   34.49 -	if (!text) {
   34.50 -		result = SDL_strdup("");
   34.51 -	} else {
   34.52 -		/* Copy the data and pass on to SDL */
   34.53 -		result = (char *)SDL_malloc((length + 1) * sizeof(char));
   34.54 -		SDL_strlcpy(result, text, length + 1);
   34.55 -	}
   34.56 -	
   34.57 -	return result;
   34.58 +    BMessage *clip = NULL;
   34.59 +    const char *text = NULL;    
   34.60 +    ssize_t length;
   34.61 +    char *result;
   34.62 +    if(be_clipboard->Lock()) {
   34.63 +        if((clip = be_clipboard->Data())) {
   34.64 +            /* Presumably the string of characters is ascii-format */
   34.65 +            clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
   34.66 +                &length);
   34.67 +        }
   34.68 +        be_clipboard->Unlock();
   34.69 +    } 
   34.70 +    
   34.71 +    if (!text) {
   34.72 +        result = SDL_strdup("");
   34.73 +    } else {
   34.74 +        /* Copy the data and pass on to SDL */
   34.75 +        result = (char *)SDL_malloc((length + 1) * sizeof(char));
   34.76 +        SDL_strlcpy(result, text, length + 1);
   34.77 +    }
   34.78 +    
   34.79 +    return result;
   34.80  }
   34.81  
   34.82  SDL_bool HAIKU_HasClipboardText(_THIS) {
   34.83 -	SDL_bool result = SDL_FALSE;
   34.84 -	char *text = HAIKU_GetClipboardText(_this);
   34.85 -	if (text) {
   34.86 -		result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
   34.87 -		SDL_free(text);
   34.88 -	} 
   34.89 -	return result;
   34.90 +    SDL_bool result = SDL_FALSE;
   34.91 +    char *text = HAIKU_GetClipboardText(_this);
   34.92 +    if (text) {
   34.93 +        result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
   34.94 +        SDL_free(text);
   34.95 +    } 
   34.96 +    return result;
   34.97  }
   34.98  
   34.99  #ifdef __cplusplus
    35.1 --- a/src/video/haiku/SDL_bevents.cc	Sat Aug 18 17:23:40 2018 -0400
    35.2 +++ b/src/video/haiku/SDL_bevents.cc	Mon Sep 24 11:49:25 2018 -0700
    35.3 @@ -29,7 +29,7 @@
    35.4  #endif
    35.5  
    35.6  void HAIKU_PumpEvents(_THIS) {
    35.7 -	/* Since the event thread is its own thread, this isn't really necessary */
    35.8 +    /* Since the event thread is its own thread, this isn't really necessary */
    35.9  }
   35.10  
   35.11  #ifdef __cplusplus
    36.1 --- a/src/video/haiku/SDL_bframebuffer.cc	Sat Aug 18 17:23:40 2018 -0400
    36.2 +++ b/src/video/haiku/SDL_bframebuffer.cc	Mon Sep 24 11:49:25 2018 -0700
    36.3 @@ -40,158 +40,158 @@
    36.4  #endif
    36.5  
    36.6  static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
    36.7 -	return ((SDL_BWin*)(window->driverdata));
    36.8 +    return ((SDL_BWin*)(window->driverdata));
    36.9  }
   36.10  
   36.11  static SDL_INLINE SDL_BApp *_GetBeApp() {
   36.12 -	return ((SDL_BApp*)be_app);
   36.13 +    return ((SDL_BApp*)be_app);
   36.14  }
   36.15  
   36.16  int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
   36.17                                         Uint32 * format,
   36.18                                         void ** pixels, int *pitch) {
   36.19 -	SDL_BWin *bwin = _ToBeWin(window);
   36.20 -	BScreen bscreen;
   36.21 -	if(!bscreen.IsValid()) {
   36.22 -		return -1;
   36.23 -	}
   36.24 +    SDL_BWin *bwin = _ToBeWin(window);
   36.25 +    BScreen bscreen;
   36.26 +    if(!bscreen.IsValid()) {
   36.27 +        return -1;
   36.28 +    }
   36.29  
   36.30 -	while(!bwin->Connected()) { snooze(100); }
   36.31 -	
   36.32 -	/* Make sure we have exclusive access to frame buffer data */
   36.33 -	bwin->LockBuffer();
   36.34 +    while(!bwin->Connected()) { snooze(100); }
   36.35 +    
   36.36 +    /* Make sure we have exclusive access to frame buffer data */
   36.37 +    bwin->LockBuffer();
   36.38  
   36.39 -	/* format */
   36.40 -	display_mode bmode;
   36.41 -	bscreen.GetMode(&bmode);
   36.42 -	int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode.space);
   36.43 -	*format = HAIKU_BPPToSDLPxFormat(bpp);
   36.44 +    /* format */
   36.45 +    display_mode bmode;
   36.46 +    bscreen.GetMode(&bmode);
   36.47 +    int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode.space);
   36.48 +    *format = HAIKU_BPPToSDLPxFormat(bpp);
   36.49  
   36.50 -	/* Create the new bitmap object */
   36.51 -	BBitmap *bitmap = bwin->GetBitmap();
   36.52 +    /* Create the new bitmap object */
   36.53 +    BBitmap *bitmap = bwin->GetBitmap();
   36.54  
   36.55 -	if(bitmap) {
   36.56 -		delete bitmap;
   36.57 -	}
   36.58 -	bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
   36.59 -			false,	/* Views not accepted */
   36.60 -			true);	/* Contiguous memory required */
   36.61 -			
   36.62 -	if(bitmap->InitCheck() != B_OK) {
   36.63 -		delete bitmap;
   36.64 -		return SDL_SetError("Could not initialize back buffer!");
   36.65 -	}
   36.66 +    if(bitmap) {
   36.67 +        delete bitmap;
   36.68 +    }
   36.69 +    bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
   36.70 +            false,    /* Views not accepted */
   36.71 +            true);    /* Contiguous memory required */
   36.72 +            
   36.73 +    if(bitmap->InitCheck() != B_OK) {
   36.74 +        delete bitmap;
   36.75 +        return SDL_SetError("Could not initialize back buffer!");
   36.76 +    }
   36.77  
   36.78  
   36.79 -	bwin->SetBitmap(bitmap);
   36.80 -	
   36.81 -	/* Set the pixel pointer */
   36.82 -	*pixels = bitmap->Bits();
   36.83 +    bwin->SetBitmap(bitmap);
   36.84 +    
   36.85 +    /* Set the pixel pointer */
   36.86 +    *pixels = bitmap->Bits();
   36.87  
   36.88 -	/* pitch = width of window, in bytes */
   36.89 -	*pitch = bitmap->BytesPerRow();
   36.90 +    /* pitch = width of window, in bytes */
   36.91 +    *pitch = bitmap->BytesPerRow();
   36.92  
   36.93 -	bwin->SetBufferExists(true);
   36.94 -	bwin->SetTrashBuffer(false);
   36.95 -	bwin->UnlockBuffer();
   36.96 -	return 0;
   36.97 +    bwin->SetBufferExists(true);
   36.98 +    bwin->SetTrashBuffer(false);
   36.99 +    bwin->UnlockBuffer();
  36.100 +    return 0;
  36.101  }
  36.102  
  36.103  
  36.104  
  36.105  int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
  36.106                                        const SDL_Rect * rects, int numrects) {
  36.107 -	if(!window)
  36.108 -		return 0;
  36.109 +    if(!window)
  36.110 +        return 0;
  36.111  
  36.112 -	SDL_BWin *bwin = _ToBeWin(window);
  36.113 +    SDL_BWin *bwin = _ToBeWin(window);
  36.114  
  36.115 -#ifdef DRAWTHREAD	
  36.116 -	bwin->LockBuffer();
  36.117 -	bwin->SetBufferDirty(true);
  36.118 -	bwin->UnlockBuffer();
  36.119 +#ifdef DRAWTHREAD    
  36.120 +    bwin->LockBuffer();
  36.121 +    bwin->SetBufferDirty(true);
  36.122 +    bwin->UnlockBuffer();
  36.123  #else
  36.124 -	bwin->SetBufferDirty(true);
  36.125 -	HAIKU_UpdateOnce(window);
  36.126 +    bwin->SetBufferDirty(true);
  36.127 +    HAIKU_UpdateOnce(window);
  36.128  #endif
  36.129  
  36.130 -	return 0;
  36.131 +    return 0;
  36.132  }
  36.133  
  36.134  int32 HAIKU_DrawThread(void *data) {
  36.135 -	SDL_BWin *bwin = (SDL_BWin*)data;
  36.136 -	
  36.137 -	BScreen bscreen;
  36.138 -	if(!bscreen.IsValid()) {
  36.139 -		return -1;
  36.140 -	}
  36.141 +    SDL_BWin *bwin = (SDL_BWin*)data;
  36.142 +    
  36.143 +    BScreen bscreen;
  36.144 +    if(!bscreen.IsValid()) {
  36.145 +        return -1;
  36.146 +    }
  36.147  
  36.148 -	while(bwin->ConnectionEnabled()) {
  36.149 -		if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
  36.150 -			bwin->LockBuffer();
  36.151 -			BBitmap *bitmap = NULL;
  36.152 -			bitmap = bwin->GetBitmap();
  36.153 -			int32 windowPitch = bitmap->BytesPerRow();
  36.154 -			int32 bufferPitch = bwin->GetRowBytes();
  36.155 -			uint8 *windowpx;
  36.156 -			uint8 *bufferpx;
  36.157 +    while(bwin->ConnectionEnabled()) {
  36.158 +        if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
  36.159 +            bwin->LockBuffer();
  36.160 +            BBitmap *bitmap = NULL;
  36.161 +            bitmap = bwin->GetBitmap();
  36.162 +            int32 windowPitch = bitmap->BytesPerRow();
  36.163 +            int32 bufferPitch = bwin->GetRowBytes();
  36.164 +            uint8 *windowpx;
  36.165 +            uint8 *bufferpx;
  36.166  
  36.167 -			int32 BPP = bwin->GetBytesPerPx();
  36.168 -			int32 windowSub = bwin->GetFbX() * BPP +
  36.169 -						  bwin->GetFbY() * windowPitch;
  36.170 -			clipping_rect *clips = bwin->GetClips();
  36.171 -			int32 numClips = bwin->GetNumClips();
  36.172 -			int i, y;
  36.173 +            int32 BPP = bwin->GetBytesPerPx();
  36.174 +            int32 windowSub = bwin->GetFbX() * BPP +
  36.175 +                          bwin->GetFbY() * windowPitch;
  36.176 +            clipping_rect *clips = bwin->GetClips();
  36.177 +            int32 numClips = bwin->GetNumClips();
  36.178 +            int i, y;
  36.179  
  36.180 -			/* Blit each clipping rectangle */
  36.181 -			bscreen.WaitForRetrace();
  36.182 -			for(i = 0; i < numClips; ++i) {
  36.183 -				/* Get addresses of the start of each clipping rectangle */
  36.184 -				int32 width = clips[i].right - clips[i].left + 1;
  36.185 -				int32 height = clips[i].bottom - clips[i].top + 1;
  36.186 -				bufferpx = bwin->GetBufferPx() + 
  36.187 -					clips[i].top * bufferPitch + clips[i].left * BPP;
  36.188 -				windowpx = (uint8*)bitmap->Bits() + 
  36.189 -					clips[i].top * windowPitch + clips[i].left * BPP -
  36.190 -					windowSub;
  36.191 +            /* Blit each clipping rectangle */
  36.192 +            bscreen.WaitForRetrace();
  36.193 +            for(i = 0; i < numClips; ++i) {
  36.194 +                /* Get addresses of the start of each clipping rectangle */
  36.195 +                int32 width = clips[i].right - clips[i].left + 1;
  36.196 +                int32 height = clips[i].bottom - clips[i].top + 1;
  36.197 +                bufferpx = bwin->GetBufferPx() + 
  36.198 +                    clips[i].top * bufferPitch + clips[i].left * BPP;
  36.199 +                windowpx = (uint8*)bitmap->Bits() + 
  36.200 +                    clips[i].top * windowPitch + clips[i].left * BPP -
  36.201 +                    windowSub;
  36.202  
  36.203 -				/* Copy each row of pixels from the window buffer into the frame
  36.204 -				   buffer */
  36.205 -				for(y = 0; y < height; ++y)
  36.206 -				{
  36.207 +                /* Copy each row of pixels from the window buffer into the frame
  36.208 +                   buffer */
  36.209 +                for(y = 0; y < height; ++y)
  36.210 +                {
  36.211  
  36.212 -					if(bwin->CanTrashWindowBuffer()) {
  36.213 -						goto escape;	/* Break out before the buffer is killed */
  36.214 -					}
  36.215 +                    if(bwin->CanTrashWindowBuffer()) {
  36.216 +                        goto escape;    /* Break out before the buffer is killed */
  36.217 +                    }
  36.218  
  36.219 -					memcpy(bufferpx, windowpx, width * BPP);
  36.220 -					bufferpx += bufferPitch;
  36.221 -					windowpx += windowPitch;
  36.222 -				}
  36.223 -			}
  36.224 +                    memcpy(bufferpx, windowpx, width * BPP);
  36.225 +                    bufferpx += bufferPitch;
  36.226 +                    windowpx += windowPitch;
  36.227 +                }
  36.228 +            }
  36.229  
  36.230 -			bwin->SetBufferDirty(false);
  36.231 +            bwin->SetBufferDirty(false);
  36.232  escape:
  36.233 -			bwin->UnlockBuffer();
  36.234 -		} else {
  36.235 -			snooze(16000);
  36.236 -		}
  36.237 -	}
  36.238 -	
  36.239 -	return B_OK;
  36.240 +            bwin->UnlockBuffer();
  36.241 +        } else {
  36.242 +            snooze(16000);
  36.243 +        }
  36.244 +    }
  36.245 +    
  36.246 +    return B_OK;
  36.247  }
  36.248  
  36.249  void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
  36.250 -	SDL_BWin *bwin = _ToBeWin(window);
  36.251 -	
  36.252 -	bwin->LockBuffer();
  36.253 -	
  36.254 -	/* Free and clear the window buffer */
  36.255 -	BBitmap *bitmap = bwin->GetBitmap();
  36.256 -	delete bitmap;
  36.257 -	bwin->SetBitmap(NULL);
  36.258 -	bwin->SetBufferExists(false);
  36.259 -	bwin->UnlockBuffer();
  36.260 +    SDL_BWin *bwin = _ToBeWin(window);
  36.261 +    
  36.262 +    bwin->LockBuffer();
  36.263 +    
  36.264 +    /* Free and clear the window buffer */
  36.265 +    BBitmap *bitmap = bwin->GetBitmap();
  36.266 +    delete bitmap;
  36.267 +    bwin->SetBitmap(NULL);
  36.268 +    bwin->SetBufferExists(false);
  36.269 +    bwin->UnlockBuffer();
  36.270  }
  36.271  
  36.272  
  36.273 @@ -203,50 +203,50 @@
  36.274   */
  36.275  #ifndef DRAWTHREAD
  36.276  static int32 HAIKU_UpdateOnce(SDL_Window *window) {
  36.277 -	SDL_BWin *bwin = _ToBeWin(window);
  36.278 -	BScreen bscreen;
  36.279 -	if(!bscreen.IsValid()) {
  36.280 -		return -1;
  36.281 -	}
  36.282 +    SDL_BWin *bwin = _ToBeWin(window);
  36.283 +    BScreen bscreen;
  36.284 +    if(!bscreen.IsValid()) {
  36.285 +        return -1;
  36.286 +    }
  36.287  
  36.288 -	if(bwin->ConnectionEnabled() && bwin->Connected()) {
  36.289 -		bwin->LockBuffer();
  36.290 -		int32 windowPitch = window->surface->pitch;
  36.291 -		int32 bufferPitch = bwin->GetRowBytes();
  36.292 -		uint8 *windowpx;
  36.293 -		uint8 *bufferpx;
  36.294 +    if(bwin->ConnectionEnabled() && bwin->Connected()) {
  36.295 +        bwin->LockBuffer();
  36.296 +        int32 windowPitch = window->surface->pitch;
  36.297 +        int32 bufferPitch = bwin->GetRowBytes();
  36.298 +        uint8 *windowpx;
  36.299 +        uint8 *bufferpx;
  36.300  
  36.301 -		int32 BPP = bwin->GetBytesPerPx();
  36.302 -		uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
  36.303 -		int32 windowSub = bwin->GetFbX() * BPP +
  36.304 -						  bwin->GetFbY() * windowPitch;
  36.305 -		clipping_rect *clips = bwin->GetClips();
  36.306 -		int32 numClips = bwin->GetNumClips();
  36.307 -		int i, y;
  36.308 +        int32 BPP = bwin->GetBytesPerPx();
  36.309 +        uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
  36.310 +        int32 windowSub = bwin->GetFbX() * BPP +
  36.311 +                          bwin->GetFbY() * windowPitch;
  36.312 +        clipping_rect *clips = bwin->GetClips();
  36.313 +        int32 numClips = bwin->GetNumClips();
  36.314 +        int i, y;
  36.315  
  36.316 -		/* Blit each clipping rectangle */
  36.317 -		bscreen.WaitForRetrace();
  36.318 -		for(i = 0; i < numClips; ++i) {
  36.319 -			/* Get addresses of the start of each clipping rectangle */
  36.320 -			int32 width = clips[i].right - clips[i].left + 1;
  36.321 -			int32 height = clips[i].bottom - clips[i].top + 1;
  36.322 -			bufferpx = bwin->GetBufferPx() + 
  36.323 -				clips[i].top * bufferPitch + clips[i].left * BPP;
  36.324 -			windowpx = windowBaseAddress + 
  36.325 -				clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
  36.326 +        /* Blit each clipping rectangle */
  36.327 +        bscreen.WaitForRetrace();
  36.328 +        for(i = 0; i < numClips; ++i) {
  36.329 +            /* Get addresses of the start of each clipping rectangle */
  36.330 +            int32 width = clips[i].right - clips[i].left + 1;
  36.331 +            int32 height = clips[i].bottom - clips[i].top + 1;
  36.332 +            bufferpx = bwin->GetBufferPx() + 
  36.333 +                clips[i].top * bufferPitch + clips[i].left * BPP;
  36.334 +            windowpx = windowBaseAddress + 
  36.335 +                clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
  36.336  
  36.337 -			/* Copy each row of pixels from the window buffer into the frame
  36.338 -			   buffer */
  36.339 -			for(y = 0; y < height; ++y)
  36.340 -			{
  36.341 -				memcpy(bufferpx, windowpx, width * BPP);
  36.342 -				bufferpx += bufferPitch;
  36.343 -				windowpx += windowPitch;
  36.344 -			}
  36.345 -		}
  36.346 -		bwin->UnlockBuffer();
  36.347 -	}
  36.348 -	return 0;
  36.349 +            /* Copy each row of pixels from the window buffer into the frame
  36.350 +               buffer */
  36.351 +            for(y = 0; y < height; ++y)
  36.352 +            {
  36.353 +                memcpy(bufferpx, windowpx, width * BPP);
  36.354 +                bufferpx += bufferPitch;
  36.355 +                windowpx += windowPitch;
  36.356 +            }
  36.357 +        }
  36.358 +        bwin->UnlockBuffer();
  36.359 +    }
  36.360 +    return 0;
  36.361  }
  36.362  #endif
  36.363  
    37.1 --- a/src/video/haiku/SDL_bkeyboard.cc	Sat Aug 18 17:23:40 2018 -0400
    37.2 +++ b/src/video/haiku/SDL_bkeyboard.cc	Mon Sep 24 11:49:25 2018 -0700
    37.3 @@ -42,143 +42,143 @@
    37.4  static int8 keystate[KEYMAP_SIZE];
    37.5  
    37.6  void HAIKU_InitOSKeymap(void) {
    37.7 -		for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
    37.8 -			keymap[i] = SDL_SCANCODE_UNKNOWN;
    37.9 -		}
   37.10 +        for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
   37.11 +            keymap[i] = SDL_SCANCODE_UNKNOWN;
   37.12 +        }
   37.13  
   37.14 -		for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
   37.15 -			keystate[i] = SDL_RELEASED;
   37.16 -		}
   37.17 +        for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
   37.18 +            keystate[i] = SDL_RELEASED;
   37.19 +        }
   37.20  
   37.21 -		keymap[0x01]		= SDL_GetScancodeFromKey(SDLK_ESCAPE);
   37.22 -		keymap[B_F1_KEY]	= SDL_GetScancodeFromKey(SDLK_F1);
   37.23 -		keymap[B_F2_KEY]	= SDL_GetScancodeFromKey(SDLK_F2);
   37.24 -		keymap[B_F3_KEY]	= SDL_GetScancodeFromKey(SDLK_F3);
   37.25 -		keymap[B_F4_KEY]	= SDL_GetScancodeFromKey(SDLK_F4);
   37.26 -		keymap[B_F5_KEY]	= SDL_GetScancodeFromKey(SDLK_F5);
   37.27 -		keymap[B_F6_KEY]	= SDL_GetScancodeFromKey(SDLK_F6);
   37.28 -		keymap[B_F7_KEY]	= SDL_GetScancodeFromKey(SDLK_F7);
   37.29 -		keymap[B_F8_KEY]	= SDL_GetScancodeFromKey(SDLK_F8);
   37.30 -		keymap[B_F9_KEY]	= SDL_GetScancodeFromKey(SDLK_F9);
   37.31 -		keymap[B_F10_KEY]	= SDL_GetScancodeFromKey(SDLK_F10);
   37.32 -		keymap[B_F11_KEY]	= SDL_GetScancodeFromKey(SDLK_F11);
   37.33 -		keymap[B_F12_KEY]	= SDL_GetScancodeFromKey(SDLK_F12);
   37.34 -		keymap[B_PRINT_KEY]	= SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
   37.35 -		keymap[B_SCROLL_KEY]	= SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
   37.36 -		keymap[B_PAUSE_KEY]	= SDL_GetScancodeFromKey(SDLK_PAUSE);
   37.37 -		keymap[0x11]		= SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
   37.38 -		keymap[0x12]		= SDL_GetScancodeFromKey(SDLK_1);
   37.39 -		keymap[0x13]		= SDL_GetScancodeFromKey(SDLK_2);
   37.40 -		keymap[0x14]		= SDL_GetScancodeFromKey(SDLK_3);
   37.41 -		keymap[0x15]		= SDL_GetScancodeFromKey(SDLK_4);
   37.42 -		keymap[0x16]		= SDL_GetScancodeFromKey(SDLK_5);
   37.43 -		keymap[0x17]		= SDL_GetScancodeFromKey(SDLK_6);
   37.44 -		keymap[0x18]		= SDL_GetScancodeFromKey(SDLK_7);
   37.45 -		keymap[0x19]		= SDL_GetScancodeFromKey(SDLK_8);
   37.46 -		keymap[0x1a]		= SDL_GetScancodeFromKey(SDLK_9);
   37.47 -		keymap[0x1b]		= SDL_GetScancodeFromKey(SDLK_0);
   37.48 -		keymap[0x1c]		= SDL_GetScancodeFromKey(SDLK_MINUS);
   37.49 -		keymap[0x1d]		= SDL_GetScancodeFromKey(SDLK_EQUALS);
   37.50 -		keymap[0x1e]		= SDL_GetScancodeFromKey(SDLK_BACKSPACE);
   37.51 -		keymap[0x1f]		= SDL_GetScancodeFromKey(SDLK_INSERT);
   37.52 -		keymap[0x20]		= SDL_GetScancodeFromKey(SDLK_HOME);
   37.53 -		keymap[0x21]		= SDL_GetScancodeFromKey(SDLK_PAGEUP);
   37.54 -		keymap[0x22]		= SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
   37.55 -		keymap[0x23]		= SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
   37.56 -		keymap[0x24]		= SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
   37.57 -		keymap[0x25]		= SDL_GetScancodeFromKey(SDLK_KP_MINUS);
   37.58 -		keymap[0x26]		= SDL_GetScancodeFromKey(SDLK_TAB);
   37.59 -		keymap[0x27]		= SDL_GetScancodeFromKey(SDLK_q);
   37.60 -		keymap[0x28]		= SDL_GetScancodeFromKey(SDLK_w);
   37.61 -		keymap[0x29]		= SDL_GetScancodeFromKey(SDLK_e);
   37.62 -		keymap[0x2a]		= SDL_GetScancodeFromKey(SDLK_r);
   37.63 -		keymap[0x2b]		= SDL_GetScancodeFromKey(SDLK_t);
   37.64 -		keymap[0x2c]		= SDL_GetScancodeFromKey(SDLK_y);
   37.65 -		keymap[0x2d]		= SDL_GetScancodeFromKey(SDLK_u);
   37.66 -		keymap[0x2e]		= SDL_GetScancodeFromKey(SDLK_i);
   37.67 -		keymap[0x2f]		= SDL_GetScancodeFromKey(SDLK_o);
   37.68 -		keymap[0x30]		= SDL_GetScancodeFromKey(SDLK_p);
   37.69 -		keymap[0x31]		= SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
   37.70 -		keymap[0x32]		= SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
   37.71 -		keymap[0x33]		= SDL_GetScancodeFromKey(SDLK_BACKSLASH);
   37.72 -		keymap[0x34]		= SDL_GetScancodeFromKey(SDLK_DELETE);
   37.73 -		keymap[0x35]		= SDL_GetScancodeFromKey(SDLK_END);
   37.74 -		keymap[0x36]		= SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
   37.75 -		keymap[0x37]		= SDL_GetScancodeFromKey(SDLK_KP_7);
   37.76 -		keymap[0x38]		= SDL_GetScancodeFromKey(SDLK_KP_8);
   37.77 -		keymap[0x39]		= SDL_GetScancodeFromKey(SDLK_KP_9);
   37.78 -		keymap[0x3a]		= SDL_GetScancodeFromKey(SDLK_KP_PLUS);
   37.79 -		keymap[0x3b]		= SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
   37.80 -		keymap[0x3c]		= SDL_GetScancodeFromKey(SDLK_a);
   37.81 -		keymap[0x3d]		= SDL_GetScancodeFromKey(SDLK_s);
   37.82 -		keymap[0x3e]		= SDL_GetScancodeFromKey(SDLK_d);
   37.83 -		keymap[0x3f]		= SDL_GetScancodeFromKey(SDLK_f);
   37.84 -		keymap[0x40]		= SDL_GetScancodeFromKey(SDLK_g);
   37.85 -		keymap[0x41]		= SDL_GetScancodeFromKey(SDLK_h);
   37.86 -		keymap[0x42]		= SDL_GetScancodeFromKey(SDLK_j);
   37.87 -		keymap[0x43]		= SDL_GetScancodeFromKey(SDLK_k);
   37.88 -		keymap[0x44]		= SDL_GetScancodeFromKey(SDLK_l);
   37.89 -		keymap[0x45]		= SDL_GetScancodeFromKey(SDLK_SEMICOLON);
   37.90 -		keymap[0x46]		= SDL_GetScancodeFromKey(SDLK_QUOTE);
   37.91 -		keymap[0x47]		= SDL_GetScancodeFromKey(SDLK_RETURN);
   37.92 -		keymap[0x48]		= SDL_GetScancodeFromKey(SDLK_KP_4);
   37.93 -		keymap[0x49]		= SDL_GetScancodeFromKey(SDLK_KP_5);
   37.94 -		keymap[0x4a]		= SDL_GetScancodeFromKey(SDLK_KP_6);
   37.95 -		keymap[0x4b]		= SDL_GetScancodeFromKey(SDLK_LSHIFT);
   37.96 -		keymap[0x4c]		= SDL_GetScancodeFromKey(SDLK_z);
   37.97 -		keymap[0x4d]		= SDL_GetScancodeFromKey(SDLK_x);
   37.98 -		keymap[0x4e]		= SDL_GetScancodeFromKey(SDLK_c);
   37.99 -		keymap[0x4f]		= SDL_GetScancodeFromKey(SDLK_v);
  37.100 -		keymap[0x50]		= SDL_GetScancodeFromKey(SDLK_b);
  37.101 -		keymap[0x51]		= SDL_GetScancodeFromKey(SDLK_n);
  37.102 -		keymap[0x52]		= SDL_GetScancodeFromKey(SDLK_m);
  37.103 -		keymap[0x53]		= SDL_GetScancodeFromKey(SDLK_COMMA);
  37.104 -		keymap[0x54]		= SDL_GetScancodeFromKey(SDLK_PERIOD);
  37.105 -		keymap[0x55]		= SDL_GetScancodeFromKey(SDLK_SLASH);
  37.106 -		keymap[0x56]		= SDL_GetScancodeFromKey(SDLK_RSHIFT);
  37.107 -		keymap[0x57]		= SDL_GetScancodeFromKey(SDLK_UP);
  37.108 -		keymap[0x58]		= SDL_GetScancodeFromKey(SDLK_KP_1);
  37.109 -		keymap[0x59]		= SDL_GetScancodeFromKey(SDLK_KP_2);
  37.110 -		keymap[0x5a]		= SDL_GetScancodeFromKey(SDLK_KP_3);
  37.111 -		keymap[0x5b]		= SDL_GetScancodeFromKey(SDLK_KP_ENTER);
  37.112 -		keymap[0x5c]		= SDL_GetScancodeFromKey(SDLK_LCTRL);
  37.113 -		keymap[0x5d]		= SDL_GetScancodeFromKey(SDLK_LALT);
  37.114 -		keymap[0x5e]		= SDL_GetScancodeFromKey(SDLK_SPACE);
  37.115 -		keymap[0x5f]		= SDL_GetScancodeFromKey(SDLK_RALT);
  37.116 -		keymap[0x60]		= SDL_GetScancodeFromKey(SDLK_RCTRL);
  37.117 -		keymap[0x61]		= SDL_GetScancodeFromKey(SDLK_LEFT);
  37.118 -		keymap[0x62]		= SDL_GetScancodeFromKey(SDLK_DOWN);
  37.119 -		keymap[0x63]		= SDL_GetScancodeFromKey(SDLK_RIGHT);
  37.120 -		keymap[0x64]		= SDL_GetScancodeFromKey(SDLK_KP_0);
  37.121 -		keymap[0x65]		= SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
  37.122 -		keymap[0x66]		= SDL_GetScancodeFromKey(SDLK_LGUI);
  37.123 -		keymap[0x67]		= SDL_GetScancodeFromKey(SDLK_RGUI);
  37.124 -		keymap[0x68]		= SDL_GetScancodeFromKey(SDLK_MENU);
  37.125 -		keymap[0x69]		= SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
  37.126 -		keymap[0x6a]		= SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
  37.127 -		keymap[0x6b]		= SDL_GetScancodeFromKey(SDLK_POWER);
  37.128 +        keymap[0x01]        = SDL_GetScancodeFromKey(SDLK_ESCAPE);
  37.129 +        keymap[B_F1_KEY]    = SDL_GetScancodeFromKey(SDLK_F1);
  37.130 +        keymap[B_F2_KEY]    = SDL_GetScancodeFromKey(SDLK_F2);
  37.131 +        keymap[B_F3_KEY]    = SDL_GetScancodeFromKey(SDLK_F3);
  37.132 +        keymap[B_F4_KEY]    = SDL_GetScancodeFromKey(SDLK_F4);
  37.133 +        keymap[B_F5_KEY]    = SDL_GetScancodeFromKey(SDLK_F5);
  37.134 +        keymap[B_F6_KEY]    = SDL_GetScancodeFromKey(SDLK_F6);
  37.135 +        keymap[B_F7_KEY]    = SDL_GetScancodeFromKey(SDLK_F7);
  37.136 +        keymap[B_F8_KEY]    = SDL_GetScancodeFromKey(SDLK_F8);
  37.137 +        keymap[B_F9_KEY]    = SDL_GetScancodeFromKey(SDLK_F9);
  37.138 +        keymap[B_F10_KEY]    = SDL_GetScancodeFromKey(SDLK_F10);
  37.139 +        keymap[B_F11_KEY]    = SDL_GetScancodeFromKey(SDLK_F11);
  37.140 +        keymap[B_F12_KEY]    = SDL_GetScancodeFromKey(SDLK_F12);
  37.141 +        keymap[B_PRINT_KEY]    = SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
  37.142 +        keymap[B_SCROLL_KEY]    = SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
  37.143 +        keymap[B_PAUSE_KEY]    = SDL_GetScancodeFromKey(SDLK_PAUSE);
  37.144 +        keymap[0x11]        = SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
  37.145 +        keymap[0x12]        = SDL_GetScancodeFromKey(SDLK_1);
  37.146 +        keymap[0x13]        = SDL_GetScancodeFromKey(SDLK_2);
  37.147 +        keymap[0x14]        = SDL_GetScancodeFromKey(SDLK_3);
  37.148 +        keymap[0x15]        = SDL_GetScancodeFromKey(SDLK_4);
  37.149 +        keymap[0x16]        = SDL_GetScancodeFromKey(SDLK_5);
  37.150 +        keymap[0x17]        = SDL_GetScancodeFromKey(SDLK_6);
  37.151 +        keymap[0x18]        = SDL_GetScancodeFromKey(SDLK_7);
  37.152 +        keymap[0x19]        = SDL_GetScancodeFromKey(SDLK_8);
  37.153 +        keymap[0x1a]        = SDL_GetScancodeFromKey(SDLK_9);
  37.154 +        keymap[0x1b]        = SDL_GetScancodeFromKey(SDLK_0);
  37.155 +        keymap[0x1c]        = SDL_GetScancodeFromKey(SDLK_MINUS);
  37.156 +        keymap[0x1d]        = SDL_GetScancodeFromKey(SDLK_EQUALS);
  37.157 +        keymap[0x1e]        = SDL_GetScancodeFromKey(SDLK_BACKSPACE);
  37.158 +        keymap[0x1f]        = SDL_GetScancodeFromKey(SDLK_INSERT);
  37.159 +        keymap[0x20]        = SDL_GetScancodeFromKey(SDLK_HOME);
  37.160 +        keymap[0x21]        = SDL_GetScancodeFromKey(SDLK_PAGEUP);
  37.161 +        keymap[0x22]        = SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
  37.162 +        keymap[0x23]        = SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
  37.163 +        keymap[0x24]        = SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
  37.164 +        keymap[0x25]        = SDL_GetScancodeFromKey(SDLK_KP_MINUS);
  37.165 +        keymap[0x26]        = SDL_GetScancodeFromKey(SDLK_TAB);
  37.166 +        keymap[0x27]        = SDL_GetScancodeFromKey(SDLK_q);
  37.167 +        keymap[0x28]        = SDL_GetScancodeFromKey(SDLK_w);
  37.168 +        keymap[0x29]        = SDL_GetScancodeFromKey(SDLK_e);
  37.169 +        keymap[0x2a]        = SDL_GetScancodeFromKey(SDLK_r);
  37.170 +        keymap[0x2b]        = SDL_GetScancodeFromKey(SDLK_t);
  37.171 +        keymap[0x2c]        = SDL_GetScancodeFromKey(SDLK_y);
  37.172 +        keymap[0x2d]        = SDL_GetScancodeFromKey(SDLK_u);
  37.173 +        keymap[0x2e]        = SDL_GetScancodeFromKey(SDLK_i);
  37.174 +        keymap[0x2f]        = SDL_GetScancodeFromKey(SDLK_o);
  37.175 +        keymap[0x30]        = SDL_GetScancodeFromKey(SDLK_p);
  37.176 +        keymap[0x31]        = SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
  37.177 +        keymap[0x32]        = SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
  37.178 +        keymap[0x33]        = SDL_GetScancodeFromKey(SDLK_BACKSLASH);
  37.179 +        keymap[0x34]        = SDL_GetScancodeFromKey(SDLK_DELETE);
  37.180 +        keymap[0x35]        = SDL_GetScancodeFromKey(SDLK_END);
  37.181 +        keymap[0x36]        = SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
  37.182 +        keymap[0x37]        = SDL_GetScancodeFromKey(SDLK_KP_7);
  37.183 +        keymap[0x38]        = SDL_GetScancodeFromKey(SDLK_KP_8);
  37.184 +        keymap[0x39]        = SDL_GetScancodeFromKey(SDLK_KP_9);
  37.185 +        keymap[0x3a]        = SDL_GetScancodeFromKey(SDLK_KP_PLUS);
  37.186 +        keymap[0x3b]        = SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
  37.187 +        keymap[0x3c]        = SDL_GetScancodeFromKey(SDLK_a);
  37.188 +        keymap[0x3d]        = SDL_GetScancodeFromKey(SDLK_s);
  37.189 +        keymap[0x3e]        = SDL_GetScancodeFromKey(SDLK_d);
  37.190 +        keymap[0x3f]        = SDL_GetScancodeFromKey(SDLK_f);
  37.191 +        keymap[0x40]        = SDL_GetScancodeFromKey(SDLK_g);
  37.192 +        keymap[0x41]        = SDL_GetScancodeFromKey(SDLK_h);
  37.193 +        keymap[0x42]        = SDL_GetScancodeFromKey(SDLK_j);
  37.194 +        keymap[0x43]        = SDL_GetScancodeFromKey(SDLK_k);
  37.195 +        keymap[0x44]        = SDL_GetScancodeFromKey(SDLK_l);
  37.196 +        keymap[0x45]        = SDL_GetScancodeFromKey(SDLK_SEMICOLON);
  37.197 +        keymap[0x46]        = SDL_GetScancodeFromKey(SDLK_QUOTE);
  37.198 +        keymap[0x47]        = SDL_GetScancodeFromKey(SDLK_RETURN);
  37.199 +        keymap[0x48]        = SDL_GetScancodeFromKey(SDLK_KP_4);
  37.200 +        keymap[0x49]        = SDL_GetScancodeFromKey(SDLK_KP_5);
  37.201 +        keymap[0x4a]        = SDL_GetScancodeFromKey(SDLK_KP_6);
  37.202 +        keymap[0x4b]        = SDL_GetScancodeFromKey(SDLK_LSHIFT);
  37.203 +        keymap[0x4c]        = SDL_GetScancodeFromKey(SDLK_z);
  37.204 +        keymap[0x4d]        = SDL_GetScancodeFromKey(SDLK_x);
  37.205 +        keymap[0x4e]        = SDL_GetScancodeFromKey(SDLK_c);
  37.206 +        keymap[0x4f]        = SDL_GetScancodeFromKey(SDLK_v);
  37.207 +        keymap[0x50]        = SDL_GetScancodeFromKey(SDLK_b);
  37.208 +        keymap[0x51]        = SDL_GetScancodeFromKey(SDLK_n);
  37.209 +        keymap[0x52]        = SDL_GetScancodeFromKey(SDLK_m);
  37.210 +        keymap[0x53]        = SDL_GetScancodeFromKey(SDLK_COMMA);
  37.211 +        keymap[0x54]        = SDL_GetScancodeFromKey(SDLK_PERIOD);
  37.212 +        keymap[0x55]        = SDL_GetScancodeFromKey(SDLK_SLASH);
  37.213 +        keymap[0x56]        = SDL_GetScancodeFromKey(SDLK_RSHIFT);
  37.214 +        keymap[0x57]        = SDL_GetScancodeFromKey(SDLK_UP);
  37.215 +        keymap[0x58]        = SDL_GetScancodeFromKey(SDLK_KP_1);
  37.216 +        keymap[0x59]        = SDL_GetScancodeFromKey(SDLK_KP_2);
  37.217 +        keymap[0x5a]        = SDL_GetScancodeFromKey(SDLK_KP_3);
  37.218 +        keymap[0x5b]        = SDL_GetScancodeFromKey(SDLK_KP_ENTER);
  37.219 +        keymap[0x5c]        = SDL_GetScancodeFromKey(SDLK_LCTRL);
  37.220 +        keymap[0x5d]        = SDL_GetScancodeFromKey(SDLK_LALT);
  37.221 +        keymap[0x5e]        = SDL_GetScancodeFromKey(SDLK_SPACE);
  37.222 +        keymap[0x5f]        = SDL_GetScancodeFromKey(SDLK_RALT);
  37.223 +        keymap[0x60]        = SDL_GetScancodeFromKey(SDLK_RCTRL);
  37.224 +        keymap[0x61]        = SDL_GetScancodeFromKey(SDLK_LEFT);
  37.225 +        keymap[0x62]        = SDL_GetScancodeFromKey(SDLK_DOWN);
  37.226 +        keymap[0x63]        = SDL_GetScancodeFromKey(SDLK_RIGHT);
  37.227 +        keymap[0x64]        = SDL_GetScancodeFromKey(SDLK_KP_0);
  37.228 +        keymap[0x65]        = SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
  37.229 +        keymap[0x66]        = SDL_GetScancodeFromKey(SDLK_LGUI);
  37.230 +        keymap[0x67]        = SDL_GetScancodeFromKey(SDLK_RGUI);
  37.231 +        keymap[0x68]        = SDL_GetScancodeFromKey(SDLK_MENU);
  37.232 +        keymap[0x69]        = SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
  37.233 +        keymap[0x6a]        = SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
  37.234 +        keymap[0x6b]        = SDL_GetScancodeFromKey(SDLK_POWER);
  37.235  }
  37.236  
  37.237  SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) {
  37.238 -	if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
  37.239 -		return keymap[bkey];
  37.240 -	} else {
  37.241 -		return SDL_SCANCODE_UNKNOWN;
  37.242 -	}
  37.243 +    if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
  37.244 +        return keymap[bkey];
  37.245 +    } else {
  37.246 +        return SDL_SCANCODE_UNKNOWN;
  37.247 +    }
  37.248  }
  37.249  
  37.250  int8 HAIKU_GetKeyState(int32 bkey) {
  37.251 -	if(bkey > 0 && bkey < KEYMAP_SIZE) {
  37.252 -		return keystate[bkey];
  37.253 -	} else {
  37.254 -		return SDL_RELEASED;
  37.255 -	}
  37.256 +    if(bkey > 0 && bkey < KEYMAP_SIZE) {
  37.257 +        return keystate[bkey];
  37.258 +    } else {
  37.259 +        return SDL_RELEASED;
  37.260 +    }
  37.261  }
  37.262  
  37.263  void HAIKU_SetKeyState(int32 bkey, int8 state) {
  37.264 -	if(bkey > 0 && bkey < KEYMAP_SIZE) {
  37.265 -		keystate[bkey] = state;
  37.266 -	}
  37.267 +    if(bkey > 0 && bkey < KEYMAP_SIZE) {
  37.268 +        keystate[bkey] = state;
  37.269 +    }
  37.270  }
  37.271  
  37.272  #ifdef __cplusplus
    38.1 --- a/src/video/haiku/SDL_bmodes.cc	Sat Aug 18 17:23:40 2018 -0400
    38.2 +++ b/src/video/haiku/SDL_bmodes.cc	Mon Sep 24 11:49:25 2018 -0700
    38.3 @@ -44,30 +44,30 @@
    38.4  /* This wrapper is here so that the driverdata can be freed without freeing
    38.5     the display_mode structure */
    38.6  struct SDL_DisplayModeData {
    38.7 -	display_mode *bmode;
    38.8 +    display_mode *bmode;
    38.9  };
   38.10  #endif
   38.11  
   38.12  static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
   38.13 -	return ((SDL_BWin*)(window->driverdata));
   38.14 +    return ((SDL_BWin*)(window->driverdata));
   38.15  }
   38.16  
   38.17  static SDL_INLINE SDL_BApp *_GetBeApp() {
   38.18 -	return ((SDL_BApp*)be_app);
   38.19 +    return ((SDL_BApp*)be_app);
   38.20  }
   38.21  
   38.22  static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
   38.23  #if WRAP_BMODE
   38.24 -	return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
   38.25 +    return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
   38.26  #else
   38.27 -	return (display_mode*)(mode->driverdata);
   38.28 +    return (display_mode*)(mode->driverdata);
   38.29  #endif
   38.30  }
   38.31  
   38.32  /* Copied from haiku/trunk/src/preferences/screen/ScreenMode.cpp */
   38.33  static float get_refresh_rate(display_mode &mode) {
   38.34 -	return float(mode.timing.pixel_clock * 1000)
   38.35 -		/ float(mode.timing.h_total * mode.timing.v_total);
   38.36 +    return float(mode.timing.pixel_clock * 1000)
   38.37 +        / float(mode.timing.h_total * mode.timing.v_total);
   38.38  }
   38.39  
   38.40  
   38.41 @@ -76,57 +76,57 @@
   38.42   * This is a useful debugging tool.  Uncomment and insert into code as needed.
   38.43   */
   38.44  void _SpoutModeData(display_mode *bmode) {
   38.45 -	printf("BMode:\n");
   38.46 -	printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
   38.47 -	printf("\th,v = (%i,%i)\n", bmode->h_display_start, 
   38.48 -			bmode->v_display_start);
   38.49 -	if(bmode->flags) {
   38.50 -		printf("\tFlags:\n");
   38.51 -		if(bmode->flags & B_SCROLL) {
   38.52 -			printf("\t\tB_SCROLL\n");
   38.53 -		}
   38.54 -		if(bmode->flags & B_8_BIT_DAC) {
   38.55 -			printf("\t\tB_8_BIT_DAC\n");
   38.56 -		}
   38.57 -		if(bmode->flags & B_HARDWARE_CURSOR) {
   38.58 -			printf("\t\tB_HARDWARE_CURSOR\n");
   38.59 -		}
   38.60 -		if(bmode->flags & B_PARALLEL_ACCESS) {
   38.61 -			printf("\t\tB_PARALLEL_ACCESS\n");
   38.62 -		}
   38.63 -		if(bmode->flags & B_DPMS) {
   38.64 -			printf("\t\tB_DPMS\n");
   38.65 -		}
   38.66 -		if(bmode->flags & B_IO_FB_NA) {
   38.67 -			printf("\t\tB_IO_FB_NA\n");
   38.68 -		}
   38.69 -	}
   38.70 -	printf("\tTiming:\n");
   38.71 -	printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
   38.72 -	printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
   38.73 -		bmode->timing.h_display, bmode->timing.h_sync_start,
   38.74 -		bmode->timing.h_sync_end, bmode->timing.h_total);
   38.75 -	printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
   38.76 -		bmode->timing.v_display, bmode->timing.v_sync_start,
   38.77 -		bmode->timing.v_sync_end, bmode->timing.v_total);
   38.78 -	if(bmode->timing.flags) {
   38.79 -		printf("\t\tFlags:\n");
   38.80 -		if(bmode->timing.flags & B_BLANK_PEDESTAL) {
   38.81 -			printf("\t\t\tB_BLANK_PEDESTAL\n");
   38.82 -		}
   38.83 -		if(bmode->timing.flags & B_TIMING_INTERLACED) {
   38.84 -			printf("\t\t\tB_TIMING_INTERLACED\n");
   38.85 -		}
   38.86 -		if(bmode->timing.flags & B_POSITIVE_HSYNC) {
   38.87 -			printf("\t\t\tB_POSITIVE_HSYNC\n");
   38.88 -		}
   38.89 -		if(bmode->timing.flags & B_POSITIVE_VSYNC) {
   38.90 -			printf("\t\t\tB_POSITIVE_VSYNC\n");
   38.91 -		}
   38.92 -		if(bmode->timing.flags & B_SYNC_ON_GREEN) {
   38.93 -			printf("\t\t\tB_SYNC_ON_GREEN\n");
   38.94 -		}
   38.95 -	}
   38.96 +    printf("BMode:\n");
   38.97 +    printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
   38.98 +    printf("\th,v = (%i,%i)\n", bmode->h_display_start, 
   38.99 +            bmode->v_display_start);
  38.100 +    if(bmode->flags) {
  38.101 +        printf("\tFlags:\n");
  38.102 +        if(bmode->flags & B_SCROLL) {
  38.103 +            printf("\t\tB_SCROLL\n");
  38.104 +        }
  38.105 +        if(bmode->flags & B_8_BIT_DAC) {
  38.106 +            printf("\t\tB_8_BIT_DAC\n");
  38.107 +        }
  38.108 +        if(bmode->flags & B_HARDWARE_CURSOR) {
  38.109 +            printf("\t\tB_HARDWARE_CURSOR\n");
  38.110 +        }
  38.111 +        if(bmode->flags & B_PARALLEL_ACCESS) {
  38.112 +            printf("\t\tB_PARALLEL_ACCESS\n");
  38.113 +        }
  38.114 +        if(bmode->flags & B_DPMS) {
  38.115 +            printf("\t\tB_DPMS\n");
  38.116 +        }
  38.117 +        if(bmode->flags & B_IO_FB_NA) {
  38.118 +            printf("\t\tB_IO_FB_NA\n");
  38.119 +        }
  38.120 +    }
  38.121 +    printf("\tTiming:\n");
  38.122 +    printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
  38.123 +    printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
  38.124 +        bmode->timing.h_display, bmode->timing.h_sync_start,
  38.125 +        bmode->timing.h_sync_end, bmode->timing.h_total);
  38.126 +    printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
  38.127 +        bmode->timing.v_display, bmode->timing.v_sync_start,
  38.128 +        bmode->timing.v_sync_end, bmode->timing.v_total);
  38.129 +    if(bmode->timing.flags) {
  38.130 +        printf("\t\tFlags:\n");
  38.131 +        if(bmode->timing.flags & B_BLANK_PEDESTAL) {
  38.132 +            printf("\t\t\tB_BLANK_PEDESTAL\n");
  38.133 +        }
  38.134 +        if(bmode->timing.flags & B_TIMING_INTERLACED) {
  38.135 +            printf("\t\t\tB_TIMING_INTERLACED\n");
  38.136 +        }
  38.137 +        if(bmode->timing.flags & B_POSITIVE_HSYNC) {
  38.138 +            printf("\t\t\tB_POSITIVE_HSYNC\n");
  38.139 +        }
  38.140 +        if(bmode->timing.flags & B_POSITIVE_VSYNC) {
  38.141 +            printf("\t\t\tB_POSITIVE_VSYNC\n");
  38.142 +        }
  38.143 +        if(bmode->timing.flags & B_SYNC_ON_GREEN) {
  38.144 +            printf("\t\t\tB_SYNC_ON_GREEN\n");
  38.145 +        }
  38.146 +    }
  38.147  }
  38.148  #endif
  38.149  
  38.150 @@ -134,101 +134,101 @@
  38.151  
  38.152  int32 HAIKU_ColorSpaceToBitsPerPixel(uint32 colorspace)
  38.153  {
  38.154 -	int bitsperpixel;
  38.155 +    int bitsperpixel;
  38.156  
  38.157 -	bitsperpixel = 0;
  38.158 -	switch (colorspace) {
  38.159 -	    case B_CMAP8:
  38.160 -		bitsperpixel = 8;
  38.161 -		break;
  38.162 -	    case B_RGB15:
  38.163 -	    case B_RGBA15:
  38.164 -	    case B_RGB15_BIG:
  38.165 -	    case B_RGBA15_BIG:
  38.166 -		bitsperpixel = 15;
  38.167 -		break;
  38.168 -	    case B_RGB16:
  38.169 -	    case B_RGB16_BIG:
  38.170 -		bitsperpixel = 16;
  38.171 -		break;
  38.172 -	    case B_RGB32:
  38.173 -	    case B_RGBA32:
  38.174 -	    case B_RGB32_BIG:
  38.175 -	    case B_RGBA32_BIG:
  38.176 -		bitsperpixel = 32;
  38.177 -		break;
  38.178 -	    default:
  38.179 -		break;
  38.180 -	}
  38.181 -	return(bitsperpixel);
  38.182 +    bitsperpixel = 0;
  38.183 +    switch (colorspace) {
  38.184 +        case B_CMAP8:
  38.185 +        bitsperpixel = 8;
  38.186 +        break;
  38.187 +        case B_RGB15:
  38.188 +        case B_RGBA15:
  38.189 +        case B_RGB15_BIG:
  38.190 +        case B_RGBA15_BIG:
  38.191 +        bitsperpixel = 15;
  38.192 +        break;
  38.193 +        case B_RGB16:
  38.194 +        case B_RGB16_BIG:
  38.195 +        bitsperpixel = 16;
  38.196 +        break;
  38.197 +        case B_RGB32:
  38.198 +        case B_RGBA32:
  38.199 +        case B_RGB32_BIG:
  38.200 +        case B_RGBA32_BIG:
  38.201 +        bitsperpixel = 32;
  38.202 +        break;
  38.203 +        default:
  38.204 +        break;
  38.205 +    }
  38.206 +    return(bitsperpixel);
  38.207  }
  38.208  
  38.209  int32 HAIKU_BPPToSDLPxFormat(int32 bpp) {
  38.210 -	/* Translation taken from SDL_windowsmodes.c */
  38.211 -	switch (bpp) {
  38.212 -	case 32:
  38.213 -		return SDL_PIXELFORMAT_RGB888;
  38.214 -		break;
  38.215 -	case 24:	/* May not be supported by Haiku */
  38.216 -		return SDL_PIXELFORMAT_RGB24;
  38.217 -		break;
  38.218 -	case 16:
  38.219 -		return SDL_PIXELFORMAT_RGB565;
  38.220 -		break;
  38.221 -	case 15:
  38.222 -		return SDL_PIXELFORMAT_RGB555;
  38.223 -		break;
  38.224 -	case 8:
  38.225 -		return SDL_PIXELFORMAT_INDEX8;
  38.226 -		break;
  38.227 -	case 4:		/* May not be supported by Haiku */
  38.228 -		return SDL_PIXELFORMAT_INDEX4LSB;
  38.229 -		break;
  38.230 -	}
  38.231 +    /* Translation taken from SDL_windowsmodes.c */
  38.232 +    switch (bpp) {
  38.233 +    case 32:
  38.234 +        return SDL_PIXELFORMAT_RGB888;
  38.235 +        break;
  38.236 +    case 24:    /* May not be supported by Haiku */
  38.237 +        return SDL_PIXELFORMAT_RGB24;
  38.238 +        break;
  38.239 +    case 16:
  38.240 +        return SDL_PIXELFORMAT_RGB565;
  38.241 +        break;
  38.242 +    case 15:
  38.243 +        return SDL_PIXELFORMAT_RGB555;
  38.244 +        break;
  38.245 +    case 8:
  38.246 +        return SDL_PIXELFORMAT_INDEX8;
  38.247 +        break;
  38.248 +    case 4:        /* May not be supported by Haiku */
  38.249 +        return SDL_PIXELFORMAT_INDEX4LSB;
  38.250 +        break;
  38.251 +    }
  38.252  
  38.253 -	/* May never get here, but safer and needed to shut up compiler */
  38.254 -	SDL_SetError("Invalid bpp value");
  38.255 -	return 0;       
  38.256 +    /* May never get here, but safer and needed to shut up compiler */
  38.257 +    SDL_SetError("Invalid bpp value");
  38.258 +    return 0;       
  38.259  }
  38.260  
  38.261  static void _BDisplayModeToSdlDisplayMode(display_mode *bmode,
  38.262 -		SDL_DisplayMode *mode) {
  38.263 -	mode->w = bmode->virtual_width;
  38.264 -	mode->h = bmode->virtual_height;
  38.265 -	mode->refresh_rate = (int)get_refresh_rate(*bmode);
  38.266 +        SDL_DisplayMode *mode) {
  38.267 +    mode->w = bmode->virtual_width;
  38.268 +    mode->h = bmode->virtual_height;
  38.269 +    mode->refresh_rate = (int)get_refresh_rate(*bmode);
  38.270  
  38.271  #if WRAP_BMODE
  38.272 -	SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
  38.273 -		sizeof(SDL_DisplayModeData));
  38.274 -	data->bmode = bmode;
  38.275 -	
  38.276 -	mode->driverdata = data;
  38.277 +    SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
  38.278 +        sizeof(SDL_DisplayModeData));
  38.279 +    data->bmode = bmode;
  38.280 +    
  38.281 +    mode->driverdata = data;
  38.282  
  38.283  #else
  38.284  
  38.285 -	mode->driverdata = bmode;
  38.286 +    mode->driverdata = bmode;
  38.287  #endif
  38.288  
  38.289 -	/* Set the format */
  38.290 -	int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode->space);
  38.291 -	mode->format = HAIKU_BPPToSDLPxFormat(bpp);
  38.292 +    /* Set the format */
  38.293 +    int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode->space);
  38.294 +    mode->format = HAIKU_BPPToSDLPxFormat(bpp);
  38.295  }
  38.296  
  38.297  /* Later, there may be more than one monitor available */
  38.298  static void _AddDisplay(BScreen *screen) {
  38.299 -	SDL_VideoDisplay display;
  38.300 -	SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
  38.301 -		sizeof(SDL_DisplayMode));
  38.302 -	display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
  38.303 -	screen->GetMode(bmode);
  38.304 +    SDL_VideoDisplay display;
  38.305 +    SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
  38.306 +        sizeof(SDL_DisplayMode));
  38.307 +    display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
  38.308 +    screen->GetMode(bmode);
  38.309  
  38.310 -	_BDisplayModeToSdlDisplayMode(bmode, mode);
  38.311 -	
  38.312 -	SDL_zero(display);
  38.313 -	display.desktop_mode = *mode;
  38.314 -	display.current_mode = *mode;
  38.315 -	
  38.316 -	SDL_AddVideoDisplay(&display);
  38.317 +    _BDisplayModeToSdlDisplayMode(bmode, mode);
  38.318 +    
  38.319 +    SDL_zero(display);
  38.320 +    display.desktop_mode = *mode;
  38.321 +    display.current_mode = *mode;
  38.322 +    
  38.323 +    SDL_AddVideoDisplay(&display);
  38.324  }
  38.325  
  38.326  /*
  38.327 @@ -236,92 +236,92 @@
  38.328   */
  38.329  
  38.330  int HAIKU_InitModes(_THIS) {
  38.331 -	BScreen screen;
  38.332 +    BScreen screen;
  38.333  
  38.334 -	/* TODO: When Haiku supports multiple display screens, call
  38.335 -	   _AddDisplayScreen() for each of them. */
  38.336 -	_AddDisplay(&screen);
  38.337 -	return 0;
  38.338 +    /* TODO: When Haiku supports multiple display screens, call
  38.339 +       _AddDisplayScreen() for each of them. */
  38.340 +    _AddDisplay(&screen);
  38.341 +    return 0;
  38.342  }
  38.343  
  38.344  int HAIKU_QuitModes(_THIS) {
  38.345 -	/* FIXME: Nothing really needs to be done here at the moment? */
  38.346 -	return 0;
  38.347 +    /* FIXME: Nothing really needs to be done here at the moment? */
  38.348 +    return 0;
  38.349  }
  38.350  
  38.351  
  38.352  int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
  38.353 -	BScreen bscreen;
  38.354 -	BRect rc = bscreen.Frame();
  38.355 -	rect->x = (int)rc.left;
  38.356 -	rect->y = (int)rc.top;
  38.357 -	rect->w = (int)rc.Width() + 1;
  38.358 -	rect->h = (int)rc.Height() + 1;
  38.359 -	return 0;
  38.360 +    BScreen bscreen;
  38.361 +    BRect rc = bscreen.Frame();
  38.362 +    rect->x = (int)rc.left;
  38.363 +    rect->y = (int)rc.top;
  38.364 +    rect->w = (int)rc.Width() + 1;
  38.365 +    rect->h = (int)rc.Height() + 1;
  38.366 +    return 0;
  38.367  }
  38.368  
  38.369  void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
  38.370 -	/* Get the current screen */
  38.371 -	BScreen bscreen;
  38.372 +    /* Get the current screen */
  38.373 +    BScreen bscreen;
  38.374  
  38.375 -	/* Iterate through all of the modes */
  38.376 -	SDL_DisplayMode mode;
  38.377 -	display_mode this_bmode;
  38.378 -	display_mode *bmodes;
  38.379 -	uint32 count, i;
  38.380 -	
  38.381 -	/* Get graphics-hardware supported modes */
  38.382 -	bscreen.GetModeList(&bmodes, &count);
  38.383 -	bscreen.GetMode(&this_bmode);
  38.384 -	
  38.385 -	for(i = 0; i < count; ++i) {
  38.386 -		// FIXME: Apparently there are errors with colorspace changes
  38.387 -		if (bmodes[i].space == this_bmode.space) {
  38.388 -			_BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
  38.389 -			SDL_AddDisplayMode(display, &mode);
  38.390 -		}
  38.391 -	}
  38.392 -	free(bmodes);
  38.393 +    /* Iterate through all of the modes */
  38.394 +    SDL_DisplayMode mode;
  38.395 +    display_mode this_bmode;
  38.396 +    display_mode *bmodes;
  38.397 +    uint32 count, i;
  38.398 +    
  38.399 +    /* Get graphics-hardware supported modes */
  38.400 +    bscreen.GetModeList(&bmodes, &count);
  38.401 +    bscreen.GetMode(&this_bmode);
  38.402 +    
  38.403 +    for(i = 0; i < count; ++i) {
  38.404 +        // FIXME: Apparently there are errors with colorspace changes
  38.405 +        if (bmodes[i].space == this_bmode.space) {
  38.406 +            _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
  38.407 +            SDL_AddDisplayMode(display, &mode);
  38.408 +        }
  38.409 +    }
  38.410 +    free(bmodes);
  38.411  }
  38.412  
  38.413  
  38.414  int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
  38.415 -	/* Get the current screen */
  38.416 -	BScreen bscreen;
  38.417 -	if(!bscreen.IsValid()) {
  38.418 -		printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
  38.419 -	}
  38.420 +    /* Get the current screen */
  38.421 +    BScreen bscreen;
  38.422 +    if(!bscreen.IsValid()) {
  38.423 +        printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
  38.424 +    }
  38.425  
  38.426 -	/* Set the mode using the driver data */
  38.427 -	display_mode *bmode = _ExtractBMode(mode);
  38.428 +    /* Set the mode using the driver data */
  38.429 +    display_mode *bmode = _ExtractBMode(mode);
  38.430  
  38.431  
  38.432 -	/* FIXME: Is the first option always going to be the right one? */
  38.433 -	uint32 c = 0, i;
  38.434 -	display_mode *bmode_list;
  38.435 -	bscreen.GetModeList(&bmode_list, &c);
  38.436 -	for(i = 0; i < c; ++i) {
  38.437 -		if(	bmode_list[i].space == bmode->space &&
  38.438 -			bmode_list[i].virtual_width == bmode->virtual_width &&
  38.439 -			bmode_list[i].virtual_height == bmode->virtual_height ) {
  38.440 -				bmode = &bmode_list[i];
  38.441 -				break;
  38.442 -		}
  38.443 -	}
  38.444 +    /* FIXME: Is the first option always going to be the right one? */
  38.445 +    uint32 c = 0, i;
  38.446 +    display_mode *bmode_list;
  38.447 +    bscreen.GetModeList(&bmode_list, &c);
  38.448 +    for(i = 0; i < c; ++i) {
  38.449 +        if(    bmode_list[i].space == bmode->space &&
  38.450 +            bmode_list[i].virtual_width == bmode->virtual_width &&
  38.451 +            bmode_list[i].virtual_height == bmode->virtual_height ) {
  38.452 +                bmode = &bmode_list[i];
  38.453 +                break;
  38.454 +        }
  38.455 +    }
  38.456  
  38.457 -	if(bscreen.SetMode(bmode) != B_OK) {
  38.458 -		return SDL_SetError("Bad video mode");
  38.459 -	}
  38.460 -	
  38.461 -	free(bmode_list);
  38.462 -	
  38.463 +    if(bscreen.SetMode(bmode) != B_OK) {
  38.464 +        return SDL_SetError("Bad video mode");
  38.465 +    }
  38.466 +    
  38.467 +    free(bmode_list);
  38.468 +    
  38.469  #if SDL_VIDEO_OPENGL
  38.470 -	/* FIXME: Is there some way to reboot the OpenGL context?  This doesn't
  38.471 -	   help */
  38.472 -//	HAIKU_GL_RebootContexts(_this);
  38.473 +    /* FIXME: Is there some way to reboot the OpenGL context?  This doesn't
  38.474 +       help */
  38.475 +//    HAIKU_GL_RebootContexts(_this);
  38.476  #endif
  38.477  
  38.478 -	return 0;
  38.479 +    return 0;
  38.480  }
  38.481  
  38.482  #ifdef __cplusplus
    39.1 --- a/src/video/haiku/SDL_bvideo.cc	Sat Aug 18 17:23:40 2018 -0400
    39.2 +++ b/src/video/haiku/SDL_bvideo.cc	Mon Sep 24 11:49:25 2018 -0700
    39.3 @@ -56,7 +56,7 @@
    39.4      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    39.5  
    39.6      device->driverdata = NULL; /* FIXME: Is this the cause of some of the
    39.7 -    							  SDL_Quit() errors? */
    39.8 +                                  SDL_Quit() errors? */
    39.9  
   39.10  /* TODO: Figure out if any initialization needs to go here */
   39.11  
   39.12 @@ -122,37 +122,36 @@
   39.13  }
   39.14  
   39.15  VideoBootStrap HAIKU_bootstrap = {
   39.16 -	"haiku", "Haiku graphics",
   39.17 -	HAIKU_Available, HAIKU_CreateDevice
   39.18 +    "haiku", "Haiku graphics",
   39.19 +    HAIKU_Available, HAIKU_CreateDevice
   39.20  };
   39.21  
   39.22  void HAIKU_DeleteDevice(SDL_VideoDevice * device)
   39.23  {
   39.24 -	SDL_free(device->driverdata);
   39.25 -	SDL_free(device);
   39.26 +    SDL_free(device->driverdata);
   39.27 +    SDL_free(device);
   39.28  }
   39.29  
   39.30  int HAIKU_VideoInit(_THIS)
   39.31  {
   39.32 -	/* Initialize the Be Application for appserver interaction */
   39.33 -	if (SDL_InitBeApp() < 0) {
   39.34 -		return -1;
   39.35 -	}
   39.36 -	
   39.37 -	/* Initialize video modes */
   39.38 -	HAIKU_InitModes(_this);
   39.39 +    /* Initialize the Be Application for appserver interaction */
   39.40 +    if (SDL_InitBeApp() < 0) {
   39.41 +        return -1;
   39.42 +    }
   39.43 +    
   39.44 +    /* Initialize video modes */
   39.45 +    HAIKU_InitModes(_this);
   39.46  
   39.47 -	/* Init the keymap */
   39.48 -	HAIKU_InitOSKeymap();
   39.49 -	
   39.50 -	
   39.51 +    /* Init the keymap */
   39.52 +    HAIKU_InitOSKeymap();
   39.53 +
   39.54  #if SDL_VIDEO_OPENGL
   39.55          /* testgl application doesn't load library, just tries to load symbols */
   39.56          /* is it correct? if so we have to load library here */
   39.57      HAIKU_GL_LoadLibrary(_this, NULL);
   39.58  #endif
   39.59  
   39.60 -        /* We're done! */
   39.61 +    /* We're done! */
   39.62      return (0);
   39.63  }
   39.64  
    40.1 --- a/src/video/haiku/SDL_bwindow.cc	Sat Aug 18 17:23:40 2018 -0400
    40.2 +++ b/src/video/haiku/SDL_bwindow.cc	Mon Sep 24 11:49:25 2018 -0700
    40.3 @@ -32,36 +32,36 @@
    40.4  #endif
    40.5  
    40.6  static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
    40.7 -	return ((SDL_BWin*)(window->driverdata));
    40.8 +    return ((SDL_BWin*)(window->driverdata));
    40.9  }
   40.10  
   40.11  static SDL_INLINE SDL_BApp *_GetBeApp() {
   40.12 -	return ((SDL_BApp*)be_app);
   40.13 +    return ((SDL_BApp*)be_app);
   40.14  }
   40.15  
   40.16  static int _InitWindow(_THIS, SDL_Window *window) {
   40.17 -	uint32 flags = 0;
   40.18 -	window_look look = B_TITLED_WINDOW_LOOK;
   40.19 +    uint32 flags = 0;
   40.20 +    window_look look = B_TITLED_WINDOW_LOOK;
   40.21  
   40.22 -	BRect bounds(
   40.23 +    BRect bounds(
   40.24          window->x,
   40.25          window->y,
   40.26 -        window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
   40.27 +        window->x + window->w - 1,    //BeWindows have an off-by-one px w/h thing
   40.28          window->y + window->h - 1
   40.29      );
   40.30      
   40.31      if(window->flags & SDL_WINDOW_FULLSCREEN) {
   40.32 -    	/* TODO: Add support for this flag */
   40.33 -    	printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
   40.34 +        /* TODO: Add support for this flag */
   40.35 +        printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
   40.36      }
   40.37      if(window->flags & SDL_WINDOW_OPENGL) {
   40.38 -    	/* TODO: Add support for this flag */
   40.39 +        /* TODO: Add support for this flag */
   40.40      }
   40.41      if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
   40.42 -    	flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
   40.43 +        flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
   40.44      }
   40.45      if(window->flags & SDL_WINDOW_BORDERLESS) {
   40.46 -    	look = B_NO_BORDER_WINDOW_LOOK;
   40.47 +        look = B_NO_BORDER_WINDOW_LOOK;
   40.48      }
   40.49  
   40.50      SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags);
   40.51 @@ -79,35 +79,35 @@
   40.52      if (_InitWindow(_this, window) < 0) {
   40.53          return -1;
   40.54      }
   40.55 -	
   40.56 -	/* Start window loop */
   40.57 +    
   40.58 +    /* Start window loop */
   40.59      _ToBeWin(window)->Show();
   40.60      return 0;
   40.61  }
   40.62  
   40.63  int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
   40.64  
   40.65 -	SDL_BWin *otherBWin = (SDL_BWin*)data;
   40.66 -	if(!otherBWin->LockLooper())
   40.67 -		return -1;
   40.68 -	
   40.69 -	/* Create the new window and initialize its members */
   40.70 -	window->x = (int)otherBWin->Frame().left;
   40.71 -	window->y = (int)otherBWin->Frame().top;
   40.72 -	window->w = (int)otherBWin->Frame().Width();
   40.73 -	window->h = (int)otherBWin->Frame().Height();
   40.74 -	
   40.75 -	/* Set SDL flags */
   40.76 -	if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
   40.77 -		window->flags |= SDL_WINDOW_RESIZABLE;
   40.78 -	}
   40.79 -	
   40.80 -	/* If we are out of memory, return the error code */
   40.81 +    SDL_BWin *otherBWin = (SDL_BWin*)data;
   40.82 +    if(!otherBWin->LockLooper())
   40.83 +        return -1;
   40.84 +    
   40.85 +    /* Create the new window and initialize its members */
   40.86 +    window->x = (int)otherBWin->Frame().left;
   40.87 +    window->y = (int)otherBWin->Frame().top;
   40.88 +    window->w = (int)otherBWin->Frame().Width();
   40.89 +    window->h = (int)otherBWin->Frame().Height();
   40.90 +    
   40.91 +    /* Set SDL flags */
   40.92 +    if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
   40.93 +        window->flags |= SDL_WINDOW_RESIZABLE;
   40.94 +    }
   40.95 +    
   40.96 +    /* If we are out of memory, return the error code */
   40.97      if (_InitWindow(_this, window) < 0) {
   40.98          return -1;
   40.99      }
  40.100 -	
  40.101 -	/* TODO: Add any other SDL-supported window attributes here */
  40.102 +    
  40.103 +    /* TODO: Add any other SDL-supported window attributes here */
  40.104      _ToBeWin(window)->SetTitle(otherBWin->Title());
  40.105      
  40.106      /* Start window loop and unlock the other window */
  40.107 @@ -118,106 +118,106 @@
  40.108  }
  40.109  
  40.110  void HAIKU_SetWindowTitle(_THIS, SDL_Window * window) {
  40.111 -	BMessage msg(BWIN_SET_TITLE);
  40.112 -	msg.AddString("window-title", window->title);
  40.113 -	_ToBeWin(window)->PostMessage(&msg);
  40.114 +    BMessage msg(BWIN_SET_TITLE);
  40.115 +    msg.AddString("window-title", window->title);
  40.116 +    _ToBeWin(window)->PostMessage(&msg);
  40.117  }
  40.118  
  40.119  void HAIKU_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
  40.120 -	/* FIXME: Icons not supported by Haiku */
  40.121 +    /* FIXME: Icons not supported by Haiku */
  40.122  }
  40.123  
  40.124  void HAIKU_SetWindowPosition(_THIS, SDL_Window * window) {
  40.125 -	BMessage msg(BWIN_MOVE_WINDOW);
  40.126 -	msg.AddInt32("window-x", window->x);
  40.127 -	msg.AddInt32("window-y", window->y);
  40.128 -	_ToBeWin(window)->PostMessage(&msg);
  40.129 +    BMessage msg(BWIN_MOVE_WINDOW);
  40.130 +    msg.AddInt32("window-x", window->x);
  40.131 +    msg.AddInt32("window-y", window->y);
  40.132 +    _ToBeWin(window)->PostMessage(&msg);
  40.133  }
  40.134  
  40.135  void HAIKU_SetWindowSize(_THIS, SDL_Window * window) {
  40.136 -	BMessage msg(BWIN_RESIZE_WINDOW);
  40.137 -	msg.AddInt32("window-w", window->w - 1);
  40.138 -	msg.AddInt32("window-h", window->h - 1);
  40.139 -	_ToBeWin(window)->PostMessage(&msg);
  40.140 +    BMessage msg(BWIN_RESIZE_WINDOW);
  40.141 +    msg.AddInt32("window-w", window->w - 1);
  40.142 +    msg.AddInt32("window-h", window->h - 1);
  40.143 +    _ToBeWin(window)->PostMessage(&msg);
  40.144  }
  40.145  
  40.146  void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
  40.147 -	BMessage msg(BWIN_SET_BORDERED);
  40.148 -	msg.AddBool("window-border", bordered != SDL_FALSE);
  40.149 -	_ToBeWin(window)->PostMessage(&msg);
  40.150 +    BMessage msg(BWIN_SET_BORDERED);
  40.151 +    msg.AddBool("window-border", bordered != SDL_FALSE);
  40.152 +    _ToBeWin(window)->PostMessage(&msg);
  40.153  }
  40.154  
  40.155  void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) {
  40.156 -	BMessage msg(BWIN_SET_RESIZABLE);
  40.157 -	msg.AddBool("window-resizable", resizable != SDL_FALSE);
  40.158 -	_ToBeWin(window)->PostMessage(&msg);
  40.159 +    BMessage msg(BWIN_SET_RESIZABLE);
  40.160 +    msg.AddBool("window-resizable", resizable != SDL_FALSE);
  40.161 +    _ToBeWin(window)->PostMessage(&msg);
  40.162  }
  40.163  
  40.164  void HAIKU_ShowWindow(_THIS, SDL_Window * window) {
  40.165 -	BMessage msg(BWIN_SHOW_WINDOW);
  40.166 -	_ToBeWin(window)->PostMessage(&msg);
  40.167 +    BMessage msg(BWIN_SHOW_WINDOW);
  40.168 +    _ToBeWin(window)->PostMessage(&msg);
  40.169  }
  40.170  
  40.171  void HAIKU_HideWindow(_THIS, SDL_Window * window) {
  40.172 -	BMessage msg(BWIN_HIDE_WINDOW);
  40.173 -	_ToBeWin(window)->PostMessage(&msg);
  40.174 +    BMessage msg(BWIN_HIDE_WINDOW);
  40.175 +    _ToBeWin(window)->PostMessage(&msg);
  40.176  }
  40.177  
  40.178  void HAIKU_RaiseWindow(_THIS, SDL_Window * window) {
  40.179 -	BMessage msg(BWIN_SHOW_WINDOW);	/* Activate this window and move to front */
  40.180 -	_ToBeWin(window)->PostMessage(&msg);
  40.181 +    BMessage msg(BWIN_SHOW_WINDOW);    /* Activate this window and move to front */
  40.182 +    _ToBeWin(window)->PostMessage(&msg);
  40.183  }
  40.184  
  40.185  void HAIKU_MaximizeWindow(_THIS, SDL_Window * window) {
  40.186 -	BMessage msg(BWIN_MAXIMIZE_WINDOW);
  40.187 -	_ToBeWin(window)->PostMessage(&msg);
  40.188 +    BMessage msg(BWIN_MAXIMIZE_WINDOW);
  40.189 +    _ToBeWin(window)->PostMessage(&msg);
  40.190  }
  40.191  
  40.192  void HAIKU_MinimizeWindow(_THIS, SDL_Window * window) {
  40.193 -	BMessage msg(BWIN_MINIMIZE_WINDOW);
  40.194 -	_ToBeWin(window)->PostMessage(&msg);
  40.195 +    BMessage msg(BWIN_MINIMIZE_WINDOW);
  40.196 +    _ToBeWin(window)->PostMessage(&msg);
  40.197  }
  40.198  
  40.199  void HAIKU_RestoreWindow(_THIS, SDL_Window * window) {
  40.200 -	BMessage msg(BWIN_RESTORE_WINDOW);
  40.201 -	_ToBeWin(window)->PostMessage(&msg);
  40.202 +    BMessage msg(BWIN_RESTORE_WINDOW);
  40.203 +    _ToBeWin(window)->PostMessage(&msg);
  40.204  }
  40.205  
  40.206  void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window,
  40.207 -		SDL_VideoDisplay * display, SDL_bool fullscreen) {
  40.208 -	/* Haiku tracks all video display information */
  40.209 -	BMessage msg(BWIN_FULLSCREEN);
  40.210 -	msg.AddBool("fullscreen", fullscreen);
  40.211 -	_ToBeWin(window)->PostMessage(&msg);
  40.212 -	
  40.213 +        SDL_VideoDisplay * display, SDL_bool fullscreen) {
  40.214 +    /* Haiku tracks all video display information */
  40.215 +    BMessage msg(BWIN_FULLSCREEN);
  40.216 +    msg.AddBool("fullscreen", fullscreen);
  40.217 +    _ToBeWin(window)->PostMessage(&msg);
  40.218 +    
  40.219  }
  40.220  
  40.221  int HAIKU_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
  40.222 -	/* FIXME: Not Haiku supported */
  40.223 -	return -1;
  40.224 +    /* FIXME: Not Haiku supported */
  40.225 +    return -1;
  40.226  }
  40.227  
  40.228  int HAIKU_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
  40.229 -	/* FIXME: Not Haiku supported */
  40.230 -	return -1;
  40.231 +    /* FIXME: Not Haiku supported */
  40.232 +    return -1;
  40.233  }
  40.234  
  40.235  
  40.236  void HAIKU_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
  40.237 -	/* TODO: Implement this! */
  40.238 +    /* TODO: Implement this! */
  40.239  }
  40.240  
  40.241  void HAIKU_DestroyWindow(_THIS, SDL_Window * window) {
  40.242 -	_ToBeWin(window)->LockLooper();	/* This MUST be locked */
  40.243 -	_GetBeApp()->ClearID(_ToBeWin(window));
  40.244 -	_ToBeWin(window)->Quit();
  40.245 -	window->driverdata = NULL;
  40.246 +    _ToBeWin(window)->LockLooper();    /* This MUST be locked */
  40.247 +    _GetBeApp()->ClearID(_ToBeWin(window));
  40.248 +    _ToBeWin(window)->Quit();
  40.249 +    window->driverdata = NULL;
  40.250  }
  40.251  
  40.252  SDL_bool HAIKU_GetWindowWMInfo(_THIS, SDL_Window * window,
  40.253                                      struct SDL_SysWMinfo *info) {
  40.254 -	/* FIXME: What is the point of this? What information should be included? */
  40.255 -	return SDL_FALSE;
  40.256 +    /* FIXME: What is the point of this? What information should be included? */
  40.257 +    return SDL_FALSE;
  40.258  }
  40.259  
  40.260  
    41.1 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c	Sat Aug 18 17:23:40 2018 -0400
    41.2 +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c	Mon Sep 24 11:49:25 2018 -0700
    41.3 @@ -487,12 +487,12 @@
    41.4         That's why we move the cursor graphic ONLY. */
    41.5      if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {
    41.6          curdata = (KMSDRM_CursorData *) mouse->cur_cursor->driverdata;
    41.7 -	drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(curdata->bo));
    41.8 -	ret = KMSDRM_drmModeMoveCursor(drm_fd, curdata->crtc_id, mouse->x, mouse->y);
    41.9 +        drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(curdata->bo));
   41.10 +        ret = KMSDRM_drmModeMoveCursor(drm_fd, curdata->crtc_id, mouse->x, mouse->y);
   41.11  
   41.12 -	if (ret) {
   41.13 -	    SDL_SetError("drmModeMoveCursor() failed.");
   41.14 -	}
   41.15 +        if (ret) {
   41.16 +            SDL_SetError("drmModeMoveCursor() failed.");
   41.17 +        }
   41.18      }
   41.19  }
   41.20  
    42.1 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c	Sat Aug 18 17:23:40 2018 -0400
    42.2 +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c	Mon Sep 24 11:49:25 2018 -0700
    42.3 @@ -50,23 +50,23 @@
    42.4      KMSDRM_FBInfo *fb_info;
    42.5  
    42.6      if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) {
    42.7 -	SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed on CRTC setup");
    42.8 -	return SDL_FALSE;
    42.9 +        SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed on CRTC setup");
   42.10 +        return SDL_FALSE;
   42.11      }
   42.12  
   42.13      wdata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(wdata->gs);
   42.14      if (wdata->next_bo == NULL) {
   42.15 -	SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not lock GBM surface front buffer on CRTC setup");
   42.16 -	return SDL_FALSE;
   42.17 +        SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not lock GBM surface front buffer on CRTC setup");
   42.18 +        return SDL_FALSE;
   42.19      }
   42.20  
   42.21      fb_info = KMSDRM_FBFromBO(_this, wdata->next_bo);
   42.22      if (fb_info == NULL) {
   42.23 -	return SDL_FALSE;
   42.24 +        return SDL_FALSE;
   42.25      }
   42.26  
   42.27      if(KMSDRM_drmModeSetCrtc(vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id,
   42.28 -			    0, 0, &vdata->saved_conn_id, 1, &displaydata->cur_mode) != 0) {
   42.29 +                            0, 0, &vdata->saved_conn_id, 1, &displaydata->cur_mode) != 0) {
   42.30         SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC to a GBM buffer");
   42.31         return SDL_FALSE;
   42.32  
   42.33 @@ -153,14 +153,14 @@
   42.34      } else {
   42.35          /* Queue page flip at vsync */
   42.36  
   42.37 -	/* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not,
   42.38 +        /* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not,
   42.39             or FlipPage won't work in some cases. */
   42.40 -	if (!wdata->crtc_ready) {
   42.41 +        if (!wdata->crtc_ready) {
   42.42              if(!KMSDRM_GLES_SetupCrtc(_this, window)) {
   42.43                  SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC for doing vsync-ed pageflips");
   42.44                  return 0;
   42.45              }
   42.46 -	}
   42.47 +        }
   42.48  
   42.49          /* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "drmModePageFlip(%d, %u, %u, DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip)",
   42.50              vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id); */
    43.1 --- a/src/video/raspberry/SDL_rpivideo.c	Sat Aug 18 17:23:40 2018 -0400
    43.2 +++ b/src/video/raspberry/SDL_rpivideo.c	Mon Sep 24 11:49:25 2018 -0700
    43.3 @@ -343,17 +343,17 @@
    43.4      SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
    43.5  
    43.6      if(data) {
    43.7 -	if (data->double_buffer) {
    43.8 -	    /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */
    43.9 -	    SDL_LockMutex(data->vsync_cond_mutex);
   43.10 -	    SDL_CondWait(data->vsync_cond, data->vsync_cond_mutex);
   43.11 -	    SDL_UnlockMutex(data->vsync_cond_mutex);
   43.12 +        if (data->double_buffer) {
   43.13 +            /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */
   43.14 +            SDL_LockMutex(data->vsync_cond_mutex);
   43.15 +            SDL_CondWait(data->vsync_cond, data->vsync_cond_mutex);
   43.16 +            SDL_UnlockMutex(data->vsync_cond_mutex);
   43.17  
   43.18 -	    vc_dispmanx_vsync_callback(displaydata->dispman_display, NULL, NULL);
   43.19 +            vc_dispmanx_vsync_callback(displaydata->dispman_display, NULL, NULL);
   43.20  
   43.21 -	    SDL_DestroyCond(data->vsync_cond);
   43.22 -	    SDL_DestroyMutex(data->vsync_cond_mutex);
   43.23 -	}
   43.24 +            SDL_DestroyCond(data->vsync_cond);
   43.25 +            SDL_DestroyMutex(data->vsync_cond_mutex);
   43.26 +        }
   43.27  
   43.28  #if SDL_VIDEO_OPENGL_EGL
   43.29          if (data->egl_surface != EGL_NO_SURFACE) {
    44.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Sat Aug 18 17:23:40 2018 -0400
    44.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Mon Sep 24 11:49:25 2018 -0700
    44.3 @@ -445,7 +445,7 @@
    44.4  #if !TARGET_OS_TV
    44.5  - (void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation
    44.6  {
    44.7 -	SDL_OnApplicationDidChangeStatusBarOrientation();
    44.8 +    SDL_OnApplicationDidChangeStatusBarOrientation();
    44.9  }
   44.10  #endif
   44.11  
    45.1 --- a/src/video/uikit/SDL_uikitmodes.m	Sat Aug 18 17:23:40 2018 -0400
    45.2 +++ b/src/video/uikit/SDL_uikitmodes.m	Mon Sep 24 11:49:25 2018 -0700
    45.3 @@ -191,7 +191,7 @@
    45.4              }
    45.5          }
    45.6  #if !TARGET_OS_TV
    45.7 -		SDL_OnApplicationDidChangeStatusBarOrientation();
    45.8 +        SDL_OnApplicationDidChangeStatusBarOrientation();
    45.9  #endif
   45.10      }
   45.11  
    46.1 --- a/src/video/uikit/SDL_uikitview.m	Sat Aug 18 17:23:40 2018 -0400
    46.2 +++ b/src/video/uikit/SDL_uikitview.m	Mon Sep 24 11:49:25 2018 -0700
    46.3 @@ -252,34 +252,34 @@
    46.4  
    46.5  - (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
    46.6  {
    46.7 -	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
    46.8 -    	for (UIPress *press in presses) {
    46.9 -        	SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.10 -        	SDL_SendKeyboardKey(SDL_PRESSED, scancode);
   46.11 -    	}
   46.12 -	}
   46.13 +    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
   46.14 +        for (UIPress *press in presses) {
   46.15 +            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.16 +            SDL_SendKeyboardKey(SDL_PRESSED, scancode);
   46.17 +        }
   46.18 +    }
   46.19      [super pressesBegan:presses withEvent:event];
   46.20  }
   46.21  
   46.22  - (void)pressesEnded:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   46.23  {
   46.24 -	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
   46.25 -		for (UIPress *press in presses) {
   46.26 -			SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.27 -			SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   46.28 -		}
   46.29 -	}
   46.30 +    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
   46.31 +        for (UIPress *press in presses) {
   46.32 +            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.33 +            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   46.34 +        }
   46.35 +    }
   46.36      [super pressesEnded:presses withEvent:event];
   46.37  }
   46.38  
   46.39  - (void)pressesCancelled:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
   46.40  {
   46.41 -	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
   46.42 -		for (UIPress *press in presses) {
   46.43 -			SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.44 -			SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   46.45 -		}
   46.46 -	}
   46.47 +    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
   46.48 +        for (UIPress *press in presses) {
   46.49 +            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
   46.50 +            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
   46.51 +        }
   46.52 +    }
   46.53      [super pressesCancelled:presses withEvent:event];
   46.54  }
   46.55  
    47.1 --- a/src/video/wayland/SDL_waylandevents.c	Sat Aug 18 17:23:40 2018 -0400
    47.2 +++ b/src/video/wayland/SDL_waylandevents.c	Mon Sep 24 11:49:25 2018 -0700
    47.3 @@ -747,7 +747,7 @@
    47.4  
    47.5  static void
    47.6  data_device_handle_data_offer(void *data, struct wl_data_device *wl_data_device,
    47.7 -			                  struct wl_data_offer *id)
    47.8 +                              struct wl_data_offer *id)
    47.9  {
   47.10      SDL_WaylandDataOffer *data_offer = NULL;
   47.11  
   47.12 @@ -765,7 +765,7 @@
   47.13  
   47.14  static void
   47.15  data_device_handle_enter(void *data, struct wl_data_device *wl_data_device,
   47.16 -		                 uint32_t serial, struct wl_surface *surface,
   47.17 +                         uint32_t serial, struct wl_surface *surface,
   47.18                           wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)
   47.19  {
   47.20      SDL_WaylandDataDevice *data_device = data;
   47.21 @@ -808,7 +808,7 @@
   47.22  
   47.23  static void
   47.24  data_device_handle_motion(void *data, struct wl_data_device *wl_data_device,
   47.25 -		                  uint32_t time, wl_fixed_t x, wl_fixed_t y)
   47.26 +                          uint32_t time, wl_fixed_t x, wl_fixed_t y)
   47.27  {
   47.28  }
   47.29  
   47.30 @@ -847,7 +847,7 @@
   47.31  
   47.32  static void
   47.33  data_device_handle_selection(void *data, struct wl_data_device *wl_data_device,
   47.34 -			                 struct wl_data_offer *id)
   47.35 +                             struct wl_data_offer *id)
   47.36  {    
   47.37      SDL_WaylandDataDevice *data_device = data;
   47.38      SDL_WaylandDataOffer *offer = NULL;
    48.1 --- a/src/video/wayland/SDL_waylandtouch.c	Sat Aug 18 17:23:40 2018 -0400
    48.2 +++ b/src/video/wayland/SDL_waylandtouch.c	Mon Sep 24 11:49:25 2018 -0700
    48.3 @@ -89,9 +89,9 @@
    48.4      */
    48.5  
    48.6      SDL_TouchID deviceId = 1;
    48.7 -	if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) {
    48.8 -		 SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
    48.9 -	}
   48.10 +    if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) {
   48.11 +         SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
   48.12 +    }
   48.13  
   48.14      switch (touchState) {
   48.15          case QtWaylandTouchPointPressed:
    49.1 --- a/src/video/wayland/SDL_waylandvideo.c	Sat Aug 18 17:23:40 2018 -0400
    49.2 +++ b/src/video/wayland/SDL_waylandvideo.c	Mon Sep 24 11:49:25 2018 -0700
    49.3 @@ -68,10 +68,10 @@
    49.4  get_classname()
    49.5  {
    49.6  /* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec:
    49.7 -	"The surface class identifies the general class of applications
    49.8 -	to which the surface belongs. A common convention is to use the
    49.9 -	file name (or the full path if it is a non-standard location) of
   49.10 -	the application's .desktop file as the class." */
   49.11 +    "The surface class identifies the general class of applications
   49.12 +    to which the surface belongs. A common convention is to use the
   49.13 +    file name (or the full path if it is a non-standard location) of
   49.14 +    the application's .desktop file as the class." */
   49.15  
   49.16      char *spot;
   49.17  #if defined(__LINUX__) || defined(__FREEBSD__)
    50.1 --- a/src/video/wayland/SDL_waylandwindow.c	Sat Aug 18 17:23:40 2018 -0400
    50.2 +++ b/src/video/wayland/SDL_waylandwindow.c	Mon Sep 24 11:49:25 2018 -0700
    50.3 @@ -134,10 +134,10 @@
    50.4  
    50.5  static void
    50.6  handle_configure_zxdg_toplevel(void *data,
    50.7 -			  struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
    50.8 -			  int32_t width,
    50.9 -			  int32_t height,
   50.10 -			  struct wl_array *states)
   50.11 +              struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
   50.12 +              int32_t width,
   50.13 +              int32_t height,
   50.14 +              struct wl_array *states)
   50.15  {
   50.16      SDL_WindowData *wind = (SDL_WindowData *)data;
   50.17      SDL_Window *window = wind->sdlwindow;
   50.18 @@ -213,10 +213,10 @@
   50.19  
   50.20  static void
   50.21  handle_configure_xdg_toplevel(void *data,
   50.22 -			  struct xdg_toplevel *xdg_toplevel,
   50.23 -			  int32_t width,
   50.24 -			  int32_t height,
   50.25 -			  struct wl_array *states)
   50.26 +              struct xdg_toplevel *xdg_toplevel,
   50.27 +              int32_t width,
   50.28 +              int32_t height,
   50.29 +              struct wl_array *states)
   50.30  {
   50.31      SDL_WindowData *wind = (SDL_WindowData *)data;
   50.32      SDL_Window *window = wind->sdlwindow;
    51.1 --- a/src/video/windows/SDL_windowsopengl.h	Sat Aug 18 17:23:40 2018 -0400
    51.2 +++ b/src/video/windows/SDL_windowsopengl.h	Mon Sep 24 11:49:25 2018 -0700
    51.3 @@ -33,31 +33,31 @@
    51.4      SDL_bool HAS_WGL_ARB_create_context_robustness;
    51.5      SDL_bool HAS_WGL_ARB_create_context_no_error;
    51.6  
    51.7 -	/* Max version of OpenGL ES context that can be created if the
    51.8 -	   implementation supports WGL_EXT_create_context_es2_profile.
    51.9 -	   major = minor = 0 when unsupported.
   51.10 -	 */
   51.11 -	struct {
   51.12 -		int major;
   51.13 -		int minor;
   51.14 -	} es_profile_max_supported_version;
   51.15 +    /* Max version of OpenGL ES context that can be created if the
   51.16 +       implementation supports WGL_EXT_create_context_es2_profile.
   51.17 +       major = minor = 0 when unsupported.
   51.18 +     */
   51.19 +    struct {
   51.20 +        int major;
   51.21 +        int minor;
   51.22 +    } es_profile_max_supported_version;
   51.23  
   51.24 -	void *(WINAPI * wglGetProcAddress) (const char *proc);
   51.25 -      HGLRC(WINAPI * wglCreateContext) (HDC hdc);
   51.26 -      BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
   51.27 -      BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
   51.28 -      BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
   51.29 -      BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
   51.30 -                                              const int *piAttribIList,
   51.31 -                                              const FLOAT * pfAttribFList,
   51.32 -                                              UINT nMaxFormats,
   51.33 -                                              int *piFormats,
   51.34 -                                              UINT * nNumFormats);
   51.35 -      BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
   51.36 -                                                   int iLayerPlane,
   51.37 -                                                   UINT nAttributes,
   51.38 -                                                   const int *piAttributes,
   51.39 -                                                   int *piValues);
   51.40 +    void *(WINAPI * wglGetProcAddress) (const char *proc);
   51.41 +    HGLRC(WINAPI * wglCreateContext) (HDC hdc);
   51.42 +    BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
   51.43 +    BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
   51.44 +    BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
   51.45 +    BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
   51.46 +                                            const int *piAttribIList,
   51.47 +                                            const FLOAT * pfAttribFList,
   51.48 +                                            UINT nMaxFormats,
   51.49 +                                            int *piFormats,
   51.50 +                                            UINT * nNumFormats);
   51.51 +    BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
   51.52 +                                                 int iLayerPlane,
   51.53 +                                                 UINT nAttributes,
   51.54 +                                                 const int *piAttributes,
   51.55 +                                                 int *piValues);
   51.56      BOOL (WINAPI * wglSwapIntervalEXT) (int interval);
   51.57      int (WINAPI * wglGetSwapIntervalEXT) (void);
   51.58  };
    52.1 --- a/src/video/windows/SDL_windowsvulkan.c	Sat Aug 18 17:23:40 2018 -0400
    52.2 +++ b/src/video/windows/SDL_windowsvulkan.c	Mon Sep 24 11:49:25 2018 -0700
    52.3 @@ -40,7 +40,7 @@
    52.4  {
    52.5      VkExtensionProperties *extensions = NULL;
    52.6      Uint32 extensionCount = 0;
    52.7 -	Uint32 i;
    52.8 +    Uint32 i;
    52.9      SDL_bool hasSurfaceExtension = SDL_FALSE;
   52.10      SDL_bool hasWin32SurfaceExtension = SDL_FALSE;
   52.11      PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL;
    53.1 --- a/src/video/x11/SDL_x11opengl.h	Sat Aug 18 17:23:40 2018 -0400
    53.2 +++ b/src/video/x11/SDL_x11opengl.h	Mon Sep 24 11:49:25 2018 -0700
    53.3 @@ -38,14 +38,14 @@
    53.4      SDL_bool HAS_GLX_ARB_create_context_robustness;
    53.5      SDL_bool HAS_GLX_ARB_create_context_no_error;
    53.6  
    53.7 -	/* Max version of OpenGL ES context that can be created if the
    53.8 -	   implementation supports GLX_EXT_create_context_es2_profile.
    53.9 -	   major = minor = 0 when unsupported.
   53.10 -	 */
   53.11 -	struct {
   53.12 -		int major;
   53.13 -		int minor;
   53.14 -	} es_profile_max_supported_version;
   53.15 +    /* Max version of OpenGL ES context that can be created if the
   53.16 +       implementation supports GLX_EXT_create_context_es2_profile.
   53.17 +       major = minor = 0 when unsupported.
   53.18 +     */
   53.19 +    struct {
   53.20 +        int major;
   53.21 +        int minor;
   53.22 +    } es_profile_max_supported_version;
   53.23  
   53.24      Bool (*glXQueryExtension) (Display*,int*,int*);
   53.25      void *(*glXGetProcAddress) (const GLubyte*);
    54.1 --- a/src/video/x11/SDL_x11sym.h	Sat Aug 18 17:23:40 2018 -0400
    54.2 +++ b/src/video/x11/SDL_x11sym.h	Mon Sep 24 11:49:25 2018 -0700
    54.3 @@ -45,7 +45,7 @@
    54.4  SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
    54.5  SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
    54.6  SDL_X11_SYM(Cursor,XCreateFontCursor,(Display* a,unsigned int b),(a,b),return)
    54.7 -SDL_X11_SYM(XFontSet,XCreateFontSet,(Display* a, _Xconst char* b, char*** c, int* d, char**	e),(a,b,c,d,e),return)
    54.8 +SDL_X11_SYM(XFontSet,XCreateFontSet,(Display* a, _Xconst char* b, char*** c, int* d, char** e),(a,b,c,d,e),return)
    54.9  SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
   54.10  SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
   54.11  SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
   54.12 @@ -201,7 +201,7 @@
   54.13  SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
   54.14  SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
   54.15  SDL_X11_SYM(void,Xutf8DrawString,(Display *a, Drawable b, XFontSet c, GC d, int e, int f, _Xconst char *g, int h),(a,b,c,d,e,f,g,h),)
   54.16 -SDL_X11_SYM(int,Xutf8TextExtents,(XFontSet a, _Xconst char*	b, int c, XRectangle* d, XRectangle* e),(a,b,c,d,e),return)
   54.17 +SDL_X11_SYM(int,Xutf8TextExtents,(XFontSet a, _Xconst char* b, int c, XRectangle* d, XRectangle* e),(a,b,c,d,e),return)
   54.18  SDL_X11_SYM(char*,XSetLocaleModifiers,(const char *a),(a),return)
   54.19  SDL_X11_SYM(char*,Xutf8ResetIC,(XIC a),(a),return)
   54.20  #endif