(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};

This commit is contained in:
rubidium
2007-03-07 12:11:48 +00:00
parent 36bb92ae24
commit 24c4d5b06d
138 changed files with 779 additions and 789 deletions

View File

@@ -1,24 +1,24 @@
/* $Id$ */
typedef struct {
struct AiDefaultBlockData {
byte mode;
byte attr;
TileIndexDiffC tileoffs;
} AiDefaultBlockData;
};
typedef struct {
struct AiDefaultRailBlock {
byte p0;
byte p1;
byte p2;
byte p3;
byte dir;
const AiDefaultBlockData *data;
} AiDefaultRailBlock;
};
typedef struct {
struct AiDefaultRoadBlock {
byte dir;
const AiDefaultBlockData *data;
} AiDefaultRoadBlock;
};
#define MKHDR(a,b,c,d,e) a,b,c,d,e,

View File

@@ -1068,7 +1068,7 @@ static const IndustryTileTable * const _tile_table_sugar_mine[] = {
/* Procedures that can be run to check whether an industry may
* build at location the given to the procedure */
typedef enum CheckProcs {
enum CheckProc {
CHECK_NOTHING = 0,
CHECK_FOREST = 1,
CHECK_REFINERY = 2,
@@ -1079,7 +1079,7 @@ typedef enum CheckProcs {
CHECK_BUBBLEGEN = 7,
CHECK_OIL_RIG = 8,
CHECK_END,
} CheckProc;
};
#define MK(tbl, d, c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, in, s1, s2, s3) \
{tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \

View File

@@ -7,23 +7,23 @@
/** Tile Location group.
* This defines whether the X and or Y coordinate of a tile is even */
typedef enum TLG {
enum TLG {
XEVEN_YEVEN = 0,
XEVEN_YODD = 1,
XODD_YEVEN = 2,
XODD_YODD = 3,
TLG_END
} TLG;
};
/** When determining the pylon configuration on the edge, two tiles are taken
* into account: the tile being drawn itself (the home tile, the one in
* ti->tile), and the neighbouring tile */
typedef enum {
enum TileSource {
TS_HOME = 0,
TS_NEIGHBOUR = 1,
TS_END
} TileSource;
};
enum {
NUM_TRACKS_AT_PCP = 6
@@ -253,7 +253,7 @@ static const SpriteID pylons_bridge[] = {
SPR_PYLON_Y_SW
};
typedef struct {
struct SortableSpriteStruct {
SpriteID image;
int8 x_offset;
int8 y_offset;
@@ -261,7 +261,7 @@ typedef struct {
int8 y_size;
int8 z_size;
int8 z_offset;
} SortableSpriteStruct;
};
enum {
/** Distance between wire and rail */
@@ -351,7 +351,7 @@ static const SortableSpriteStruct CatenarySpriteData_Depot[] = {
* <li>Position of the Pylon relative to the track</li>
* <li>Position of the Pylon inside the tile</li></ol>
*/
typedef enum {
enum CatenarySprite {
WIRE_X_FLAT_SW,
WIRE_X_FLAT_NE,
WIRE_X_FLAT_BOTH,
@@ -395,7 +395,7 @@ typedef enum {
WIRE_EW_S_E,
INVALID_CATENARY = 0xFF
} CatenarySprite;
};
/* Selects a Wire (with white and grey ends) depending on whether:
* a) none (should never happen)

View File

@@ -1,17 +1,17 @@
/* $Id$ */
typedef struct DrawIndustrySpec1Struct {
struct DrawIndustrySpec1Struct {
byte x;
byte image_1;
byte image_2;
byte image_3;
} DrawIndustrySpec1Struct;
};
typedef struct DrawIndustrySpec4Struct {
struct DrawIndustrySpec4Struct {
byte image_1;
byte image_2;
byte image_3;
} DrawIndustrySpec4Struct;
};
#define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w - 1, h - 1, dz, p }

View File

@@ -1690,7 +1690,7 @@ static const char *name_czech_real[] = {
* with cloning this for your own language. */
// Sing., pl.
typedef enum CzechGender {
enum CzechGender {
CZG_SMASC,
CZG_SFEM,
CZG_SNEUT,
@@ -1701,12 +1701,14 @@ typedef enum CzechGender {
CZG_FREE,
// Like CZG_FREE, but disallow CZG_SNEUT.
CZG_NFREE
} CzechGender;
typedef enum CzechPattern {
};
enum CzechPattern {
CZP_JARNI,
CZP_MLADY,
CZP_PRIVL
} CzechPattern;
};
/* [CzechGender][CzechPattern] - replaces the last character of the adjective
* by this. */
// XXX: [CZG_SMASC][CZP_PRIVL] needs special handling: -ovX -> -uv.
@@ -1721,38 +1723,38 @@ static const char *name_czech_patmod[][3] = {
// This way the substantives can choose only some adjectives/endings:
// At least one of these flags must be satisfied:
typedef enum CzechAllow {
enum CzechAllow {
CZA_SHORT = 1,
CZA_MIDDLE = 2,
CZA_LONG = 4,
CZA_ALL = ~0
} CzechAllow;
};
DECLARE_ENUM_AS_BIT_SET(CzechAllow);
// All these flags must be satisfied (in the stem->others direction):
typedef enum CzechChoose {
enum CzechChoose {
CZC_NONE = 0, // No requirements.
CZC_COLOR = 1,
CZC_POSTFIX = 2, // Matched if postfix was inserted.
CZC_NOPOSTFIX = 4, // Matched if no postfix was inserted.
CZC_ANY = ~0
} CzechChoose;
};
DECLARE_ENUM_AS_BIT_SET(CzechChoose);
typedef struct CzechNameSubst {
struct CzechNameSubst {
CzechGender gender;
CzechAllow allow;
CzechChoose choose;
const char *name;
} CzechNameSubst;
};
typedef struct CzechNameAdj {
struct CzechNameAdj {
CzechPattern pattern;
CzechChoose choose;
const char *name;
} CzechNameAdj;
};
// Some of items which should be common are doubled.
static const CzechNameAdj name_czech_adj[] = {

View File

@@ -141,7 +141,7 @@ static const Colour _palettes[][256] = {
#define GET_PALETTE(x) _palettes[x]
typedef struct {
struct ExtraPaletteValues {
Colour a[15]; // dark blue water
Colour ac[15]; // dark blue water Toyland
Colour lighthouse[12]; // lighthouse & stadium
@@ -149,7 +149,7 @@ typedef struct {
Colour e[15]; // ???
Colour b[45]; // glittery water
Colour bc[45]; // glittery water Toyland
} ExtraPaletteValues;
};
static const ExtraPaletteValues _extra_palette_values = {
{ M( 32, 68, 112), M( 36, 72, 116), M( 40, 76, 120), M( 44, 80, 124),
@@ -173,10 +173,10 @@ static const ExtraPaletteValues _extra_palette_values = {
#undef M
// Color table for colors in lang files (e.g. {BLACK})
typedef struct StringColor {
struct StringColor {
byte text;
byte shadow;
} StringColor;
};
static const StringColor _string_colormap[] = {
{ 150, 215 }, // BLUE

View File

@@ -1191,7 +1191,7 @@ enum Sprites {
};
/** Cursor sprite numbers */
typedef enum CursorSprites {
enum CursorSprite {
/* Terraform */
/* Cursors */
SPR_CURSOR_MOUSE = 0,
@@ -1278,7 +1278,7 @@ typedef enum CursorSprites {
SPR_CURSOR_CLONE_ROADVEH = SPR_OPENTTD_BASE + 110,
SPR_CURSOR_CLONE_SHIP = SPR_OPENTTD_BASE + 112,
SPR_CURSOR_CLONE_AIRPLANE = SPR_OPENTTD_BASE + 114,
} CursorSprite;
};
/// Animation macro in table/animcursors.h (_animcursors[])
enum AnimCursors {

View File

@@ -2017,9 +2017,9 @@ static const uint16 _housetype_remove_ratingmod[] = {
assert_compile(lengthof(_housetype_remove_ratingmod) == HOUSE_MAX);
typedef struct {
struct HousetypeYear {
Year min, max;
} HousetypeYear;
};
static const HousetypeYear _housetype_years[] = {
{ 1963, MAX_YEAR },

View File

@@ -13,10 +13,10 @@ static const SpriteID _tree_sprites_1[] = {
static const byte _tree_base_by_landscape[4] = {0, 12, 20, 32};
static const byte _tree_count_by_landscape[4] = {12, 8, 12, 9};
typedef struct TreePos {
struct TreePos {
uint8 x;
uint8 y;
} TreePos;
};
static const TreePos _tree_layout_xy[][4] = {
{ { 9, 3 }, { 1, 8 }, { 0, 0 }, { 8, 9 } },

View File

@@ -1,10 +1,10 @@
/* $Id$ */
typedef struct DefaultUnicodeMapping {
struct DefaultUnicodeMapping {
WChar code; ///< Unicode value
byte key; ///< Character index of sprite
} DefaultUnicodeMapping;
};
/* Default unicode mapping table for sprite based glyphs.

View File

@@ -1,6 +1,6 @@
/* $Id$ */
typedef struct DrawTileUnmovableStruct {
struct DrawTileUnmovableStruct {
uint16 image;
byte subcoord_x;
byte subcoord_y;
@@ -8,7 +8,7 @@ typedef struct DrawTileUnmovableStruct {
byte height;
byte z_size;
byte unused;
} DrawTileUnmovableStruct;
};
#define TILE_SEQ_END() { (byte)0x80, 0, 0, 0, 0, 0, 0, 0 }

View File

@@ -1,6 +1,6 @@
/* $Id$ */
typedef struct WaterDrawTileStruct {
struct WaterDrawTileStruct {
byte delta_x;
byte delta_y;
byte delta_z;
@@ -8,7 +8,7 @@ typedef struct WaterDrawTileStruct {
byte height;
byte unk;
SpriteID image;
} WaterDrawTileStruct;
};
#define BEGIN(image) { 0, 0, 0, 0, 0, 0, image }
#define END(y) { 0x80, y, 0, 0, 0, 0, 0 }