From 150e700729876387fad6e3cb439d0ca17f30c4aa Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 May 2015 12:59:12 -0400 Subject: process: Get rid of warnings Sign mismatches and "forcing value to bool" warnings. --- src/core/hle/kernel/process.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 1e439db9..97249adf 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -27,7 +27,7 @@ SharedPtr Process::Create(std::string name, u64 program_id) { } void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { - for (int i = 0; i < len; ++i) { + for (size_t i = 0; i < len; ++i) { u32 descriptor = kernel_caps[i]; u32 type = descriptor >> 20; @@ -64,8 +64,8 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) { AddressMapping mapping; mapping.address = descriptor << 12; mapping.size = (end_desc << 12) - mapping.address; - mapping.writable = descriptor & (1 << 20); - mapping.unk_flag = end_desc & (1 << 20); + mapping.writable = (descriptor & (1 << 20)) != 0; + mapping.unk_flag = (end_desc & (1 << 20)) != 0; address_mappings.push_back(mapping); } else if ((type & 0xFFF) == 0xFFE) { // 0x000F -- cgit v1.2.3 From 773b1ef6bffbc7b9c8d55b1f1d741e6aed7bcd88 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 May 2015 13:43:22 -0400 Subject: vfp: Get rid of warnings - Unary minus operator applied to unsigned type. - Unsafe use of bool. --- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 6 +++--- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index ab9fec39..f9104958 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -531,7 +531,7 @@ static u32 vfp_double_fsito(ARMul_State* state, int dd, int unused, int dm, u32 LOG_TRACE(Core_ARM11, "In %s\n", __FUNCTION__); vdm.sign = (m & 0x80000000) >> 16; vdm.exponent = 1023 + 63 - 1; - vdm.significand = vdm.sign ? -m : m; + vdm.significand = vdm.sign ? (~m + 1) : m; return vfp_double_normaliseround(state, dd, &vdm, fpscr, 0, "fsito"); } @@ -669,7 +669,7 @@ static u32 vfp_double_ftosi(ARMul_State* state, int sd, int unused, int dm, u32 exceptions |= FPSCR_IXC; if (vdm.sign) - d = -d; + d = (~d + 1); } else { d = 0; if (vdm.exponent | vdm.significand) { @@ -817,7 +817,7 @@ u32 vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,struct vfp_dou m_sig = vdn->significand - m_sig; if ((s64)m_sig < 0) { vdd->sign = vfp_sign_negate(vdd->sign); - m_sig = -m_sig; + m_sig = (~m_sig + 1); } else if (m_sig == 0) { vdd->sign = (fpscr & FPSCR_RMODE_MASK) == FPSCR_ROUND_MINUSINF ? 0x8000 : 0; diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 4dfe0254..a692c190 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -388,7 +388,7 @@ sqrt_invalid: } else { u64 term; s64 rem; - vsm.significand <<= !(vsm.exponent & 1); + vsm.significand <<= static_cast((vsm.exponent & 1) == 0); term = (u64)vsd.significand * vsd.significand; rem = ((u64)vsm.significand << 32) - term; @@ -691,7 +691,7 @@ static u32 vfp_single_ftosi(ARMul_State* state, int sd, int unused, s32 m, u32 f exceptions |= FPSCR_IXC; if (vsm.sign) - d = 0-d; + d = (~d + 1); } else { d = 0; if (vsm.exponent | vsm.significand) { @@ -843,7 +843,7 @@ vfp_single_add(struct vfp_single *vsd, struct vfp_single *vsn, m_sig = vsn->significand - m_sig; if ((s32)m_sig < 0) { vsd->sign = vfp_sign_negate(vsd->sign); - m_sig = 0-m_sig; + m_sig = (~m_sig + 1); } else if (m_sig == 0) { vsd->sign = (fpscr & FPSCR_RMODE_MASK) == FPSCR_ROUND_MINUSINF ? 0x8000 : 0; -- cgit v1.2.3 From 497f4bee0c7e548249b25251051763fa7f5bf250 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 May 2015 14:23:20 -0400 Subject: pica: Add the ULL specifier in IsDefaultAttribute This is necessary otherwise there are warnings about a 32-bit result being casted to a 64-bit value. --- src/video_core/pica.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index a5342971..b28b0f86 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -616,7 +616,7 @@ struct Regs { } inline bool IsDefaultAttribute(int id) const { - return (id >= 12) || (attribute_mask & (1 << id)) != 0; + return (id >= 12) || (attribute_mask & (1ULL << id)) != 0; } inline int GetNumTotalAttributes() const { -- cgit v1.2.3