From 9c6e217f29bb0a76ec153574a3d493b020e5fb60 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 29 May 2010 08:12:39 +0000 Subject: [PATCH] Doom plugin: In anticipation of moving to the EABI toolchain, because of its assumptions about enums being sized as ints, convert enum typdefs to int or unsigned depending upon whether they have negative values in the enumeration. This should effectively preserve the manner in which it is compiled under the old toolchain and avoids having to closely inspect and possibly change many places in the code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26368 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/doom/am_map.c | 2 +- apps/plugins/doom/d_event.h | 15 ++-- apps/plugins/doom/d_net.h | 11 +-- apps/plugins/doom/d_player.h | 10 ++- apps/plugins/doom/doomdef.h | 56 ++++++++------ apps/plugins/doom/doomstat.h | 5 +- apps/plugins/doom/doomtype.h | 16 +--- apps/plugins/doom/info.h | 15 ++-- apps/plugins/doom/m_menu.c | 24 ++++-- apps/plugins/doom/m_menu.h | 6 +- apps/plugins/doom/m_misc.h | 22 +++--- apps/plugins/doom/m_random.h | 5 +- apps/plugins/doom/p_enemy.c | 5 +- apps/plugins/doom/p_pspr.h | 5 +- apps/plugins/doom/p_saveg.c | 8 +- apps/plugins/doom/p_spec.h | 143 ++++++++++++++++++++--------------- apps/plugins/doom/p_tick.h | 5 +- apps/plugins/doom/r_defs.h | 21 ++--- apps/plugins/doom/sounds.h | 10 ++- apps/plugins/doom/st_stuff.h | 10 ++- apps/plugins/doom/v_video.c | 10 +-- apps/plugins/doom/v_video.h | 18 +++-- apps/plugins/doom/w_wad.h | 19 +++-- apps/plugins/doom/wi_stuff.c | 5 +- apps/plugins/doom/wi_stuff.h | 5 +- 25 files changed, 260 insertions(+), 191 deletions(-) diff --git a/apps/plugins/doom/am_map.c b/apps/plugins/doom/am_map.c index eb4e13279e..ff74e9938f 100644 --- a/apps/plugins/doom/am_map.c +++ b/apps/plugins/doom/am_map.c @@ -194,7 +194,7 @@ int ddt_cheating = 0; // killough 2/7/98: make global, rename to ddt_* static int leveljuststarted = 1; // kluge until AM_LevelInit() is called -enum automapmode_e automapmode; // Mode that the automap is in +automapmode_e automapmode; // Mode that the automap is in // location of window on screen static int f_x; diff --git a/apps/plugins/doom/d_event.h b/apps/plugins/doom/d_event.h index 6896fd5c37..b9b42a3989 100644 --- a/apps/plugins/doom/d_event.h +++ b/apps/plugins/doom/d_event.h @@ -42,13 +42,14 @@ // // Input event types. -typedef enum +enum { ev_keydown, ev_keyup, ev_mouse, ev_joystick -} evtype_t; +}; +typedef int evtype_t; // Event structure. typedef struct @@ -60,7 +61,7 @@ typedef struct } event_t; -typedef enum +enum { ga_nothing, ga_loadlevel, @@ -71,14 +72,15 @@ typedef enum ga_completed, ga_victory, ga_worlddone, -} gameaction_t; +}; +typedef unsigned gameaction_t; // // Button/action code definitions. // -typedef enum +enum { // Press "Fire". BT_ATTACK = 1, @@ -111,7 +113,8 @@ typedef enum BTS_SAVEMASK = (4+8+16), BTS_SAVESHIFT = 2, -} buttoncode_t; +}; +typedef unsigned buttoncode_t; // diff --git a/apps/plugins/doom/d_net.h b/apps/plugins/doom/d_net.h index 6b586e3c96..e43aaf112f 100644 --- a/apps/plugins/doom/d_net.h +++ b/apps/plugins/doom/d_net.h @@ -58,12 +58,12 @@ // Networking and tick handling related. #define BACKUPTICS 12 -typedef enum +enum { CMD_SEND = 1, CMD_GET = 2 - -} command_t; +}; +typedef unsigned command_t; // @@ -125,11 +125,12 @@ typedef struct char filler[sizeof(ticcmd_t)*BACKUPTICS-STARTUPLEN]; } startup_t; -typedef enum { +enum { // Leave space, so low values corresponding to normal netgame setup packets can be ignored nm_plcolour = 3, nm_savegamename = 4, -} netmisctype_t; +}; +typedef unsigned netmisctype_t; typedef struct { diff --git a/apps/plugins/doom/d_player.h b/apps/plugins/doom/d_player.h index f86b68f9be..974d0b22ba 100644 --- a/apps/plugins/doom/d_player.h +++ b/apps/plugins/doom/d_player.h @@ -58,7 +58,7 @@ // // Player states. // -typedef enum +enum { // Playing or camping. PST_LIVE, @@ -67,13 +67,14 @@ typedef enum // Ready to restart/respawn??? PST_REBORN -} playerstate_t; +}; +typedef unsigned playerstate_t; // // Player internal flags, for cheats and debug. // -typedef enum +enum { // No clipping, walk through barriers. CF_NOCLIP = 1, @@ -82,7 +83,8 @@ typedef enum // Not really a cheat, just a debug aid. CF_NOMOMENTUM = 4 -} cheat_t; +}; +typedef unsigned cheat_t; // diff --git a/apps/plugins/doom/doomdef.h b/apps/plugins/doom/doomdef.h index a0e8ad50bc..05346cd443 100644 --- a/apps/plugins/doom/doomdef.h +++ b/apps/plugins/doom/doomdef.h @@ -48,30 +48,33 @@ enum { DVERSION = 110 }; // Game mode handling - identify IWAD version // to handle IWAD dependend animations etc. -typedef enum { +enum { shareware, // DOOM 1 shareware, E1, M9 registered, // DOOM 1 registered, E3, M27 commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled) retail, // DOOM 1 retail, E4, M36 indetermined // Well, no IWAD found. -} GameMode_t; +}; +typedef unsigned GameMode_t; // Mission packs - might be useful for TC stuff? -typedef enum { +enum { doom, // DOOM 1 doom2, // DOOM 2 pack_tnt, // TNT mission pack pack_plut, // Plutonia pack none -} GameMission_t; +}; +typedef unsigned GameMission_t; // Identify language to use, software localization. -typedef enum { +enum { english, french, german, unknown -} Language_t; +}; +typedef unsigned Language_t; // // For resize of screen, at start of game. @@ -122,12 +125,13 @@ extern int SCREENHEIGHT; // The current state of the game: whether we are playing, gazing // at the intermission screen, the game final animation, or a demo. -typedef enum { +enum { GS_LEVEL, GS_INTERMISSION, GS_FINALE, GS_DEMOSCREEN -} gamestate_t; +}; +typedef unsigned gamestate_t; // // Difficulty/skill settings/filters. @@ -147,20 +151,21 @@ typedef enum { #define MTF_FRIEND 128 #define MTF_RESERVED 256 -typedef enum { +enum { sk_none=-1, //jff 3/24/98 create unpicked skill setting sk_baby=0, sk_easy, sk_medium, sk_hard, sk_nightmare -} skill_t; +}; +typedef int skill_t; // // Key cards. // -typedef enum { +enum { it_bluecard, it_yellowcard, it_redcard, @@ -168,11 +173,12 @@ typedef enum { it_yellowskull, it_redskull, NUMCARDS -} card_t; +}; +typedef unsigned card_t; // The defined weapons, including a marker // indicating user has not changed weapon. -typedef enum { +enum { wp_fist, wp_pistol, wp_shotgun, @@ -185,20 +191,23 @@ typedef enum { NUMWEAPONS, wp_nochange // No pending weapon change. -} weapontype_t; +}; +typedef unsigned weapontype_t; // Ammunition types defined. -typedef enum { +enum { am_clip, // Pistol / chaingun ammo. am_shell, // Shotgun / double barreled shotgun. am_cell, // Plasma rifle, BFG. am_misl, // Missile launcher. NUMAMMO, am_noammo // Unlimited for chainsaw / fist. -} ammotype_t; +}; + +typedef unsigned ammotype_t; // Power up artifacts. -typedef enum { +enum { pw_invulnerability, pw_strength, pw_invisibility, @@ -206,15 +215,17 @@ typedef enum { pw_allmap, pw_infrared, NUMPOWERS -} powertype_t; +}; +typedef unsigned powertype_t; // Power up durations (how many seconds till expiration). -typedef enum { +enum { INVULNTICS = (30*TICRATE), INVISTICS = (60*TICRATE), INFRATICS = (120*TICRATE), IRONTICS = (60*TICRATE) -} powerduration_t; +}; +typedef unsigned powerduration_t; // // DOOM keyboard definition. @@ -289,7 +300,7 @@ typedef enum { // Defines Setup Screen groups that config variables appear in. // Used when resetting the defaults for every item in a Setup group. -typedef enum { +enum { ss_none, ss_keys, ss_weap, @@ -301,7 +312,8 @@ typedef enum { ss_gen, /* killough 10/98 */ ss_comp, /* killough 10/98 */ ss_max -} ss_types; +}; +typedef unsigned ss_types; // phares 3/20/98: // diff --git a/apps/plugins/doom/doomstat.h b/apps/plugins/doom/doomstat.h index 5a5a87c3c5..a89a4e547f 100644 --- a/apps/plugins/doom/doomstat.h +++ b/apps/plugins/doom/doomstat.h @@ -52,14 +52,15 @@ extern boolean fastparm; // checkparm of -fast extern boolean devparm; // DEBUG: launched with -devparm -enum automapmode_e { +enum { am_active = 1, // currently shown am_overlay= 2, // covers the screen, i.e. not overlay mode am_rotate = 4, // rotates to the player facing direction am_follow = 8, // keep the player centred am_grid =16, // show grid }; -extern enum automapmode_e automapmode; // Mode that the automap is in +typedef int automapmode_e; +extern automapmode_e automapmode; // Mode that the automap is in // ----------------------------------------------------- // Game Mode - identify IWAD as shareware, retail etc. diff --git a/apps/plugins/doom/doomtype.h b/apps/plugins/doom/doomtype.h index 59b33758da..22e3ec6009 100644 --- a/apps/plugins/doom/doomtype.h +++ b/apps/plugins/doom/doomtype.h @@ -33,18 +33,9 @@ #define __DOOMTYPE__ #include "rockmacros.h" -#ifndef __BYTEBOOL__ -#define __BYTEBOOL__ // Fixed to use builtin bool type with C++. -#ifdef __cplusplus -typedef bool boolean; -#else -//typedef enum {false, true} boolean; -//#define boolean bool -typedef enum _boolean { FALSE, TRUE } boolean; -#endif +typedef unsigned int boolean; typedef unsigned char byte; -#endif typedef signed long long int_64_t; typedef unsigned long long uint_64_t; @@ -63,7 +54,7 @@ typedef unsigned long long uint_64_t; #define MINLONG ((long)0x80000000) /* cph - move compatibility levels here so we can use them in d_server.c */ -typedef enum { +enum { doom_12_compatibility, /* Behave like early doom versions */ doom_demo_compatibility, /* As compatible as possible for * playing original Doom demos */ @@ -80,6 +71,7 @@ typedef enum { /* Aliases follow */ boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */ best_compatibility = prboom_3_compatibility, -} complevel_t; +}; +typedef unsigned complevel_t; #endif diff --git a/apps/plugins/doom/info.h b/apps/plugins/doom/info.h index d6c20f0d5d..d498c40c3d 100644 --- a/apps/plugins/doom/info.h +++ b/apps/plugins/doom/info.h @@ -41,7 +41,7 @@ /******************************************************************** * Sprite name enumeration - must match info.c * ********************************************************************/ -typedef enum +enum { SPR_TROO, SPR_SHTG, @@ -188,13 +188,14 @@ typedef enum #endif NUMSPRITES -} spritenum_t; +}; +typedef unsigned spritenum_t; /******************************************************************** * States (frames) enumeration -- must match info.c * ********************************************************************/ -typedef enum +enum { S_NULL, S_LIGHTDONE, @@ -1204,7 +1205,8 @@ typedef enum NUMSTATES /* Counter of how many there are */ -} statenum_t; +}; +typedef unsigned statenum_t; /******************************************************************** * Definition of the state (frames) structure * @@ -1230,7 +1232,7 @@ extern const char *sprnames[NUMSPRITES+1]; /* 1/17/98 killough - CPhipps - const * Note that many of these are generically named for the ornamentals */ -typedef enum { +enum { MT_PLAYER, MT_POSSESSED, MT_SHOTGUY, @@ -1391,7 +1393,8 @@ typedef enum { MT_STEALTHZOMBIE, NUMMOBJTYPES -} mobjtype_t; +}; +typedef unsigned mobjtype_t; /******************************************************************** * Definition of the Thing structure diff --git a/apps/plugins/doom/m_menu.c b/apps/plugins/doom/m_menu.c index 14d8474cbf..b0b0f9fff8 100644 --- a/apps/plugins/doom/m_menu.c +++ b/apps/plugins/doom/m_menu.c @@ -246,7 +246,8 @@ enum readthis, quitdoom, main_end -} main_e; +}; +unsigned main_e; menuitem_t MainMenu[]= { @@ -280,7 +281,8 @@ enum ep3, ep4, ep_end -} episodes_e; +}; +unsigned episodes_e; menuitem_t EpisodeMenu[]= { @@ -311,7 +313,8 @@ enum violence, nightmare, newg_end -} newgame_e; +}; +unsigned newgame_e; menuitem_t NewGameMenu[]= { @@ -347,7 +350,8 @@ enum option_empty2, soundvol, opt_end -} options_e; +}; +unsigned options_e; menuitem_t OptionsMenu[]= { @@ -377,7 +381,8 @@ enum { rdthsempty1, read1_end -} read_e; +}; +unsigned read_e; menuitem_t ReadMenu1[] = { @@ -398,7 +403,8 @@ enum { rdthsempty2, read2_end -} read_e2; +}; +unsigned read_e2; menuitem_t ReadMenu2[]= { @@ -427,7 +433,8 @@ enum system_vol, sfx_empty3, sound_end -} sound_e; +}; +unsigned sound_e; menuitem_t SoundMenu[]= { @@ -461,7 +468,8 @@ enum load5, load6, load_end -} load_e; +}; +unsigned load_e; menuitem_t LoadMenu[]= { diff --git a/apps/plugins/doom/m_menu.h b/apps/plugins/doom/m_menu.h index 8444b72a5f..da360c0147 100644 --- a/apps/plugins/doom/m_menu.h +++ b/apps/plugins/doom/m_menu.h @@ -60,13 +60,13 @@ void M_StartControlPanel (void); * The setup_group enum is used to show which 'groups' keys fall into so * that you can bind a key differently in each 'group'. */ - -typedef enum { +enum { m_null, // Has no meaning; not applicable m_scrn, // A key can not be assigned to more than one action m_map, // in the same group. A key can be assigned to one m_menu, // action in one group, and another action in another. -} setup_group; +}; +typedef unsigned setup_group; /**************************** * diff --git a/apps/plugins/doom/m_misc.h b/apps/plugins/doom/m_misc.h index 25eb8540c0..3ea6af987f 100644 --- a/apps/plugins/doom/m_misc.h +++ b/apps/plugins/doom/m_misc.h @@ -61,6 +61,17 @@ struct default_s *M_LookupDefault(const char *name); /* killough 11/98 */ // CPhipps - struct to hold a value in a config file // Cannot be a union, as it must be initialised +enum { + def_none, // Dummy entry + def_str, // A string + def_int, // Integer + def_hex, // Integer (write in hex) + def_bool = def_int, // Boolean + def_key = def_hex, // Key code (byte) + def_mouseb = def_int,// Mouse button + def_colour = def_hex // Colour (256 colour palette entry) +}; /* type */ + typedef struct default_s { const char* name; @@ -84,16 +95,7 @@ typedef struct default_s // Limits (for an int) int minvalue; // jff 3/3/98 minimum allowed value int maxvalue; // jff 3/3/98 maximum allowed value - enum { - def_none, // Dummy entry - def_str, // A string - def_int, // Integer - def_hex, // Integer (write in hex) - def_bool = def_int, // Boolean - def_key = def_hex, // Key code (byte) - def_mouseb = def_int,// Mouse button - def_colour = def_hex // Colour (256 colour palette entry) - } type; // CPhipps - type of entry + unsigned type; // CPhipps - type of entry int setupscreen; // phares 4/19/98: setup screen where this appears int *current; /* cph - MBF-like pointer to current value */ // cph - removed the help strings from the config file diff --git a/apps/plugins/doom/m_random.h b/apps/plugins/doom/m_random.h index 67c1a3ba4b..b99dd1793c 100644 --- a/apps/plugins/doom/m_random.h +++ b/apps/plugins/doom/m_random.h @@ -57,7 +57,7 @@ // indicated by the #'s, because they're critical for preserving demo // sync. Do not remove entries simply because they become unused later. -typedef enum { +enum { pr_skullfly, // #1 pr_damage, // #2 pr_crush, // #3 @@ -124,7 +124,8 @@ typedef enum { // End of new entries NUMPRCLASS // MUST be last item in list -} pr_class_t; +}; +typedef unsigned pr_class_t; // The random number generator's state. typedef struct { diff --git a/apps/plugins/doom/p_enemy.c b/apps/plugins/doom/p_enemy.c index 5b3f958146..9300315a10 100644 --- a/apps/plugins/doom/p_enemy.c +++ b/apps/plugins/doom/p_enemy.c @@ -50,7 +50,7 @@ static mobj_t *current_actor; -typedef enum { +enum { DI_EAST, DI_NORTHEAST, DI_NORTH, @@ -61,7 +61,8 @@ typedef enum { DI_SOUTHEAST, DI_NODIR, NUMDIRS -} dirtype_t; +}; +typedef unsigned dirtype_t; void A_Fall(mobj_t *actor); void A_FaceTarget(mobj_t *actor); diff --git a/apps/plugins/doom/p_pspr.h b/apps/plugins/doom/p_pspr.h index bb6517c4e1..6e6608a753 100644 --- a/apps/plugins/doom/p_pspr.h +++ b/apps/plugins/doom/p_pspr.h @@ -65,12 +65,13 @@ * coordinates are given for a 320*200 view screen. */ -typedef enum +enum { ps_weapon, ps_flash, NUMPSPRITES -} psprnum_t; +}; +typedef unsigned psprnum_t; typedef struct { diff --git a/apps/plugins/doom/p_saveg.c b/apps/plugins/doom/p_saveg.c index 1b73593879..a704bfa83c 100644 --- a/apps/plugins/doom/p_saveg.c +++ b/apps/plugins/doom/p_saveg.c @@ -248,10 +248,11 @@ void P_UnArchiveWorld (void) // Thinkers // -typedef enum { +enum { tc_end, tc_mobj -} thinkerclass_t; +}; +typedef unsigned thinkerclass_t; // phares 9/13/98: Moved this code outside of P_ArchiveThinkers so the // thinker indices could be used by the code that saves sector info. @@ -527,7 +528,8 @@ enum { tc_pusher, // phares 3/22/98: new push/pull effect thinker tc_flicker, // killough 10/4/98 tc_endspecials -} specials_e; +}; +unsigned specials_e; // // Things to handle: diff --git a/apps/plugins/doom/p_spec.h b/apps/plugins/doom/p_spec.h index 426e7db50d..7ab787c7d8 100644 --- a/apps/plugins/doom/p_spec.h +++ b/apps/plugins/doom/p_spec.h @@ -193,7 +193,7 @@ // define names for the TriggerType field of the general linedefs -typedef enum +enum { WalkOnce, WalkMany, @@ -203,21 +203,23 @@ typedef enum GunMany, PushOnce, PushMany, -} triggertype_e; +}; +typedef unsigned triggertype_e; // define names for the Speed field of the general linedefs -typedef enum +enum { SpeedSlow, SpeedNormal, SpeedFast, SpeedTurbo, -} motionspeed_e; +}; +typedef unsigned motionspeed_e; // define names for the Target field of the general floor -typedef enum +enum { FtoHnF, FtoLnF, @@ -227,29 +229,32 @@ typedef enum FbyST, Fby24, Fby32, -} floortarget_e; +}; +typedef unsigned floortarget_e; // define names for the Changer Type field of the general floor -typedef enum +enum { FNoChg, FChgZero, FChgTxt, FChgTyp, -} floorchange_e; +}; +typedef unsigned floorchange_e; // define names for the Change Model field of the general floor -typedef enum +enum { FTriggerModel, FNumericModel, -} floormodel_t; +}; +typedef unsigned floormodel_t; // define names for the Target field of the general ceiling -typedef enum +enum { CtoHnC, CtoLnC, @@ -259,49 +264,54 @@ typedef enum CbyST, Cby24, Cby32, -} ceilingtarget_e; +}; +typedef unsigned ceilingtarget_e; // define names for the Changer Type field of the general ceiling -typedef enum +enum { CNoChg, CChgZero, CChgTxt, CChgTyp, -} ceilingchange_e; +}; +typedef unsigned ceilingchange_e; // define names for the Change Model field of the general ceiling -typedef enum +enum { CTriggerModel, CNumericModel, -} ceilingmodel_t; +}; +typedef unsigned ceilingmodel_t; // define names for the Target field of the general lift -typedef enum +enum { F2LnF, F2NnF, F2LnC, LnF2HnF, -} lifttarget_e; +}; +typedef unsigned lifttarget_e; // define names for the door Kind field of the general ceiling -typedef enum +enum { OdCDoor, ODoor, CdODoor, CDoor, -} doorkind_e; +}; +typedef unsigned intdoorkind_e; // define names for the locked door Kind field of the general ceiling -typedef enum +enum { AnyKey, RCard, @@ -311,7 +321,8 @@ typedef enum BSkull, YSkull, AllKeys, -} keykind_e; +}; +typedef unsigned keykind_e; ////////////////////////////////////////////////////////////////// // @@ -321,31 +332,34 @@ typedef enum //jff 2/23/98 identify the special classes that can share sectors -typedef enum +enum { floor_special, ceiling_special, lighting_special, -} special_e; +}; +typedef unsigned special_e; //jff 3/15/98 pure texture/type change for better generalized support -typedef enum +enum { trigChangeOnly, numChangeOnly, -} change_e; +}; +typedef unsigned change_e; // p_plats -typedef enum +enum { up, down, waiting, in_stasis -} plat_e; +}; +typedef unsigned plat_e; -typedef enum +enum { perpetualRaise, downWaitUpStay, @@ -356,11 +370,12 @@ typedef enum genPerpetual, toggleUpDn, //jff 3/14/98 added to support instant toggle type -} plattype_e; +}; +typedef unsigned plattype_e; // p_doors -typedef enum +enum { normal, close30ThenOpen, @@ -380,11 +395,12 @@ typedef enum genBlazeClose, genCdO, genBlazeCdO, -} vldoor_e; +}; +typedef unsigned vldoor_e; // p_ceilng -typedef enum +enum { lowerToFloor, raiseToHighest, @@ -405,11 +421,12 @@ typedef enum genCrusher, genSilentCrusher, -} ceiling_e; +}; +typedef unsigned ceiling_e; // p_floor -typedef enum +enum { // lower floor to highest surrounding floor lowerFloor, @@ -464,21 +481,24 @@ typedef enum //new types for stair builders buildStair, genBuildStair, -} floor_e; +}; +typedef unsigned floor_e; -typedef enum +enum { build8, // slowly build by 8 turbo16 // quickly build by 16 -} stair_e; +}; +typedef unsigned stair_e; -typedef enum +enum { elevateUp, elevateDown, elevateCurrent, -} elevator_e; +}; +typedef unsigned elevator_e; ////////////////////////////////////////////////////////////////// // @@ -487,21 +507,23 @@ typedef enum ////////////////////////////////////////////////////////////////// // texture type enum -typedef enum +enum { top, middle, bottom -} bwhere_e; +}; +typedef unsigned bwhere_e; // crush check returns -typedef enum +enum { ok, crushed, pastdest -} result_e; +}; +typedef unsigned result_e; ////////////////////////////////////////////////////////////////// // @@ -700,6 +722,14 @@ typedef struct // p_spec // killough 3/7/98: Add generalized scroll effects +enum +{ + sc_side, + sc_floor, + sc_ceiling, + sc_carry, + sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings +}; /* type */ typedef struct { thinker_t thinker; // Thinker structure for scrolling @@ -709,14 +739,7 @@ typedef struct { fixed_t last_height; // Last known height of control sector fixed_t vdx, vdy; // Accumulated velocity if accelerative int accel; // Whether it's accelerative - enum - { - sc_side, - sc_floor, - sc_ceiling, - sc_carry, - sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings - } type; // Type of scroll effect + unsigned type; // Type of scroll effect } scroll_t; // phares 3/12/98: added new model of friction for ice/sludge effects @@ -730,15 +753,17 @@ typedef struct { // phares 3/20/98: added new model of Pushers for push/pull effects +enum +{ + p_push, + p_pull, + p_wind, + p_current, +}; /* type */ + typedef struct { thinker_t thinker; // Thinker structure for Pusher - enum - { - p_push, - p_pull, - p_wind, - p_current, - } type; + unsigned type; mobj_t* source; // Point source if point pusher int x_mag; // X Strength int y_mag; // Y Strength diff --git a/apps/plugins/doom/p_tick.h b/apps/plugins/doom/p_tick.h index 5a495166b3..f6e497a4ef 100644 --- a/apps/plugins/doom/p_tick.h +++ b/apps/plugins/doom/p_tick.h @@ -54,12 +54,13 @@ void P_UpdateThinker(thinker_t *thinker); // killough 8/29/98 void P_SetTarget(mobj_t **mo, mobj_t *target); // killough 11/98 // killough 8/29/98: threads of thinkers, for more efficient searches -typedef enum { +enum { th_misc, th_friends, th_enemies, NUMTHCLASS -} th_class; +}; +typedef unsigned th_class; extern thinker_t thinkerclasscap[]; diff --git a/apps/plugins/doom/r_defs.h b/apps/plugins/doom/r_defs.h index a70d8a306c..251f515a07 100644 --- a/apps/plugins/doom/r_defs.h +++ b/apps/plugins/doom/r_defs.h @@ -177,13 +177,22 @@ side_t; // // Move clipping aid for LineDefs. // -typedef enum +enum { ST_HORIZONTAL, ST_VERTICAL, ST_POSITIVE, ST_NEGATIVE -} slopetype_t; +}; +typedef int slopetype_t; + +enum { // cph: + RF_TOP_TILE = 1, // Upper texture needs tiling + RF_MID_TILE = 2, // Mid texture needs tiling + RF_BOT_TILE = 4, // Lower texture needs tiling + RF_IGNORE = 8, // Renderer can skip this line + RF_CLOSED =16, // Line blocks view +}; typedef struct line_s { @@ -202,13 +211,7 @@ typedef struct line_s int tranlump; // killough 4/11/98: translucency filter, -1 == none int firsttag,nexttag; // killough 4/17/98: improves searches for tags. int r_validcount; // cph: if == gametic, r_flags already done - enum { // cph: - RF_TOP_TILE = 1, // Upper texture needs tiling - RF_MID_TILE = 2, // Mid texture needs tiling - RF_BOT_TILE = 4, // Lower texture needs tiling - RF_IGNORE = 8, // Renderer can skip this line - RF_CLOSED =16, // Line blocks view - } r_flags; + int r_flags; } line_t; diff --git a/apps/plugins/doom/sounds.h b/apps/plugins/doom/sounds.h index bf1004cda9..a5f6fc53ee 100644 --- a/apps/plugins/doom/sounds.h +++ b/apps/plugins/doom/sounds.h @@ -102,7 +102,7 @@ extern musicinfo_t S_music[]; // Identifiers for all music in game. // -typedef enum { +enum { mus_None, mus_e1m1, mus_e1m2, @@ -172,13 +172,14 @@ typedef enum { mus_dm2ttl, mus_dm2int, NUMMUSIC -} musicenum_t; +}; +typedef unsigned musicenum_t; // // Identifiers for all sfx in game. // -typedef enum { +enum { sfx_None, sfx_pistol, sfx_shotgn, @@ -299,6 +300,7 @@ typedef enum { #endif NUMSFX -} sfxenum_t; +}; +typedef unsigned sfxenum_t; #endif diff --git a/apps/plugins/doom/st_stuff.h b/apps/plugins/doom/st_stuff.h index d65b01e571..24f8c82661 100644 --- a/apps/plugins/doom/st_stuff.h +++ b/apps/plugins/doom/st_stuff.h @@ -68,19 +68,21 @@ void ST_Start(void); void ST_Init(void); // States for status bar code. -typedef enum +enum { AutomapState, FirstPersonState -} st_stateenum_t; +}; +typedef unsigned st_stateenum_t; // States for the chat code. -typedef enum +enum { StartChatState, WaitDestState, GetChatState -} st_chatstateenum_t; +}; +typedef unsigned st_chatstateenum_t; boolean ST_Responder(event_t* ev); diff --git a/apps/plugins/doom/v_video.c b/apps/plugins/doom/v_video.c index a7e2baea16..76993ea5ee 100644 --- a/apps/plugins/doom/v_video.c +++ b/apps/plugins/doom/v_video.c @@ -208,7 +208,7 @@ void V_MarkRect(int x, int y, int width, int height) // void V_CopyRect(int srcx, int srcy, int srcscrn, int width, int height, int destx, int desty, int destscrn, - enum patch_translation_e flags) + patch_translation_e flags) { byte *src; byte *dest; @@ -263,7 +263,7 @@ void V_CopyRect(int srcx, int srcy, int srcscrn, int width, // implemented, to support highres in the menus // void V_DrawBlock(int x, int y, int scrn, int width, int height, - const byte *src, enum patch_translation_e flags) + const byte *src, patch_translation_e flags) { byte *dest; @@ -406,7 +406,7 @@ void V_Init (void) // means that their inner loops weren't so well optimised, so merging code may even speed them). // void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, - int cm, enum patch_translation_e flags) + int cm, patch_translation_e flags) { const byte *trans; @@ -588,7 +588,7 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, inline #endif void V_DrawNumPatch(int x, int y, int scrn, int lump, - int cm, enum patch_translation_e flags) + int cm, patch_translation_e flags) { V_DrawMemPatch(x, y, scrn, (const patch_t*)W_CacheLumpNum(lump), cm, flags); @@ -634,7 +634,7 @@ int V_NamePatchHeight(const char* name) // patch will be undefined (in fact black for now) byte *V_PatchToBlock(const char* name, int cm, - enum patch_translation_e flags, + patch_translation_e flags, unsigned short* width, unsigned short* height) { (void)cm; diff --git a/apps/plugins/doom/v_video.h b/apps/plugins/doom/v_video.h index c4b8927109..cb23895068 100644 --- a/apps/plugins/doom/v_video.h +++ b/apps/plugins/doom/v_video.h @@ -53,7 +53,7 @@ extern const byte *colrngs[]; // symbolic indices into color translation table pointer array -typedef enum +enum { CR_BRICK, //0 CR_TAN, //1 @@ -67,7 +67,8 @@ typedef enum CR_YELLOW, //9 CR_BLUE2, //10 // proff CR_LIMIT //11 //jff 2/27/98 added for range check -} crange_idx_e; +}; +typedef unsigned crange_idx_e; //jff 1/16/98 end palette color range additions #define CR_DEFAULT CR_RED /* default value for out of range colors */ @@ -83,17 +84,18 @@ void V_InitColorTranslation(void); // Allocates buffer screens, call before R_Init. void V_Init (void); -enum patch_translation_e { +enum { VPT_NONE = 0, // Normal VPT_FLIP = 1, // Flip image horizontally VPT_TRANS = 2, // Translate image via a translation table VPT_STRETCH = 4, // Stretch to compensate for high-res }; +typedef unsigned patch_translation_e; #ifndef GL_DOOM void V_CopyRect(int srcx, int srcy, int srcscrn, int width, int height, int destx, int desty, int destscrn, - enum patch_translation_e flags); + patch_translation_e flags); #else #define V_CopyRect(sx,sy,ss,w,h,dx,dy,ds,f) #endif /* GL_DOOM */ @@ -111,14 +113,14 @@ void V_FillRect(int scrn, int x, int y, int width, int height, byte colour); #define V_DrawMemPatch(x,y,s,p,t,f) gld_DrawPatchFromMem(x,y,p,t,f) #else void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, - int cm, enum patch_translation_e flags); + int cm, patch_translation_e flags); #endif // V_DrawNumPatch - Draws the patch from lump num #ifdef GL_DOOM #define V_DrawNumPatch(x,y,s,l,t,f) gld_DrawNumPatch(x,y,l,t,f) #else void V_DrawNumPatch(int x, int y, int scrn, int lump, - int cm, enum patch_translation_e flags); + int cm, patch_translation_e flags); #endif // V_DrawNamePatch - Draws the patch from lump "name" #ifdef GL_DOOM @@ -140,7 +142,7 @@ int V_NamePatchHeight(const char* name); // CPhipps - added const's, patch translation flags for stretching #ifndef GL_DOOM void V_DrawBlock(int x, int y, int scrn, int width, int height, - const byte *src, enum patch_translation_e flags); + const byte *src, patch_translation_e flags); #endif /* cphipps 10/99: function to tile a flat over the screen */ @@ -160,7 +162,7 @@ void V_MarkRect(int x, int y, int width,int height); // CPhipps - function to convert a patch_t into a simple block bitmap // Returns pointer to the malloc()'ed bitmap, and its width and height byte *V_PatchToBlock(const char* name, int cm, - enum patch_translation_e flags, + patch_translation_e flags, unsigned short* width, unsigned short* height); #else #define V_MarkRect(x,y,w,h) diff --git a/apps/plugins/doom/w_wad.h b/apps/plugins/doom/w_wad.h index f505f42cb7..05e25c17b0 100644 --- a/apps/plugins/doom/w_wad.h +++ b/apps/plugins/doom/w_wad.h @@ -73,7 +73,7 @@ typedef struct // CPhipps - defined enum in wider scope // Ty 08/29/98 - add source field to identify where this lump came from -typedef enum { +enum { // CPhipps - define elements in order of 'how new/unusual' source_iwad=0, // iwad file load source_pre, // predefined lump @@ -81,7 +81,15 @@ typedef enum { source_pwad, // pwad file load source_lmp, // lmp file load source_net // CPhipps -} wad_source_t; +}; +typedef unsigned wad_source_t; + +enum { + ns_global=0, + ns_sprites, + ns_flats, + ns_colormaps +}; /* namespace */ typedef struct { @@ -97,12 +105,7 @@ typedef struct int index, next; // killough 4/17/98: namespace tags, to prevent conflicts between resources - enum { - ns_global=0, - ns_sprites, - ns_flats, - ns_colormaps - } namespace; + unsigned namespace; int handle; int position; diff --git a/apps/plugins/doom/wi_stuff.c b/apps/plugins/doom/wi_stuff.c index 3d14d088d5..5aec366026 100644 --- a/apps/plugins/doom/wi_stuff.c +++ b/apps/plugins/doom/wi_stuff.c @@ -107,12 +107,13 @@ // These animation variables, structures, etc. are used for the // DOOM/Ultimate DOOM intermission screen animations. This is // totally different from any sprite or texture/flat animations -typedef enum +enum { ANIM_ALWAYS, // determined by patch entry ANIM_RANDOM, // occasional ANIM_LEVEL // continuous -} animenum_t; +}; +typedef unsigned animenum_t; typedef struct { diff --git a/apps/plugins/doom/wi_stuff.h b/apps/plugins/doom/wi_stuff.h index 72c1d32d07..595418f88d 100644 --- a/apps/plugins/doom/wi_stuff.h +++ b/apps/plugins/doom/wi_stuff.h @@ -38,13 +38,14 @@ // States for the intermission -typedef enum +enum { NoState = -1, StatCount, ShowNextLoc -} stateenum_t; +}; +typedef int stateenum_t; // Called by main loop, animate the intermission. void WI_Ticker (void);