Changeset - r27738:d4cc5b5820ad
[Not reviewed]
master
0 2 0
Rubidium - 14 months ago 2023-04-28 17:31:42
rubidium@openttd.org
Cleanup: remove typedefs for non _t (u)int types and WChar
2 files changed with 4 insertions and 16 deletions:
0 comments (0 inline, 0 general)
src/stdafx.h
Show inline comments
 
@@ -295,35 +295,26 @@ typedef uint8_t byte;
 

	
 
/* This is already defined in unix, but not in QNX Neutrino (6.x) or Cygwin. */
 
#if (!defined(UNIX) && !defined(__HAIKU__)) || defined(__QNXNTO__) || defined(__CYGWIN__)
 
	typedef unsigned int uint;
 
#endif
 

	
 
typedef uint8_t  uint8;
 
typedef  int8_t   int8;
 
typedef uint16_t uint16;
 
typedef  int16_t  int16;
 
typedef uint32_t uint32;
 
typedef  int32_t  int32;
 
typedef uint64_t uint64;
 
typedef  int64_t  int64;
 

	
 
#if !defined(WITH_PERSONAL_DIR)
 
#	define PERSONAL_DIR ""
 
#endif
 

	
 
/* Define the the platforms that use XDG */
 
#if defined(WITH_PERSONAL_DIR) && defined(UNIX) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
 
#	define USE_XDG
 
#endif
 

	
 
/* Check if the types have the bitsizes like we are using them */
 
static_assert(sizeof(uint64) == 8);
 
static_assert(sizeof(uint32) == 4);
 
static_assert(sizeof(uint16) == 2);
 
static_assert(sizeof(uint8)  == 1);
 
static_assert(sizeof(uint64_t) == 8);
 
static_assert(sizeof(uint32_t) == 4);
 
static_assert(sizeof(uint16_t) == 2);
 
static_assert(sizeof(uint8_t)  == 1);
 
static_assert(SIZE_MAX >= UINT32_MAX);
 

	
 
#ifndef M_PI_2
 
#define M_PI_2 1.57079632679489661923
 
#define M_PI   3.14159265358979323846
 
#endif /* M_PI_2 */
src/string_type.h
Show inline comments
 
@@ -27,15 +27,12 @@ enum CharSetFilter {
 
	CS_NUMERAL_SPACE,     ///< Only numbers and spaces
 
	CS_NUMERAL_SIGNED,    ///< Only numbers and '-' for negative values
 
	CS_ALPHA,             ///< Only alphabetic values
 
	CS_HEXADECIMAL,       ///< Only hexadecimal characters
 
};
 

	
 
/** Type for wide characters, i.e. non-UTF8 encoded unicode characters. */
 
typedef char32_t WChar;
 

	
 
/* The following are directional formatting codes used to get the LTR and RTL strings right:
 
 * http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
 
static const char32_t CHAR_TD_LRM = 0x200E; ///< The next character acts like a left-to-right character.
 
static const char32_t CHAR_TD_RLM = 0x200F; ///< The next character acts like a right-to-left character.
 
static const char32_t CHAR_TD_LRE = 0x202A; ///< The following text is embedded left-to-right.
 
static const char32_t CHAR_TD_RLE = 0x202B; ///< The following text is embedded right-to-left.
0 comments (0 inline, 0 general)