Skip to content

Commit

Permalink
Switched all remaining uses of UINT64 to unsigned __int64 to make…
Browse files Browse the repository at this point in the history
… it compilable on <=VC5
  • Loading branch information
seritools committed Sep 18, 2018
1 parent 7f98d3c commit 2f7f7d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Source/inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ void __fastcall RemoveInvItem(int pnum, int iv)
{
if ( plr[pnum]._pRSpell != SPL_INVALID )
{
// BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit
// BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit
// this causes the last 4 skills to not reset correctly after use
if ( !(
plr[pnum]._pScrlSpells64
Expand All @@ -1885,7 +1885,7 @@ void __fastcall RemoveSpdBarItem(int pnum, int iv)
{
if ( plr[pnum]._pRSpell != SPL_INVALID )
{
// BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit
// BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit
// this causes the last 4 skills to not reset correctly after use
if ( !(
plr[pnum]._pScrlSpells64
Expand Down
4 changes: 2 additions & 2 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx)
int dadd = 0; // added dexterity
int vadd = 0; // added vitality

UINT64 spl = 0; // bitarray for all enabled/active spells
unsigned __int64 spl = 0; // bitarray for all enabled/active spells

signed int fr = 0; // fire resistance
signed int lr = 0; // lightning resistance
Expand Down Expand Up @@ -938,7 +938,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx)

// check if the current RSplType is a valid/allowed spell
if ( plr[p]._pRSplType == RSPLTYPE_CHARGES
&& !(spl & ((UINT64)1 << (plr[p]._pRSpell - 1))) )
&& !(spl & ((unsigned __int64)1 << (plr[p]._pRSpell - 1))) )
{
plr[p]._pRSpell = SPL_INVALID;
plr[p]._pRSplType = RSPLTYPE_INVALID;
Expand Down
4 changes: 2 additions & 2 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3105,7 +3105,7 @@ BOOL __fastcall PM_DoSpell(int pnum)
if ( !plr[pnum]._pSplFrom ) {
if ( plr[pnum]._pRSplType == RSPLTYPE_SCROLL) {
if ( !(plr[pnum]._pScrlSpells64
& (UINT64)1 << (plr[pnum]._pRSpell - 1))
& (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))
) {
plr[pnum]._pRSpell = SPL_INVALID;
plr[pnum]._pRSplType = RSPLTYPE_INVALID;
Expand All @@ -3115,7 +3115,7 @@ BOOL __fastcall PM_DoSpell(int pnum)

if ( plr[pnum]._pRSplType == RSPLTYPE_CHARGES) {
if ( !(plr[pnum]._pISpells64
& (UINT64)1 << (plr[pnum]._pRSpell - 1))
& (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))
) {
plr[pnum]._pRSpell = SPL_INVALID;
plr[pnum]._pRSplType = RSPLTYPE_INVALID;
Expand Down
8 changes: 4 additions & 4 deletions structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ struct PlayerStruct
char _pSBkSplType;
char _pSplLvl[64];
union {
__int64 _pMemSpells64;
unsigned __int64 _pMemSpells64;
int _pMemSpells[2];
};
union {
__int64 _pAblSpells64;
unsigned __int64 _pAblSpells64;
int _pAblSpells[2];
};
union {
__int64 _pScrlSpells64;
unsigned __int64 _pScrlSpells64;
int _pScrlSpells[2];
};
int _pSpellFlags;
Expand Down Expand Up @@ -322,7 +322,7 @@ struct PlayerStruct
int _pIBonusAC;
int _pIBonusDamMod;
union {
__int64 _pISpells64;
unsigned __int64 _pISpells64;
int _pISpells[2];
};
int _pIFlags;
Expand Down

0 comments on commit 2f7f7d0

Please sign in to comment.