- Index: src/core/endian_func.hpp
- ===================================================================
- --- src/core/endian_func.hpp (revision 27893)
- +++ src/core/endian_func.hpp (working copy)
- @@ -40,6 +40,9 @@
- #define TO_LE32X(x) (x)
- #endif /* TTD_ENDIAN == TTD_BIG_ENDIAN */
- +#define SHORTSTR16(a, b) TO_LE16(a | b << 8)
- +#define SHORTSTR32(a, b, c, d) TO_LE32(a | b << 8 | c << 16 | d << 24)
- +
- static inline uint16 ReadLE16Aligned(const void *x)
- {
- return FROM_LE16(*(const uint16*)x);
- Index: src/rail_type.h
- ===================================================================
- --- src/rail_type.h (revision 27893)
- +++ src/rail_type.h (working copy)
- @@ -16,10 +16,10 @@
- typedef uint32 RailTypeLabel;
- -static const RailTypeLabel RAILTYPE_RAIL_LABEL = 'RAIL';
- -static const RailTypeLabel RAILTYPE_ELECTRIC_LABEL = 'ELRL';
- -static const RailTypeLabel RAILTYPE_MONO_LABEL = 'MONO';
- -static const RailTypeLabel RAILTYPE_MAGLEV_LABEL = 'MGLV';
- +static const RailTypeLabel RAILTYPE_RAIL_LABEL = SHORT_STR32('R', 'A', 'I', 'L');
- +static const RailTypeLabel RAILTYPE_ELECTRIC_LABEL = SHORT_STR32('E', 'L', 'R', 'L');
- +static const RailTypeLabel RAILTYPE_MONO_LABEL = SHORT_STR32('M', 'O', 'N', 'O');
- +static const RailTypeLabel RAILTYPE_MAGLEV_LABEL = SHORT_STR32('M', 'G', 'L', 'V');
- /**
- * Enumeration for all possible railtypes.
- Index: src/screenshot.cpp
- ===================================================================
- --- src/screenshot.cpp (revision 27893)
- +++ src/screenshot.cpp (working copy)
- @@ -137,7 +137,7 @@
- /* Setup the file header */
- BitmapFileHeader bfh;
- - bfh.type = TO_LE16('MB');
- + bfh.type = SHORT_STR16('B', 'M');
- bfh.size = TO_LE32(sizeof(BitmapFileHeader) + sizeof(BitmapInfoHeader) + pal_size + bytewidth * h);
- bfh.reserved = 0;
- bfh.off_bits = TO_LE32(sizeof(BitmapFileHeader) + sizeof(BitmapInfoHeader) + pal_size);