Patch by Gerard Krol: warnings casts

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@800 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2006-11-02 19:26:55 +00:00
parent 2f2015340c
commit 6617c2f400
3 changed files with 14 additions and 13 deletions

View File

@ -19,7 +19,7 @@ void cpPrintType(INTERP_TYPE type)
if (type & VAL_REF)
{
ref = TRUE;
type = type & ~VAL_REF;
type = (INTERP_TYPE)(type & ~VAL_REF);
}
switch(type)
@ -124,7 +124,7 @@ void cpPrintVal(INTERP_VAL *psVal)
/* Display a value from a program that has been packed with an opcode */
void cpPrintPackedVal(UDWORD *ip)
{
INTERP_TYPE type = (*ip) & OPCODE_DATAMASK;
INTERP_TYPE type = (INTERP_TYPE)((*ip) & OPCODE_DATAMASK);
UDWORD i;
UDWORD data = *(ip + 1);
@ -415,7 +415,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
ip = psProg->pCode;
triggerCode = psProg->numTriggers > 0 ? TRUE : FALSE;
end = (UDWORD *)(((UBYTE *)ip) + psProg->size);
opcode = (*ip) >> OPCODE_SHIFT;
opcode = (OPCODE)((*ip) >> OPCODE_SHIFT);
data = (*ip) & OPCODE_DATAMASK;
while (ip < end)
{
@ -568,7 +568,7 @@ void cpPrintProgram(SCRIPT_CODE *psProg)
ASSERT( (ip <= end) || PTRVALID(ip, sizeof(UDWORD)),
"cpPrintProgram: instruction pointer no longer valid" );
opcode = (*ip) >> OPCODE_SHIFT;
opcode = (OPCODE)((*ip) >> OPCODE_SHIFT);
data = (*ip) & OPCODE_DATAMASK;
}
}

View File

@ -478,7 +478,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
case OP_PUSHLOCALREF:
// The type of the variable is stored in with the opcode
sVal.type = (*InstrPointer) & OPCODE_DATAMASK;
sVal.type = (INTERP_TYPE)((*InstrPointer) & OPCODE_DATAMASK);
/* get local var index */
data = *(InstrPointer + 1);
@ -508,7 +508,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
case OP_PUSH:
// The type of the value is stored in with the opcode
sVal.type = (*InstrPointer) & OPCODE_DATAMASK;
sVal.type = (INTERP_TYPE)((*InstrPointer) & OPCODE_DATAMASK);
// Copy the data as a DWORD
sVal.v.ival = (SDWORD)(*(InstrPointer+1));
TRCPRINTF(("PUSH "));
@ -525,7 +525,7 @@ BOOL interpRunScript(SCRIPT_CONTEXT *psContext, INTERP_RUNTYPE runType, UDWORD i
break;
case OP_PUSHREF:
// The type of the variable is stored in with the opcode
sVal.type = (*InstrPointer) & OPCODE_DATAMASK;
sVal.type = (INTERP_TYPE)((*InstrPointer) & OPCODE_DATAMASK);
// store the pointer
psVar = interpGetVarData(psGlobals, *(InstrPointer + 1));
sVal.v.oval = &(psVar->v.ival);
@ -929,12 +929,12 @@ BOOL interpCheckEquiv(INTERP_TYPE to, INTERP_TYPE from)
if (to & VAL_REF)
{
toRef = TRUE;
to = to & ~VAL_REF;
to = (INTERP_TYPE)(to & ~VAL_REF);
}
if (from & VAL_REF)
{
fromRef = TRUE;
from = from & ~VAL_REF;
from = (INTERP_TYPE)(from & ~VAL_REF);
}
if (toRef != fromRef)
{

View File

@ -80,10 +80,10 @@ void cmdDroidAddDroid(DROID *psCommander, DROID *psDroid)
psDroid->group = UBYTE_MAX;
// set the secondary states for the unit
secondarySetState(psDroid, DSO_ATTACK_RANGE, psCommander->secondaryOrder & DSS_ARANGE_MASK);
secondarySetState(psDroid, DSO_REPAIR_LEVEL, psCommander->secondaryOrder & DSS_REPLEV_MASK);
secondarySetState(psDroid, DSO_ATTACK_LEVEL, psCommander->secondaryOrder & DSS_ALEV_MASK);
secondarySetState(psDroid, DSO_HALTTYPE, psCommander->secondaryOrder & DSS_HALT_MASK);
secondarySetState(psDroid, DSO_ATTACK_RANGE, (SECONDARY_STATE)(psCommander->secondaryOrder & DSS_ARANGE_MASK));
secondarySetState(psDroid, DSO_REPAIR_LEVEL, (SECONDARY_STATE)(psCommander->secondaryOrder & DSS_REPLEV_MASK));
secondarySetState(psDroid, DSO_ATTACK_LEVEL, (SECONDARY_STATE)(psCommander->secondaryOrder & DSS_ALEV_MASK));
secondarySetState(psDroid, DSO_HALTTYPE, (SECONDARY_STATE)(psCommander->secondaryOrder & DSS_HALT_MASK));
orderDroidObj(psDroid, DORDER_GUARD, (BASE_OBJECT *)psCommander);
}
@ -265,3 +265,4 @@ static void cmdDroidSetAvailable(SDWORD player, SDWORD num)