From 2eb6a4e2f2965b4d91da33357e9f1cd2168ec4e7 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 8 Mar 2014 10:40:43 +0100 Subject: [PATCH] Fix a warning, rename some parameters, etc. --- Common/ArmEmitter.cpp | 18 +++++++++--------- GPU/Common/VertexDecoderCommon.cpp | 21 +++++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index b73ab19ae2..c6be7469d0 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -1021,7 +1021,7 @@ void ARMXEmitter::WriteRegStoreOp(u32 op, ARMReg dest, bool WriteBack, u16 RegLi void ARMXEmitter::WriteVRegStoreOp(u32 op, ARMReg Rn, bool Double, bool WriteBack, ARMReg Vd, u8 numregs) { ARMReg Dest = SubBase(Vd); - Write32(condition | (op << 20) | (WriteBack << 21) | (Rn << 16) | ((Dest & 0x1) << 22) | ((Dest & 0x1E) << 11) | ((0xA | Double) << 8) | (numregs << Double) ); + Write32(condition | (op << 20) | (WriteBack << 21) | (Rn << 16) | ((Dest & 0x1) << 22) | ((Dest & 0x1E) << 11) | ((0xA | (int)Double) << 8) | (numregs << (int)Double)); } void ARMXEmitter::STMFD(ARMReg dest, bool WriteBack, const int Regnum, ...) { @@ -1284,24 +1284,24 @@ void ARMXEmitter::VCMPE(ARMReg Vd, ARMReg Vm){ WriteVFPDataOp(13, Vd, D4, Vm); } void ARMXEmitter::VCMP(ARMReg Vd){ WriteVFPDataOp(12, Vd, D5, D0); } void ARMXEmitter::VCMPE(ARMReg Vd){ WriteVFPDataOp(13, Vd, D5, D0); } -void ARMXEmitter::VLDMIA(ARMReg dest, bool WriteBack, ARMReg firstreg, int numregs) +void ARMXEmitter::VLDMIA(ARMReg ptr, bool WriteBack, ARMReg firstvreg, int numvregs) { - WriteVRegStoreOp(0x80 | 0x40 | 0x8 | 1, dest, false, WriteBack, firstreg, numregs); + WriteVRegStoreOp(0x80 | 0x40 | 0x8 | 1, ptr, false, WriteBack, firstvreg, numvregs); } -void ARMXEmitter::VSTMIA(ARMReg dest, bool WriteBack, ARMReg firstreg, int numregs) +void ARMXEmitter::VSTMIA(ARMReg ptr, bool WriteBack, ARMReg firstvreg, int numvregs) { - WriteVRegStoreOp(0x80 | 0x40 | 0x8, dest, false, WriteBack, firstreg, numregs); + WriteVRegStoreOp(0x80 | 0x40 | 0x8, ptr, false, WriteBack, firstvreg, numvregs); } -void ARMXEmitter::VLDMDB(ARMReg dest, bool WriteBack, ARMReg firstreg, int numregs) +void ARMXEmitter::VLDMDB(ARMReg ptr, bool WriteBack, ARMReg firstvreg, int numvregs) { - WriteVRegStoreOp(0x80 | 0x040 | 0x10 | 1, dest, false, WriteBack, firstreg, numregs); + WriteVRegStoreOp(0x80 | 0x040 | 0x10 | 1, ptr, false, WriteBack, firstvreg, numvregs); } -void ARMXEmitter::VSTMDB(ARMReg dest, bool WriteBack, ARMReg firstreg, int numregs) +void ARMXEmitter::VSTMDB(ARMReg ptr, bool WriteBack, ARMReg firstvreg, int numvregs) { - WriteVRegStoreOp(0x80 | 0x040 | 0x10, dest, false, WriteBack, firstreg, numregs); + WriteVRegStoreOp(0x80 | 0x040 | 0x10, ptr, false, WriteBack, firstvreg, numvregs); } void ARMXEmitter::VLDR(ARMReg Dest, ARMReg Base, s16 offset) diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index 23378ec60e..6459d7dcfa 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -51,18 +51,20 @@ void GetIndexBounds(const void *inds, int count, u32 vertType, u16 *indexLowerBo if (idx == GE_VTYPE_IDX_8BIT) { const u8 *ind8 = (const u8 *)inds; for (int i = 0; i < count; i++) { - if (ind8[i] > upperBound) - upperBound = ind8[i]; - if (ind8[i] < lowerBound) - lowerBound = ind8[i]; + u8 value = ind8[i]; + if (value > upperBound) + upperBound = value; + if (value < lowerBound) + lowerBound = value; } } else if (idx == GE_VTYPE_IDX_16BIT) { const u16 *ind16 = (const u16*)inds; for (int i = 0; i < count; i++) { - if (ind16[i] > upperBound) - upperBound = ind16[i]; - if (ind16[i] < lowerBound) - lowerBound = ind16[i]; + u16 value = ind16[i]; + if (value > upperBound) + upperBound = value; + if (value < lowerBound) + lowerBound = value; } } else { lowerBound = 0; @@ -73,8 +75,7 @@ void GetIndexBounds(const void *inds, int count, u32 vertType, u16 *indexLowerBo } void PrintDecodedVertex(VertexReader &vtx) { - if (vtx.hasNormal()) - { + if (vtx.hasNormal()) { float nrm[3]; vtx.ReadNrm(nrm); printf("N: %f %f %f\n", nrm[0], nrm[1], nrm[2]);