Merge pull request #3545 from unknownbrackets/warnings

Warning fixes
This commit is contained in:
Henrik Rydgård 2013-09-01 01:34:59 -07:00
commit c05a2b652e
10 changed files with 48 additions and 37 deletions

View file

@ -246,7 +246,7 @@ public:
x.clear();
while (number > 0)
{
K first;
K first = K();
Do(first);
T second = default_val;
Do(second);
@ -283,7 +283,7 @@ public:
template<class T>
void Do(std::vector<T> &x)
{
T dv;
T dv = T();
DoVector(x, dv);
}
@ -291,7 +291,7 @@ public:
template<class T>
void DoPOD(std::vector<T> &x)
{
T dv;
T dv = T();
DoVectorPOD(x, dv);
}
@ -332,7 +332,7 @@ public:
template<class T>
void Do(std::deque<T> &x)
{
T dv;
T dv = T();
DoDeque(x, dv);
}
@ -358,7 +358,7 @@ public:
template<class T>
void Do(std::list<T> &x)
{
T dv;
T dv = T();
DoList(x, dv);
}
@ -415,7 +415,7 @@ public:
x.clear();
while (number-- > 0)
{
T it;
T it = T();
Do(it);
x.insert(it);
}

View file

@ -263,7 +263,7 @@ void Config::Save() {
IniFile::Section *recent = iniFile.GetOrCreateSection("Recent");
recent->Set("MaxRecent", iMaxRecent);
for (int i = 0; i < recentIsos.size(); i++)
for (int i = 0; i < (int)recentIsos.size(); i++)
{
char keyName[64];

View file

@ -21,13 +21,17 @@
#include "DebugInterface.h"
#include <vector>
// TODO: Replace with expression or something.
struct BreakPointCond
{
DebugInterface* debug;
DebugInterface *debug;
PostfixExpression expression;
char expressionString[128];
BreakPointCond() : debug(NULL)
{
expressionString[0] = '\0';
}
u32 Evaluate()
{
u32 result;

View file

@ -662,7 +662,7 @@ void ISOFileSystem::DoState(PointerWrap &p)
entries.clear();
for (int i = 0; i < n; ++i)
{
u32 fd;
u32 fd = 0;
OpenFileEntry of;
p.Do(fd);

View file

@ -169,7 +169,7 @@ void VirtualDiscFileSystem::DoState(PointerWrap &p)
for (int i = 0; i < entryCount; i++)
{
u32 fd;
u32 fd = 0;
OpenFileEntry of;
p.Do(fd);

View file

@ -432,7 +432,7 @@ int __KernelValidateSendMsgPipe(SceUID uid, u32 sendBufAddr, u32 sendSize, int w
{
if (sendSize & 0x80000000)
{
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d, %i, ...): illegal size %d", uid, sendSize);
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d): illegal size %d", uid, sendSize);
return SCE_KERNEL_ERROR_ILLEGAL_ADDR;
}
@ -444,7 +444,7 @@ int __KernelValidateSendMsgPipe(SceUID uid, u32 sendBufAddr, u32 sendSize, int w
if (waitMode != SCE_KERNEL_MPW_ASAP && waitMode != SCE_KERNEL_MPW_FULL)
{
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d, waitmode=%i): invalid wait mode %d", uid, waitMode);
ERROR_LOG(HLE, "__KernelSendMsgPipe(%d): invalid wait mode %d", uid, waitMode);
return SCE_KERNEL_ERROR_ILLEGAL_MODE;
}
@ -452,12 +452,12 @@ int __KernelValidateSendMsgPipe(SceUID uid, u32 sendBufAddr, u32 sendSize, int w
{
if (!__KernelIsDispatchEnabled())
{
WARN_LOG(HLE, "__KernelSendMsgPipe(%d, waitmode=%i): dispatch disabled", uid, waitMode);
WARN_LOG(HLE, "__KernelSendMsgPipe(%d): dispatch disabled", uid);
return SCE_KERNEL_ERROR_CAN_NOT_WAIT;
}
if (__IsInInterrupt())
{
WARN_LOG(HLE, "__KernelSendMsgPipe(%d, waitmode=%i): in interrupt", uid, waitMode);
WARN_LOG(HLE, "__KernelSendMsgPipe(%d): in interrupt", uid);
return SCE_KERNEL_ERROR_ILLEGAL_CONTEXT;
}
}
@ -643,12 +643,12 @@ int __KernelValidateReceiveMsgPipe(SceUID uid, u32 receiveBufAddr, u32 receiveSi
{
if (!__KernelIsDispatchEnabled())
{
WARN_LOG(HLE, "__KernelReceiveMsgPipe(%d): dispatch disabled", uid, waitMode);
WARN_LOG(HLE, "__KernelReceiveMsgPipe(%d): dispatch disabled", uid);
return SCE_KERNEL_ERROR_CAN_NOT_WAIT;
}
if (__IsInInterrupt())
{
WARN_LOG(HLE, "__KernelReceiveMsgPipe(%d): in interrupt", uid, waitMode);
WARN_LOG(HLE, "__KernelReceiveMsgPipe(%d): in interrupt", uid);
return SCE_KERNEL_ERROR_ILLEGAL_CONTEXT;
}
}

View file

@ -303,7 +303,7 @@ int sceNetAdhocTerm() {
// Probably a void function, but often returns a useful value.
int sceNetEtherNtostr(u32 macPtr, u32 bufferPtr) {
DEBUG_LOG(HLE, "sceNetEtherNtostr(%s, %x)", macPtr, bufferPtr);
DEBUG_LOG(HLE, "sceNetEtherNtostr(%08x, %08x)", macPtr, bufferPtr);
if (Memory::IsValidAddress(bufferPtr) && Memory::IsValidAddress(macPtr)) {
char *buffer = (char *)Memory::GetPointer(bufferPtr);
@ -330,6 +330,8 @@ static int hex_to_digit(int c) {
// Probably a void function, but sometimes returns a useful-ish value.
int sceNetEtherStrton(u32 bufferPtr, u32 macPtr) {
DEBUG_LOG(HLE, "sceNetEtherStrton(%08x, %08x)", bufferPtr, macPtr);
if (Memory::IsValidAddress(bufferPtr) && Memory::IsValidAddress(macPtr)) {
const char *buffer = (char *)Memory::GetPointer(bufferPtr);
u8 *mac = Memory::GetPointer(macPtr);

View file

@ -41,6 +41,8 @@ struct JitOptions
JitOptions()
{
enableBlocklink = true;
// WARNING: These options don't work properly with cache clearing.
// Need to find a smart way to handle before enabling.
immBranches = false;
continueBranches = false;
continueMaxInstructions = 300;

View file

@ -15,11 +15,12 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "../../Core/MemMap.h"
#include "../GPUState.h"
#include "Core/MemMap.h"
#include "Core/Reporting.h"
#include "GPU/GPUState.h"
#include "Rasterizer.h"
#include "Colors.h"
#include "GPU/Software/Rasterizer.h"
#include "GPU/Software/Colors.h"
extern u8* fb;
extern u8* depthbuf;
@ -85,7 +86,7 @@ static inline u32 LookupColor(unsigned int index, unsigned int level)
return DecodeRGBA8888(clut[index + clutSharingOffset]);
default:
ERROR_LOG(G3D, "Unsupported palette format: %x", gstate.getClutPaletteFormat());
ERROR_LOG_REPORT(G3D, "Software: Unsupported palette format: %x", gstate.getClutPaletteFormat());
return 0;
}
}
@ -145,7 +146,7 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData&
if (gstate.getUVProjMode() == GE_PROJMAP_POSITION) {
source = ((v0.modelpos * w0 + v1.modelpos * w1 + v2.modelpos * w2) / (w0+w1+w2));
} else {
ERROR_LOG(G3D, "Unsupported UV projection mode %x", gstate.getUVProjMode());
ERROR_LOG_REPORT(G3D, "Software: Unsupported UV projection mode %x", gstate.getUVProjMode());
}
Mat3x3<float> tgen(gstate.tgenMatrix);
@ -155,7 +156,7 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData&
}
break;
default:
ERROR_LOG(G3D, "Unsupported texture mapping mode %x!", gstate.getUVGenMode());
ERROR_LOG_REPORT(G3D, "Software: Unsupported texture mapping mode %x!", gstate.getUVGenMode());
break;
}
}
@ -213,7 +214,7 @@ static inline u32 SampleNearest(int level, unsigned int u, unsigned int v)
return LookupColor(gstate.transformClutIndex(val), level);
}
default:
ERROR_LOG(G3D, "Unsupported texture format: %x", texfmt);
ERROR_LOG_REPORT(G3D, "Software: Unsupported texture format: %x", texfmt);
return 0;
}
}
@ -452,7 +453,9 @@ static inline Vec4<int> GetTextureFunctionOutput(const Vec3<int>& prim_color_rgb
break;
default:
ERROR_LOG(G3D, "Unknown texture function %x", gstate.getTextureFunction());
ERROR_LOG_REPORT(G3D, "Software: Unknown texture function %x", gstate.getTextureFunction());
out_rgb = Vec3<int>::AssignToAll(0);
out_a = 0;
}
return Vec4<int>(out_rgb.r(), out_rgb.g(), out_rgb.b(), out_a);
@ -551,7 +554,7 @@ static inline Vec3<int> GetSourceFactor(int source_a, const Vec4<int>& dst)
return Vec4<int>::FromRGBA(gstate.getFixA()).rgb();
default:
ERROR_LOG(G3D, "Unknown source factor %x", gstate.getBlendFuncA());
ERROR_LOG_REPORT(G3D, "Software: Unknown source factor %x", gstate.getBlendFuncA());
return Vec3<int>();
}
}
@ -593,7 +596,7 @@ static inline Vec3<int> GetDestFactor(const Vec3<int>& source_rgb, int source_a,
return Vec4<int>::FromRGBA(gstate.getFixB()).rgb();
default:
ERROR_LOG(G3D, "Unknown dest factor %x", gstate.getBlendFuncB());
ERROR_LOG_REPORT(G3D, "Software: Unknown dest factor %x", gstate.getBlendFuncB());
return Vec3<int>();
}
}
@ -629,7 +632,7 @@ static inline Vec3<int> AlphaBlendingResult(const Vec3<int>& source_rgb, int sou
::abs(source_rgb.b() - dst.b()));
default:
ERROR_LOG(G3D, "Unknown blend function %x", gstate.getBlendEq());
ERROR_LOG_REPORT(G3D, "Software: Unknown blend function %x", gstate.getBlendEq());
return Vec3<int>();
}
}

View file

@ -192,7 +192,7 @@ void CopyToCurrentFboFromRam(u8* data, int srcwidth, int srcheight, int dstwidth
break;
default:
ERROR_LOG_REPORT(G3D, "Unexpected framebuffer format: %d", gstate.FrameBufFormat());
ERROR_LOG_REPORT(G3D, "Software: Unexpected framebuffer format: %d", gstate.FrameBufFormat());
}
}
@ -304,12 +304,12 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
};
if (type != GE_PRIM_TRIANGLES && type != GE_PRIM_TRIANGLE_STRIP && type != GE_PRIM_TRIANGLE_FAN && type != GE_PRIM_RECTANGLES) {
ERROR_LOG(G3D, "DL DrawPrim type: %s count: %i vaddr= %08x, iaddr= %08x", type<7 ? types[type] : "INVALID", count, gstate_c.vertexAddr, gstate_c.indexAddr);
ERROR_LOG_REPORT(G3D, "Software: DL DrawPrim type: %s count: %i vaddr= %08x, iaddr= %08x", type<7 ? types[type] : "INVALID", count, gstate_c.vertexAddr, gstate_c.indexAddr);
break;
}
if (!Memory::IsValidAddress(gstate_c.vertexAddr)) {
ERROR_LOG(G3D, "Bad vertex address %08x!", gstate_c.vertexAddr);
ERROR_LOG_REPORT(G3D, "Software: Bad vertex address %08x!", gstate_c.vertexAddr);
break;
}
@ -317,7 +317,7 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
void *indices = NULL;
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
ERROR_LOG(G3D, "Bad index address %08x!", gstate_c.indexAddr);
ERROR_LOG_REPORT(G3D, "Software: Bad index address %08x!", gstate_c.indexAddr);
break;
}
indices = Memory::GetPointer(gstate_c.indexAddr);
@ -344,7 +344,7 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
int sp_vtype = (data >> 18) & 0x3;
if (!Memory::IsValidAddress(gstate_c.vertexAddr)) {
ERROR_LOG(G3D, "Bad vertex address %08x!", gstate_c.vertexAddr);
ERROR_LOG_REPORT(G3D, "Software: Bad vertex address %08x!", gstate_c.vertexAddr);
break;
}
@ -352,14 +352,14 @@ void SoftGPU::ExecuteOp(u32 op, u32 diff)
void *indices = NULL;
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
ERROR_LOG(G3D, "Bad index address %08x!", gstate_c.indexAddr);
ERROR_LOG_REPORT(G3D, "Software: Bad index address %08x!", gstate_c.indexAddr);
break;
}
indices = Memory::GetPointer(gstate_c.indexAddr);
}
if (gstate.getPatchPrimitiveType() != GE_PATCHPRIM_TRIANGLES) {
ERROR_LOG(G3D, "Unsupported patch primitive %x", gstate.patchprimitive&3);
ERROR_LOG_REPORT(G3D, "Software: Unsupported patch primitive %x", gstate.patchprimitive&3);
break;
}