diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 2057d1a02..5c09a947e 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,12 @@ +December 20, 2006 +- Turned on warning level 4 just to see what it would produce: a lot of + warnings. At first, I was going to try and clean them all up. Then I decided + that was a worthless cause and went about just acting on the ones that + might actually be helpful: + C4189 (local variable is initialized but not referenced) + C4702 (unreachable code) + C4512 (assignment operator could not be generated) + December 19, 2006 - Fixed: D3DFB::Reset() also needs to restore the texture border color, otherwise it gets reset to black and unused. diff --git a/src/b_think.cpp b/src/b_think.cpp index 72e9c5e67..77d2940c0 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -335,7 +335,6 @@ void DCajunMaster::WhatToGet (AActor *actor, AActor *item) if (item->IsKindOf (RUNTIME_CLASS(AWeapon))) { // FIXME - AWeapon *weapon = static_cast (item); AWeapon *heldWeapon; heldWeapon = static_cast (b->mo->FindInventory (item->GetClass())); diff --git a/src/c_cvars.h b/src/c_cvars.h index a49c3449f..a424c8157 100644 --- a/src/c_cvars.h +++ b/src/c_cvars.h @@ -331,6 +331,8 @@ public: bool operator= (bool boolval) { UCVarValue val; val.Bool = boolval; SetGenericRep (val, CVAR_Bool); return boolval; } + bool operator= (FFlagCVar &flag) + { UCVarValue val; val.Bool = !!flag; SetGenericRep (val, CVAR_Bool); return val.Bool; } inline operator int () const { return (ValueVar & BitVal); } inline int operator *() const { return (ValueVar & BitVal); } diff --git a/src/colormatcher.cpp b/src/colormatcher.cpp index 3bd9a71ce..b1f07044a 100644 --- a/src/colormatcher.cpp +++ b/src/colormatcher.cpp @@ -76,5 +76,5 @@ BYTE FColorMatcher::Pick (int r, int g, int b) if (Pal == NULL) return 1; - return BestColor ((uint32 *)Pal, r, g, b); + return (BYTE)BestColor ((uint32 *)Pal, r, g, b); } diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index caaf1b016..99b09600e 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -180,7 +180,7 @@ void D_PickRandomTeam (int player) static char teamline[8] = "\\team\\X"; BYTE *foo = (BYTE *)teamline; - teamline[6] = D_PickRandomTeam() + '0'; + teamline[6] = (char)D_PickRandomTeam() + '0'; D_ReadUserInfoStrings (player, &foo, teamplay); } @@ -461,9 +461,9 @@ void D_SendServerFlagChange (const FBaseCVar *cvar, int bitnum, bool set) namelen = (int)strlen (cvar->GetName ()); Net_WriteByte (DEM_SINFCHANGEDXOR); - Net_WriteByte (namelen); + Net_WriteByte ((BYTE)namelen); Net_WriteBytes ((BYTE *)cvar->GetName (), namelen); - Net_WriteByte (bitnum | (set << 5)); + Net_WriteByte (BYTE(bitnum | (set << 5))); } void D_DoServerInfoChange (BYTE **stream, bool singlebit) diff --git a/src/decallib.cpp b/src/decallib.cpp index 857ee609e..d23e8e3d6 100644 --- a/src/decallib.cpp +++ b/src/decallib.cpp @@ -74,6 +74,8 @@ public: private: TWeightedList Choices; + + FDecalGroup &operator= (const FDecalGroup &) { return *this; } }; struct FDecalLib::FTranslation diff --git a/src/dobject.h b/src/dobject.h index df26756e9..f06f43ddd 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -173,7 +173,7 @@ private: \ // Taking the address of a field in an object at address 1 instead of // address 0 keeps GCC from complaining about possible misuse of offsetof. #define DECLARE_POINTER(field) (size_t)&((ThisClass*)1)->field - 1, -#define END_POINTERS ~0 }; +#define END_POINTERS ~(size_t)0 }; #if defined(_MSC_VER) # pragma data_seg(".creg$u") @@ -289,12 +289,12 @@ public: protected: // This form of placement new and delete is for use *only* by PClass's // CreateNew() method. Do not use them for some other purpose. - void *operator new(size_t len, EInPlace *mem) + void *operator new(size_t, EInPlace *mem) { return (void *)mem; } - void operator delete (void *mem, EInPlace *foo) + void operator delete (void *mem, EInPlace *) { free (mem); } diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 0fe60abdc..bac9d7347 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -9,7 +9,7 @@ TArray PClass::m_Types; PClass *PClass::TypeHash[PClass::HASH_SIZE]; // A harmless non_NULL FlatPointer for classes without pointers. -static const size_t TheEnd = ~0; +static const size_t TheEnd = ~0u; static int STACK_ARGS cregcmp (const void *a, const void *b) { diff --git a/src/f_finale.cpp b/src/f_finale.cpp index 09aa777bb..60b128ad0 100644 --- a/src/f_finale.cpp +++ b/src/f_finale.cpp @@ -783,7 +783,6 @@ void F_DemonScroll () { int yval; FTexture *final1 = TexMan("FINAL1"); - FTexture *final2 = TexMan("FINAL2"); int fwidth = final1->GetWidth(); int fheight = final1->GetHeight(); diff --git a/src/farchive.h b/src/farchive.h index 50a3385f1..90d8c0fd0 100644 --- a/src/farchive.h +++ b/src/farchive.h @@ -258,8 +258,8 @@ protected: void AttachToFile (FFile &file); private: - FArchive (const FArchive &src) {} - void operator= (const FArchive &src) {} + FArchive (const FArchive &) {} + void operator= (const FArchive &) {} }; // Create an FPNGChunkFile and FArchive in one step diff --git a/src/files.h b/src/files.h index 099a0c1ef..e238c9819 100644 --- a/src/files.h +++ b/src/files.h @@ -131,6 +131,8 @@ private: BYTE InBuff[BUFF_SIZE]; void FillBuffer (); + + FileReaderZ &operator= (const FileReaderZ &) { return *this; } }; diff --git a/src/g_heretic/a_hereticimp.cpp b/src/g_heretic/a_hereticimp.cpp index 67fc7f095..b69f4f252 100644 --- a/src/g_heretic/a_hereticimp.cpp +++ b/src/g_heretic/a_hereticimp.cpp @@ -133,7 +133,7 @@ FState AHereticImpLeader::States[] = IMPLEMENT_ACTOR (AHereticImpLeader, Heretic, 5, 7) PROP_SpawnHealth (80) - PROP_MeleeState (~0) + PROP_MeleeState (PROP_CLEAR_STATE) PROP_MissileState (S_IMP_MSATK2) PROP_Flags4Clear(MF4_MISSILEMORE) // The imp leader does have a 'normal' missile range! diff --git a/src/g_hexen/a_fighterhammer.cpp b/src/g_hexen/a_fighterhammer.cpp index 22c6bf658..13512d1c2 100644 --- a/src/g_hexen/a_fighterhammer.cpp +++ b/src/g_hexen/a_fighterhammer.cpp @@ -132,6 +132,7 @@ END_DEFAULTS void AHammerMissile::GetExplodeParms (int &damage, int &dist, bool &hurtSource) { damage = 128; + dist; hurtSource = false; } diff --git a/src/g_level.h b/src/g_level.h index 782296a18..9c1281c86 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -43,60 +43,60 @@ #define NUM_WORLDVARS 256 #define NUM_GLOBALVARS 64 -#define LEVEL_NOINTERMISSION 0x00000001 -#define LEVEL_NOINVENTORYBAR 0x00000002 // This effects Doom only, since it's the only one without a standard inventory bar. -#define LEVEL_DOUBLESKY 0x00000004 -#define LEVEL_HASFADETABLE 0x00000008 // Level uses Hexen's fadetable mapinfo to get fog +#define LEVEL_NOINTERMISSION UCONST64(0x00000001) +#define LEVEL_NOINVENTORYBAR UCONST64(0x00000002) // This effects Doom only, since it's the only one without a standard inventory bar. +#define LEVEL_DOUBLESKY UCONST64(0x00000004) +#define LEVEL_HASFADETABLE UCONST64(0x00000008) // Level uses Hexen's fadetable mapinfo to get fog -#define LEVEL_MAP07SPECIAL 0x00000010 -#define LEVEL_BRUISERSPECIAL 0x00000020 -#define LEVEL_CYBORGSPECIAL 0x00000040 -#define LEVEL_SPIDERSPECIAL 0x00000080 +#define LEVEL_MAP07SPECIAL UCONST64(0x00000010) +#define LEVEL_BRUISERSPECIAL UCONST64(0x00000020) +#define LEVEL_CYBORGSPECIAL UCONST64(0x00000040) +#define LEVEL_SPIDERSPECIAL UCONST64(0x00000080) -#define LEVEL_SPECLOWERFLOOR 0x00000100 -#define LEVEL_SPECOPENDOOR 0x00000200 -#define LEVEL_SPECACTIONSMASK 0x00000300 +#define LEVEL_SPECLOWERFLOOR UCONST64(0x00000100) +#define LEVEL_SPECOPENDOOR UCONST64(0x00000200) +#define LEVEL_SPECACTIONSMASK UCONST64(0x00000300) -#define LEVEL_MONSTERSTELEFRAG 0x00000400 -#define LEVEL_ACTOWNSPECIAL 0x00000800 -#define LEVEL_SNDSEQTOTALCTRL 0x00001000 -#define LEVEL_FORCENOSKYSTRETCH 0x00002000 +#define LEVEL_MONSTERSTELEFRAG UCONST64(0x00000400) +#define LEVEL_ACTOWNSPECIAL UCONST64(0x00000800) +#define LEVEL_SNDSEQTOTALCTRL UCONST64(0x00001000) +#define LEVEL_FORCENOSKYSTRETCH UCONST64(0x00002000) -#define LEVEL_JUMP_NO 0x00004000 -#define LEVEL_JUMP_YES 0x00008000 -#define LEVEL_FREELOOK_NO 0x00010000 -#define LEVEL_FREELOOK_YES 0x00020000 +#define LEVEL_JUMP_NO UCONST64(0x00004000) +#define LEVEL_JUMP_YES UCONST64(0x00008000) +#define LEVEL_FREELOOK_NO UCONST64(0x00010000) +#define LEVEL_FREELOOK_YES UCONST64(0x00020000) // The absence of both of the following bits means that this level does not // use falling damage (though damage can be forced with dmflags). -#define LEVEL_FALLDMG_ZD 0x00040000 // Level uses ZDoom's falling damage -#define LEVEL_FALLDMG_HX 0x00080000 // Level uses Hexen's falling damage +#define LEVEL_FALLDMG_ZD UCONST64(0x00040000) // Level uses ZDoom's falling damage +#define LEVEL_FALLDMG_HX UCONST64(0x00080000) // Level uses Hexen's falling damage -#define LEVEL_HEADSPECIAL 0x00100000 // Heretic episode 1/4 -#define LEVEL_MINOTAURSPECIAL 0x00200000 // Heretic episode 2/5 -#define LEVEL_SORCERER2SPECIAL 0x00400000 // Heretic episode 3 -#define LEVEL_SPECKILLMONSTERS 0x00800000 +#define LEVEL_HEADSPECIAL UCONST64(0x00100000) // Heretic episode 1/4 +#define LEVEL_MINOTAURSPECIAL UCONST64(0x00200000) // Heretic episode 2/5 +#define LEVEL_SORCERER2SPECIAL UCONST64(0x00400000) // Heretic episode 3 +#define LEVEL_SPECKILLMONSTERS UCONST64(0x00800000) -#define LEVEL_STARTLIGHTNING 0x01000000 // Automatically start lightning -#define LEVEL_FILTERSTARTS 0x02000000 // Apply mapthing filtering to player starts -#define LEVEL_LOOKUPLEVELNAME 0x04000000 // Level name is the name of a language string -#define LEVEL_HEXENFORMAT 0x08000000 // Level uses the Hexen map format +#define LEVEL_STARTLIGHTNING UCONST64(0x01000000) // Automatically start lightning +#define LEVEL_FILTERSTARTS UCONST64(0x02000000) // Apply mapthing filtering to player starts +#define LEVEL_LOOKUPLEVELNAME UCONST64(0x04000000) // Level name is the name of a language string +#define LEVEL_HEXENFORMAT UCONST64(0x08000000) // Level uses the Hexen map format -#define LEVEL_SWAPSKIES 0x10000000 // Used by lightning -#define LEVEL_NOALLIES 0x20000000 // i.e. Inside Strife's front base -#define LEVEL_CHANGEMAPCHEAT 0x40000000 // Don't display cluster messages -#define LEVEL_VISITED UCONST64(0x80000000) // Used for intermission map +#define LEVEL_SWAPSKIES UCONST64(0x10000000) // Used by lightning +#define LEVEL_NOALLIES UCONST64(0x20000000) // i.e. Inside Strife's front base +#define LEVEL_CHANGEMAPCHEAT UCONST64(0x40000000) // Don't display cluster messages +#define LEVEL_VISITED UCONST64(0x80000000) // Used for intermission map -#define LEVEL_DEATHSLIDESHOW UCONST64(0x100000000) // Slideshow on death -#define LEVEL_ALLMAP UCONST64(0x200000000) // The player picked up a map on this level +#define LEVEL_DEATHSLIDESHOW UCONST64(0x100000000) // Slideshow on death +#define LEVEL_ALLMAP UCONST64(0x200000000) // The player picked up a map on this level -#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed -#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default. +#define LEVEL_LAXMONSTERACTIVATION UCONST64(0x400000000) // Monsters can open doors depending on the door speed +#define LEVEL_LAXACTIVATIONMAPINFO UCONST64(0x800000000) // LEVEL_LAXMONSTERACTIVATION is not a default. // some unused bits here! -#define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1 +#define LEVEL_KEEPFULLINVENTORY UCONST64(0x4000000000) // doesn't reduce the amount of inventory items to 1 -#define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map +#define LEVEL_MUSICDEFINED UCONST64(0x8000000000) // a marker to disable the $map command in SNDINFO for this map #define LEVEL_MONSTERFALLINGDAMAGE UCONST64(0x10000000000) #define LEVEL_CLIPMIDTEX UCONST64(0x20000000000) #define LEVEL_WRAPMIDTEX UCONST64(0x40000000000) diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 2dcb88595..e68fcf98a 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -832,7 +832,6 @@ void A_MinotaurLook (AActor *actor) return; } - AMinotaurFriend *self = static_cast (actor); AActor *mo = NULL; player_t *player; fixed_t dist; diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 9ad552be8..8fdcad772 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1695,7 +1695,6 @@ void AHexenArmor::AbsorbDamage (int damage, FName damageType, int &newdamage) if (damageType != NAME_Water) { fixed_t savedPercent = Slots[0] + Slots[1] + Slots[2] + Slots[3] + Slots[4]; - APlayerPawn *ppawn = Owner->player != NULL ? Owner->player->mo : NULL; if (savedPercent) { // armor absorbed some damage diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 3893cbca9..281db32ab 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -200,8 +200,6 @@ void FBaseStatusBar::SetScaled (bool scale) } else { - bool wide = !(CheckRatio (SCREENWIDTH, SCREENHEIGHT) & 3); - int basewidth = wide ? 1280 : 960; ST_X = 0; ST_Y = 200 - RelTop; ::ST_Y = Scale (ST_Y, SCREENHEIGHT, 200); diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index 3904df836..71deaef5f 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -207,7 +207,7 @@ void AProgLevelEnder::Tick () PalEntry AProgLevelEnder::GetBlend () { - return PalEntry (special1, 0, 0, 0); + return PalEntry ((BYTE)special1, 0, 0, 0); } //============================================================================ diff --git a/src/g_strife/a_rebels.cpp b/src/g_strife/a_rebels.cpp index a167a67f3..816b4d54e 100644 --- a/src/g_strife/a_rebels.cpp +++ b/src/g_strife/a_rebels.cpp @@ -302,7 +302,7 @@ void A_Beacon (AActor *self) { // Rebels are the same color as their owner rebel->Translation = owner->Translation; - rebel->FriendPlayer = owner->player != NULL ? int(owner->player - players + 1) : 0; + rebel->FriendPlayer = owner->player != NULL ? BYTE(owner->player - players + 1) : 0; // Set the rebel's target to whatever last hurt the player, so long as it's not // one of the player's other rebels. if (owner->target != NULL && !rebel->IsFriend (owner->target)) diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index dd83073d1..364415fad 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -1394,7 +1394,7 @@ void A_MaulerTorpedoWave (AActor *self) for (int i = 0; i < 80; ++i) { self->angle += ANGLE_45/10; - AActor *wave = P_SpawnSubMissile (self, RUNTIME_CLASS(AMaulerTorpedoWave), self->target); + P_SpawnSubMissile (self, RUNTIME_CLASS(AMaulerTorpedoWave), self->target); } self->z = savedz; } diff --git a/src/hu_stuff.h b/src/hu_stuff.h index cf638a6e1..9380ea80c 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -27,11 +27,11 @@ // // Globally visible constants. // -const BYTE HU_FONTSTART = '!'; // the first font characters -const BYTE HU_FONTEND = 'ß'; // the last font characters +#define HU_FONTSTART BYTE('!') // the first font characters +#define HU_FONTEND BYTE('ß') // the last font characters // Calculate # of glyphs in font. -const int HU_FONTSIZE = HU_FONTEND - HU_FONTSTART + 1; +#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) // // Chat routines diff --git a/src/info.h b/src/info.h index 5aa338269..9f6b66eca 100644 --- a/src/info.h +++ b/src/info.h @@ -173,7 +173,7 @@ FArchive &operator<< (FArchive &arc, FState *&state); #if _MSC_VER #define _S__SPRITE_(spr) \ - { {{(char)(#@spr>>24),(char)(#@spr>>16),(char)(#@spr>>8),(char)#@spr}} + { {{(char)(#@spr>>24),(char)((#@spr>>16)&255),(char)((#@spr>>8)&255),(char)(#@spr&255)}} #else #define _S__SPRITE_(spr) \ { {{#spr}} diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index d3325abfa..d1ae62c01 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -107,7 +107,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) datasound = S_FindSound (datastr); } } - else if (defnum > ADEF_LastString && dataint >= 0 && dataint < 255) + else if (defnum > ADEF_LastString && dataint >= 0 && dataint < PROP_CLEAR_STATE) { datastate = DefaultStates (sgClass) + dataint; } @@ -120,7 +120,6 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) ABasicArmorPickup *const armorp = (ABasicArmorPickup *)sgDefaults; APuzzleItem *const puzzl = (APuzzleItem *)sgDefaults; APowerup *const power = (APowerup *)sgDefaults; - AKey *const key = (AKey *)sgDefaults; AWeapon *const weapon = (AWeapon *)sgDefaults; ASigil *const sigil = (ASigil *)sgDefaults; AAmmo *const ammo = (AAmmo *)sgDefaults; diff --git a/src/infomacros.h b/src/infomacros.h index 833daa13d..6f7e79204 100644 --- a/src/infomacros.h +++ b/src/infomacros.h @@ -65,6 +65,8 @@ typedef void (*voidfunc_)(); ************** Visual C++ macros **************** ************************************************/ +#pragma warning(disable: 4207) // nonstandard extension used : extended initializer form + #pragma data_seg(".areg$u") // ActorInfo initializer list #pragma data_seg(".greg$u") // AT_GAME_SET list #pragma data_seg(".sreg$u") // AT_SPEED_SET list @@ -87,7 +89,7 @@ typedef void (*voidfunc_)(); #endif #define ADD_BYTE_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Byte), val, -#define ADD_FIXD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_FixedMul), val, +#define ADD_FIXD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_FixedMul), (BYTE)(val), #define ADD_WORD_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Word), BREAK_WORD(val), #define ADD_LONG_PROP(prop,val) BREAK_WORD(prop|ADEFTYPE_Long), BREAK_LONG(val), #ifdef WORDS_BIGENDIAN @@ -280,6 +282,7 @@ public: #define PROP_EDeathState(x) ADD_BYTE_PROP(ADEF_EDeathState,x) #define PROP_RaiseState(x) ADD_BYTE_PROP(ADEF_RaiseState,x) #define PROP_WoundState(x) ADD_BYTE_PROP(ADEF_WoundState,x) +#define PROP_CLEAR_STATE 255 #define PROP_StrifeType(x) ADD_WORD_PROP(ADEF_StrifeType,x) #define PROP_StrifeTeaserType(x) ADD_WORD_PROP(ADEF_StrifeTeaserType,x) diff --git a/src/lists.h b/src/lists.h index e058d2767..8ebd34eb5 100644 --- a/src/lists.h +++ b/src/lists.h @@ -138,6 +138,9 @@ struct List TailPred->Succ = (Node *)&Tail; return node; } + +private: + List &operator= (const List&) { return *this; } }; #endif //__LISTS_H__ diff --git a/src/nodebuild.h b/src/nodebuild.h index 0ca9d1cee..4c7babbcc 100644 --- a/src/nodebuild.h +++ b/src/nodebuild.h @@ -116,6 +116,8 @@ class FNodeBuilder assert (y <= MaxY); return (unsigned(x - MinX) >> BLOCK_SHIFT) + (unsigned(y - MinY) >> BLOCK_SHIFT) * BlocksWide; } + + FVertexMap &operator= (const FVertexMap &) { return *this; } }; friend class FVertexMap; @@ -233,6 +235,8 @@ private: double InterceptVector (const node_t &splitter, const FPrivSeg &seg); void PrintSet (int l, DWORD set); + + FNodeBuilder &operator= (const FNodeBuilder &) { return *this; } }; // Points within this distance of a line will be considered on the line. diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index b681c9c61..157f8363b 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -604,7 +604,6 @@ FUNC(LS_Generic_Ceiling) return EV_DoCeiling (type, ln, arg0, SPEED(arg1), SPEED(arg1), arg2*FRACUNIT, (arg4 & 16) ? 20 : -1, 0, arg4 & 7); - return false; } FUNC(LS_Generic_Crusher) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 54dbc148f..540cd64c6 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1464,11 +1464,6 @@ void P_VavoomSlope(sector_t * sec, int id, fixed_t x, fixed_t y, fixed_t z, int srcplane->d = -TMulScale16 (srcplane->a, x, srcplane->b, y, srcplane->c, z); - - int v=srcplane->ZatPoint(x,y); - int w=srcplane->ZatPoint(l->v1->x,l->v1->y); - int x=srcplane->ZatPoint(l->v2->x,l->v2->y); - return; } } diff --git a/src/r_defs.h b/src/r_defs.h index 3065a033c..e1497ffe8 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -720,7 +720,7 @@ public: { totexnum = fromtexnum; } - Translation[fromtexnum] = totexnum; + Translation[fromtexnum] = WORD(totexnum); } } diff --git a/src/r_things.cpp b/src/r_things.cpp index ac7314ce8..20b3b69fe 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -105,9 +105,9 @@ size_t numskins; BYTE OtherGameSkinRemap[256]; // [RH] particle globals -int NumParticles; -int ActiveParticles; -int InactiveParticles; +WORD NumParticles; +WORD ActiveParticles; +WORD InactiveParticles; particle_t *Particles; CVAR (Bool, r_particles, true, 0); diff --git a/src/r_things.h b/src/r_things.h index 6f166ea0c..27a845676 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -38,9 +38,9 @@ struct particle_t WORD snext; }; -extern int NumParticles; -extern int ActiveParticles; -extern int InactiveParticles; +extern WORD NumParticles; +extern WORD ActiveParticles; +extern WORD InactiveParticles; extern particle_t *Particles; const WORD NO_PARTICLE = 0xffff; @@ -53,7 +53,7 @@ inline particle_t *NewParticle (void) result = Particles + InactiveParticles; InactiveParticles = result->tnext; result->tnext = ActiveParticles; - ActiveParticles = (int)(result - Particles); + ActiveParticles = WORD(result - Particles); } return result; } diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index dc71162f6..356a9052d 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -1039,7 +1039,6 @@ int FMODSoundRenderer::PutSampleData (FSOUND_SAMPLE *sample, const BYTE *data, i return FALSE; } } - return TRUE; } void FMODSoundRenderer::DoLoad (void **slot, sfxinfo_t *sfx) diff --git a/src/textures/automaptexture.cpp b/src/textures/automaptexture.cpp index b68dcefe4..519df2648 100644 --- a/src/textures/automaptexture.cpp +++ b/src/textures/automaptexture.cpp @@ -46,7 +46,7 @@ bool FAutomapTexture::Check(FileReader & data) return true; } -FTexture *FAutomapTexture::Create(FileReader & file, int lumpnum) +FTexture *FAutomapTexture::Create(FileReader &, int lumpnum) { return new FAutomapTexture(lumpnum); } @@ -55,7 +55,7 @@ FAutomapTexture::FAutomapTexture (int lumpnum) : Pixels(NULL), LumpNum(lumpnum) { Width = 320; - Height = Wads.LumpLength(lumpnum) / 320; + Height = WORD(Wads.LumpLength(lumpnum) / 320); CalcBitSize (); DummySpan[0].TopOffset = 0; diff --git a/src/textures/patchtexture.cpp b/src/textures/patchtexture.cpp index 056ac032b..16be9ef37 100644 --- a/src/textures/patchtexture.cpp +++ b/src/textures/patchtexture.cpp @@ -52,7 +52,6 @@ bool FPatchTexture::Check(FileReader & file) int height = LittleShort(foo->height); int width = LittleShort(foo->width); - bool gapAtStart=true; if (height > 0 && height < 2048 && width > 0 && width <= 2048 && width < file.GetLength()/4) { diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 0dd7f613a..0adb37991 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -55,7 +55,7 @@ int CleanWidth, CleanHeight; CVAR (Bool, hud_scale, false, CVAR_ARCHIVE); -void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, DWORD tags_first, ...) +void STACK_ARGS DCanvas::DrawTexture (FTexture *img, int x0, int y0, int tags_first, ...) { FTexture::Span unmaskedSpan[2]; const FTexture::Span **spanptr, *spans; diff --git a/src/v_font.cpp b/src/v_font.cpp index 2028dc758..119970557 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -1469,7 +1469,6 @@ void V_InitCustomFonts() int lumplist[256]; bool notranslate[256]; char namebuffer[16], templatebuf[16]; - int adder=0; int i; int llump,lastlump=0; int format; diff --git a/src/v_video.h b/src/v_video.h index 1e50241a7..a9079b3d1 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -67,7 +67,7 @@ class FTexture; #define TAG_MORE (2) /* Ends this list and continues with the */ /* list pointed to in ti_Data */ -#define TAG_USER ((DWORD)(1u<<31)) +#define TAG_USER ((DWORD)(1u<<30)) enum { @@ -169,7 +169,7 @@ public: virtual void SetFont (FFont *font); // 2D Texture drawing - void STACK_ARGS DrawTexture (FTexture *img, int x, int y, DWORD tags, ...); + void STACK_ARGS DrawTexture (FTexture *img, int x, int y, int tags, ...); void FillBorder (FTexture *img); // Fills the border around a 4:3 part of the screen on non-4:3 displays // 2D Text drawing diff --git a/src/weightedlist.h b/src/weightedlist.h index 93157ce76..38e1d2fb6 100644 --- a/src/weightedlist.h +++ b/src/weightedlist.h @@ -72,6 +72,8 @@ class TWeightedList FRandom &RandomClass; void RecalcRandomVals (); + + TWeightedList &operator= (const TWeightedList &) { return *this; } }; template diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index fdf2d43c9..a12ca79e6 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -715,13 +715,10 @@ static void WI_DrawCharPatch (FTexture *patch, int x, int y) int WI_DrawName(int y,const char * levelname, bool nomove=false) { - int i,len=0; + int i; size_t l; const char * p; int h=0; - int lastlinelen=0; - int lastindex=0; - int firstindex=0; int lumph; lumph=BigFont->GetHeight(); diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index fabcb916e..f285e3f33 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -211,7 +211,7 @@ D3DFB::D3DFB (int width, int height, bool fullscreen) for (i = 0; i < 256; i++) { - GammaTable[i] = i; + GammaTable[i] = (BYTE)i; } memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256); @@ -439,9 +439,9 @@ void D3DFB::DoOffByOneCheck () { for (i = 0; i < 256; ++i) { - Pal32[i][0] = (i & 0x03) << 6; // blue - Pal32[i][1] = (i & 0x1C) << 3; // green - Pal32[i][2] = (i & 0xE0); // red; + Pal32[i][0] = BYTE(i & 0x03) << 6; // blue + Pal32[i][1] = BYTE(i & 0x1C) << 3; // green + Pal32[i][2] = BYTE(i & 0xE0); // red; Pal32[i][3] = 255; } } @@ -449,9 +449,9 @@ void D3DFB::DoOffByOneCheck () { for (i = 0; i < 256; ++i) { - Pal16[i] = ((i & 0xE0) << 8) | // red - ((i & 0x1C) << 6) | // green - ((i & 0x03) << 3); // blue + Pal16[i] = WORD((i & 0xE0) << 8) | // red + ((i & 0x1C) << 6) | // green + ((i & 0x03) << 3); // blue } } // Upload the palette @@ -469,7 +469,7 @@ void D3DFB::DoOffByOneCheck () { for (i = 0; i < 256; ++i) { - ((BYTE *)lockrect.pBits)[i] = i; + ((BYTE *)lockrect.pBits)[i] = (BYTE)i; } FBTexture->UnlockRect (0); } @@ -713,10 +713,6 @@ void D3DFB::Unlock () void D3DFB::Update () { - bool pchanged = false; - - LOG3 ("Update <%d,%c:%d>\n", LockCount, AppActive?'Y':'N', SessionState); - if (LockCount != 1) { //I_FatalError ("Framebuffer must have exactly 1 lock to be updated"); diff --git a/src/win32/fb_ddraw.cpp b/src/win32/fb_ddraw.cpp index 801ca130f..ea4c4e726 100644 --- a/src/win32/fb_ddraw.cpp +++ b/src/win32/fb_ddraw.cpp @@ -160,7 +160,7 @@ DDrawFB::DDrawFB (int width, int height, bool fullscreen) PalEntries[i].peRed = GPalette.BaseColors[i].r; PalEntries[i].peGreen = GPalette.BaseColors[i].g; PalEntries[i].peBlue = GPalette.BaseColors[i].b; - GammaTable[0][i] = GammaTable[1][i] = GammaTable[2][i] = i; + GammaTable[0][i] = GammaTable[1][i] = GammaTable[2][i] = (BYTE)i; } memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256); @@ -796,7 +796,7 @@ void DDrawFB::RebuildColorTable () } for (i = 0; i < 256; i++) { - GPfxPal.Pal8[i] = BestColor ((uint32 *)syspal, PalEntries[i].peRed, + GPfxPal.Pal8[i] = (BYTE)BestColor ((uint32 *)syspal, PalEntries[i].peRed, PalEntries[i].peGreen, PalEntries[i].peBlue); } } @@ -848,6 +848,7 @@ bool DDrawFB::Lock (bool useSimpleCanvas) else { HRESULT hr GCCNOWARN = BlitSurf->Flip (NULL, DDFLIP_WAIT); + hr; LOG1 ("Blit flip = %08lx\n", hr); LockSurfRes res = LockSurf (NULL, BlitSurf); diff --git a/src/win32/helperthread.cpp b/src/win32/helperthread.cpp index fd1e91382..5d7521370 100644 --- a/src/win32/helperthread.cpp +++ b/src/win32/helperthread.cpp @@ -290,6 +290,4 @@ DWORD FHelperThread::ThreadLoop () DefaultDispatch (); } } - - return 0; } diff --git a/src/win32/i_crash.cpp b/src/win32/i_crash.cpp index 70895512f..c7932fcfb 100644 --- a/src/win32/i_crash.cpp +++ b/src/win32/i_crash.cpp @@ -2983,7 +2983,6 @@ static void SaveReport (HANDLE file) else { DWORD fileLen = GetFileSize (file, NULL), fileLeft; - DWORD bytesCopied = 0; char xferbuf[1024]; SetFilePointer (file, 0, NULL, FILE_BEGIN); diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 8afdc35ae..8fd684cdc 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -604,8 +604,6 @@ void RestoreConView() void ShowErrorPane(const char *text) { - size_t len = strlen(text); - ErrorPane = CreateDialogParam (g_hInst, MAKEINTRESOURCE(IDD_ERRORPANE), Window, ErrorPaneProc, (LPARAM)text); if (ErrorPane == NULL) @@ -649,6 +647,7 @@ void DoMain (HINSTANCE hInstance) int height, width, x, y; RECT cRect; TIMECAPS tc; + DEVMODE displaysettings; try { @@ -739,7 +738,10 @@ void DoMain (HINSTANCE hInstance) width = 512; height = 384; - DEVMODE displaysettings = { sizeof(displaysettings) }; + // Many Windows structures that specify their size do so with the first + // element. DEVMODE is not one of those structures. + memset (&displaysettings, 0, sizeof(displaysettings)); + displaysettings.dmSize = sizeof(displaysettings); EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &displaysettings); x = (displaysettings.dmPelsWidth - width) / 2; y = (displaysettings.dmPelsHeight - height) / 2; diff --git a/src/zstrformat.cpp b/src/zstrformat.cpp index a01d599fe..e783d3ccd 100644 --- a/src/zstrformat.cpp +++ b/src/zstrformat.cpp @@ -391,14 +391,14 @@ namespace StringFormat { // Decimal while (intarg != 0) { - *--ibuff = (intarg % 10) + '0'; intarg /= 10; + *--ibuff = char(intarg % 10) + '0'; intarg /= 10; } } else if (type == 'o') { // Octal while (intarg != 0) { - *--ibuff = (intarg & 7) + '0'; intarg >>= 3; + *--ibuff = char(intarg & 7) + '0'; intarg >>= 3; } } else @@ -437,7 +437,7 @@ namespace StringFormat else if (type == 'c') { intarg = va_arg (arglist, int); - buffer[0] = intarg; + buffer[0] = char(intarg); bufflen = 1; obuff = buffer; } @@ -472,11 +472,11 @@ namespace StringFormat { if (size == F_HALFHALF) { - *va_arg (arglist, char *) = inlen; + *va_arg (arglist, char *) = (char)inlen; } else if (size == F_HALF) { - *va_arg (arglist, short *) = inlen; + *va_arg (arglist, short *) = (short)inlen; } else if (size == F_LONG) { @@ -605,6 +605,5 @@ namespace StringFormat len += outlen; } } - return len; } }; diff --git a/src/zstring.cpp b/src/zstring.cpp index 13ec7a405..c74c4e335 100644 --- a/src/zstring.cpp +++ b/src/zstring.cpp @@ -478,7 +478,7 @@ void FString::ToUpper () size_t max = Len(); for (size_t i = 0; i < max; ++i) { - Chars[i] = toupper(Chars[i]); + Chars[i] = (char)toupper(Chars[i]); } UnlockBuffer(); } @@ -489,7 +489,7 @@ void FString::ToLower () size_t max = Len(); for (size_t i = 0; i < max; ++i) { - Chars[i] = tolower(Chars[i]); + Chars[i] = (char)tolower(Chars[i]); } UnlockBuffer(); } @@ -502,11 +502,11 @@ void FString::SwapCase () { if (isupper(Chars[i])) { - Chars[i] = tolower(Chars[i]); + Chars[i] = (char)tolower(Chars[i]); } else { - Chars[i] = toupper(Chars[i]); + Chars[i] = (char)toupper(Chars[i]); } } UnlockBuffer(); diff --git a/zdoom.vcproj b/zdoom.vcproj index 4415ad31f..967735069 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -50,7 +50,6 @@ />