Merge pull request #8236 from unknownbrackets/warnings

Warning fixes
This commit is contained in:
Henrik Rydgård committed 2015-11-26 13:07:31 +01:00
commit 63dcc56bc6
8 files changed
+25 -36

No files matched your search

-2
View File
@@ -389,8 +389,6 @@ void ConvertRGBA5551ToRGBA8888(u32 *dst32, const u16 *src, const u32 numPixels)
void ConvertRGBA4444ToRGBA8888(u32 *dst32, const u16 *src, const u32 numPixels) {
#ifdef _M_SSE
const __m128i mask4 = _mm_set1_epi16(0x000f);
const __m128i mask8 = _mm_set1_epi16(0x00ff);
const __m128i one = _mm_set1_epi16(0x0001);
const __m128i *srcp = (const __m128i *)src;
__m128i *dstp = (__m128i *)dst32;
+1 -5
View File
@@ -791,8 +791,6 @@ bool KeyToPspButton(int deviceId, int key, std::vector<int> *pspKeys) {
// TODO: vector output
bool KeyFromPspButton(int btn, std::vector<KeyDef> *keys) {
int search_start_layer = 0;
for (auto iter = g_controllerMap.begin(); iter != g_controllerMap.end(); ++iter) {
if (iter->first == btn) {
for (auto iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) {
@@ -800,7 +798,7 @@ bool KeyFromPspButton(int btn, std::vector<KeyDef> *keys) {
}
}
}
return false;
return keys->size() > 0;
}
bool AxisToPspButton(int deviceId, int axisId, int direction, std::vector<int> *pspKeys) {
@@ -809,8 +807,6 @@ bool AxisToPspButton(int deviceId, int axisId, int direction, std::vector<int> *
}
bool AxisFromPspButton(int btn, int *deviceId, int *axisId, int *direction) {
int search_start_layer = 0;
for (auto iter = g_controllerMap.begin(); iter != g_controllerMap.end(); ++iter) {
for (auto iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) {
if (iter->first == btn && iter2->keyCode >= AXIS_BIND_NKCODE_START) {
-2
View File
@@ -61,8 +61,6 @@ const int SCE_ERROR_MODULE_BAD_ID = 0x80111101;
const int SCE_ERROR_MODULE_ALREADY_LOADED = 0x80111102;
const int SCE_ERROR_MODULE_NOT_LOADED = 0x80111103;
const int SCE_ERROR_AV_MODULE_BAD_ID = 0x80110F01;
const u32 PSP_MODULE_NET_HTTP = 0x0105;
const u32 PSP_MODULE_NET_HTTPSTORAGE = 0x0108;
int oldStatus = 100; //random value
struct ModuleLoadInfo {
-1
View File
@@ -195,7 +195,6 @@ namespace MIPSDis
}
void Dis_ori(MIPSOpcode op, char *out)
{
s32 simm = (s32)(s16)(op & 0xFFFF);
u32 uimm = (u32)(u16)(op & 0xFFFF);
int rt = _RT;
int rs = _RS;
-1
View File
@@ -101,7 +101,6 @@ static bool IsReallyAClear(const TransformedVertex *transformed, int numVerts) {
int bufW = gstate_c.curRTWidth;
int bufH = gstate_c.curRTHeight;
float prevX = 0.0f;
for (int i = 1; i < numVerts; i++) {
if (transformed[i].color0_32 != matchcolor || transformed[i].z != matchz)
return false;
+1 -3
View File
@@ -441,7 +441,7 @@ static void SplinePatchFullQuality(u8 *&dest, u16 *indices, int &count, const Sp
delete[] knot_v;
// Hacky normal generation through central difference.
if (spatch.computeNormals && !origNrm) {
if (computeNormals && !origNrm) {
#ifdef _M_SSE
const __m128 facing = spatch.patchFacing ? _mm_set_ps1(-1.0f) : _mm_set_ps1(1.0f);
#endif
@@ -451,7 +451,6 @@ static void SplinePatchFullQuality(u8 *&dest, u16 *indices, int &count, const Sp
Vec3f vc_pos = vertices[v * (patch_div_s + 1)].pos;
for (int u = 0; u < patch_div_s + 1; u++) {
const int l = std::max(0, u - 1);
const int t = std::max(0, v - 1);
const int r = std::min(patch_div_s, u + 1);
const int b = std::min(patch_div_t, v + 1);
@@ -659,7 +658,6 @@ static void _BezierPatchHighQuality(u8 *&dest, u16 *&indices, int &count, int te
for (int tile_u = 0; tile_u < tess_u + 1; ++tile_u) {
float u = ((float)tile_u / (float)tess_u);
float v = ((float)tile_v / (float)tess_v);
float bu = u;
float bv = v;
// TODO: Should be able to precompute the four curves per U, then just Bernstein per V. Will benefit large tesselation factors.
+1 -3
View File
@@ -677,8 +677,6 @@ CheckAlphaResult CheckAlphaABGR1555Basic(const u32 *pixelData, int stride, int w
#endif
}
u32 hitZeroAlpha = 0;
const u32 *p = pixelData;
const int w2 = (w + 1) / 2;
const int stride2 = (stride + 1) / 2;
@@ -755,7 +753,7 @@ CheckAlphaResult CheckAlphaRGBA5551Basic(const u32 *pixelData, int stride, int w
return CHECKALPHA_ZERO;
}
p += stride;
p += stride2;
}
return CHECKALPHA_FULL;
+22 -19
View File
@@ -1338,24 +1338,21 @@ void DrawTriangle(const VertexData& v0, const VertexData& v1, const VertexData&
int range = (maxY - minY) / 16 + 1;
if (gstate.isModeClear()) {
if (range >= 24 && (maxX - minX) >= 24 * 16)
{
VertexData v[3] = { v0, v1, v2 };
auto bound = [&](int a, int b) -> void {DrawTriangleSlice<true>(v0, v1, v2, minX, minY, maxX, maxY, a, b); };
if (range >= 24 && (maxX - minX) >= 24 * 16) {
auto bound = [&](int a, int b) -> void {
DrawTriangleSlice<true>(v0, v1, v2, minX, minY, maxX, maxY, a, b);
};
GlobalThreadPool::Loop(bound, 0, range);
}
else
{
} else {
DrawTriangleSlice<true>(v0, v1, v2, minX, minY, maxX, maxY, 0, range);
}
} else {
if (range >= 24 && (maxX - minX) >= 24 * 16)
{
auto bound = [&](int a, int b) -> void {DrawTriangleSlice<false>(v0, v1, v2, minX, minY, maxX, maxY, a, b); };
if (range >= 24 && (maxX - minX) >= 24 * 16) {
auto bound = [&](int a, int b) -> void {
DrawTriangleSlice<false>(v0, v1, v2, minX, minY, maxX, maxY, a, b);
};
GlobalThreadPool::Loop(bound, 0, range);
}
else
{
} else {
DrawTriangleSlice<false>(v0, v1, v2, minX, minY, maxX, maxY, 0, range);
}
}
@@ -1431,12 +1428,15 @@ void DrawPoint(const VertexData &v0)
DrawingCoords p = TransformUnit::ScreenToDrawing(pprime);
u16 z = pos.z;
u8 fog = ClampFogDepth(v0.fogdepth);
u8 fog = 255;
if (gstate.isFogEnabled() && !clearMode) {
fog = ClampFogDepth(v0.fogdepth);
}
if (clearMode) {
DrawSinglePixel<true>(p, z, v0.fogdepth, prim_color);
DrawSinglePixel<true>(p, z, fog, prim_color);
} else {
DrawSinglePixel<false>(p, z, v0.fogdepth, prim_color);
DrawSinglePixel<false>(p, z, fog, prim_color);
}
}
@@ -1512,7 +1512,10 @@ void DrawLine(const VertexData &v0, const VertexData &v1)
Vec2<float> tc = (v0.texturecoords * (float)(steps - i) + v1.texturecoords * (float)i) / steps1;
Vec4<int> prim_color = c0;
// TODO: Interpolate fog as well
u8 fog = 255;
if (gstate.isFogEnabled() && !clearMode) {
fog = ClampFogDepth((v0.fogdepth * (float)(steps - i) + v1.fogdepth * (float)i) / steps1);
}
float s = tc.s();
float t = tc.t();
@@ -1535,9 +1538,9 @@ void DrawLine(const VertexData &v0, const VertexData &v1)
DrawingCoords p = TransformUnit::ScreenToDrawing(pprime);
if (clearMode) {
DrawSinglePixel<true>(p, z, v0.fogdepth, prim_color);
DrawSinglePixel<true>(p, z, fog, prim_color);
} else {
DrawSinglePixel<false>(p, z, v0.fogdepth, prim_color);
DrawSinglePixel<false>(p, z, fog, prim_color);
}
x = x + xinc;