From a0934a23fd0c308a58ec0b7c908829980f34fb6b Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Thu, 10 Oct 2019 17:40:00 +0200 Subject: [PATCH] Fixed bug 4813 - Give enums their own name * SDL_PIXELTYPE_ * SDL_BITMAPORDER_ * SDL_PACKEDORDER_ * SDL_ARRAYORDER_ * SDL_PACKEDLAYOUT_ * SDLK_ * SDL_LOG_CATEGORY_ --- include/SDL_keycode.h | 4 ++-- include/SDL_log.h | 4 ++-- include/SDL_pixels.h | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/SDL_keycode.h b/include/SDL_keycode.h index 3bceb418a..850119ce7 100644 --- a/include/SDL_keycode.h +++ b/include/SDL_keycode.h @@ -47,7 +47,7 @@ typedef Sint32 SDL_Keycode; #define SDLK_SCANCODE_MASK (1<<30) #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) -enum +typedef enum { SDLK_UNKNOWN = 0, @@ -317,7 +317,7 @@ enum SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD) -}; +} SDL_KeyCodeEnum; /** * \brief Enumeration of valid key mods (possibly OR'd together). diff --git a/include/SDL_log.h b/include/SDL_log.h index 40f768d57..febc69a37 100644 --- a/include/SDL_log.h +++ b/include/SDL_log.h @@ -61,7 +61,7 @@ extern "C" { * at the VERBOSE level and all other categories are enabled at the * CRITICAL level. */ -enum +typedef enum { SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_CATEGORY_ERROR, @@ -94,7 +94,7 @@ enum }; */ SDL_LOG_CATEGORY_CUSTOM -}; +} SDL_LogCategoryEnum; /** * \brief The predefined log priorities diff --git a/include/SDL_pixels.h b/include/SDL_pixels.h index dcb7a980d..ac1e6cc41 100644 --- a/include/SDL_pixels.h +++ b/include/SDL_pixels.h @@ -48,7 +48,7 @@ extern "C" { /* @} */ /** Pixel type. */ -enum +typedef enum { SDL_PIXELTYPE_UNKNOWN, SDL_PIXELTYPE_INDEX1, @@ -62,18 +62,18 @@ enum SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, SDL_PIXELTYPE_ARRAYF32 -}; +} SDL_PixelTypeEnum; /** Bitmap pixel order, high bit -> low bit. */ -enum +typedef enum { SDL_BITMAPORDER_NONE, SDL_BITMAPORDER_4321, SDL_BITMAPORDER_1234 -}; +} SDL_BitmapOrderEnum; /** Packed component order, high bit -> low bit. */ -enum +typedef enum { SDL_PACKEDORDER_NONE, SDL_PACKEDORDER_XRGB, @@ -84,12 +84,12 @@ enum SDL_PACKEDORDER_BGRX, SDL_PACKEDORDER_ABGR, SDL_PACKEDORDER_BGRA -}; +} SDL_PackedOrderEnum; /** Array component order, low byte -> high byte. */ /* !!! FIXME: in 2.1, make these not overlap differently with !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ -enum +typedef enum { SDL_ARRAYORDER_NONE, SDL_ARRAYORDER_RGB, @@ -98,10 +98,10 @@ enum SDL_ARRAYORDER_BGR, SDL_ARRAYORDER_BGRA, SDL_ARRAYORDER_ABGR -}; +} SDL_ArrayOrderEnum; /** Packed component layout. */ -enum +typedef enum { SDL_PACKEDLAYOUT_NONE, SDL_PACKEDLAYOUT_332, @@ -112,7 +112,7 @@ enum SDL_PACKEDLAYOUT_8888, SDL_PACKEDLAYOUT_2101010, SDL_PACKEDLAYOUT_1010102 -}; +} SDL_PackedLayoutEnum; #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)