From f8e1d814ce19ea9516da3f1cd6bb04a91b6cce6d Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 27 Jan 2016 07:16:45 +0000 Subject: [PATCH] Minor cleanup. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5586 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 78a633001..dcb1a69e7 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1263,6 +1263,8 @@ static hashtable_t * const tables_free [] ={ &h_projectile, &h_player, &h_input, &h_actor, &h_tsprite, &h_tiledata, &h_paldata }; +#define STRUCT_HASH_SETUP(table, labels) do { for (i=0; labels[i].lId >= 0; i++) hash_add(&table, labels[i].name, i, 0); } while (0) + void C_InitHashes() { uint32_t i; @@ -1273,20 +1275,23 @@ void C_InitHashes() inithashnames(); initsoundhashnames(); - for (i=0; i= 0; i++) hash_add(&h_sector,SectorLabels[i].name,i,0); - for (i=0; WallLabels[i].lId >= 0; i++) hash_add(&h_wall,WallLabels[i].name,i,0); - for (i=0; UserdefsLabels[i].lId >= 0; i++) hash_add(&h_userdef,UserdefsLabels[i].name,i,0); - for (i=0; ProjectileLabels[i].lId >= 0; i++) hash_add(&h_projectile,ProjectileLabels[i].name,i,0); - for (i=0; PlayerLabels[i].lId >= 0; i++) hash_add(&h_player,PlayerLabels[i].name,i,0); - for (i=0; InputLabels[i].lId >= 0; i++) hash_add(&h_input,InputLabels[i].name,i,0); - for (i=0; ActorLabels[i].lId >= 0; i++) hash_add(&h_actor,ActorLabels[i].name,i,0); - for (i=0; TsprLabels[i].lId >= 0; i++) hash_add(&h_tsprite,TsprLabels[i].name,i,0); - for (i=0; TileDataLabels[i].lId >= 0; i++) hash_add(&h_tiledata,TileDataLabels[i].name,i,0); - for (i=0; PalDataLabels[i].lId >= 0; i++) hash_add(&h_paldata,PalDataLabels[i].name,i,0); + for (i=0; i