summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chin2014-12-20 18:28:17 -0500
committerGravatar Chin2014-12-21 10:58:55 -0500
commit0199a7d9ef26516779f73192dd41738ce4116c20 (patch)
tree1b1529ae3d9e4e8e3d47d96893571a2eeb9fa4a2
parentMerge pull request #316 from yuriks/thread-handle (diff)
downloadyuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.gz
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.xz
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.zip
More warning cleanups
-rw-r--r--src/common/bit_field.h6
-rw-r--r--src/core/arm/dyncom/arm_dyncom_dec.h2
-rw-r--r--src/core/arm/dyncom/arm_dyncom_interpreter.cpp12
-rw-r--r--src/core/arm/dyncom/arm_dyncom_run.cpp1
-rw-r--r--src/core/hle/service/apt_u.cpp4
-rw-r--r--src/video_core/command_processor.cpp4
-rw-r--r--src/video_core/pica.h10
7 files changed, 21 insertions, 18 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index 3ec061e63..7c633f01f 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -168,6 +168,12 @@ public:
168 } 168 }
169 } 169 }
170 170
171 // TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
172 __forceinline bool ToBool() const
173 {
174 return Value() != 0;
175 }
176
171private: 177private:
172 // StorageType is T for non-enum types and the underlying type of T if 178 // StorageType is T for non-enum types and the underlying type of T if
173 // T is an enumeration. Note that T is wrapped within an enable_if in the 179 // T is an enumeration. Note that T is wrapped within an enable_if in the
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.h b/src/core/arm/dyncom/arm_dyncom_dec.h
index 19d94f369..70eb96e93 100644
--- a/src/core/arm/dyncom/arm_dyncom_dec.h
+++ b/src/core/arm/dyncom/arm_dyncom_dec.h
@@ -56,8 +56,6 @@
56#define RN ((instr >> 16) & 0xF) 56#define RN ((instr >> 16) & 0xF)
57/*xxxx xxxx xxxx xxxx xxxx xxxx xxxx 1111 */ 57/*xxxx xxxx xxxx xxxx xxxx xxxx xxxx 1111 */
58#define RM (instr & 0xF) 58#define RM (instr & 0xF)
59#define BIT(n) ((instr >> (n)) & 1)
60#define BITS(a,b) ((instr >> (a)) & ((1 << (1+(b)-(a)))-1))
61 59
62/* CP15 registers */ 60/* CP15 registers */
63#define OPCODE_1 BITS(21, 23) 61#define OPCODE_1 BITS(21, 23)
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index 84b4a38f0..085edb0ee 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -3746,9 +3746,9 @@ unsigned InterpreterMainLoop(ARMul_State* state)
3746 #define INC_ICOUNTER cpu->icounter++; \ 3746 #define INC_ICOUNTER cpu->icounter++; \
3747 if(cpu->Reg[15] > 0xc0000000) \ 3747 if(cpu->Reg[15] > 0xc0000000) \
3748 cpu->kernel_icounter++; 3748 cpu->kernel_icounter++;
3749 //if (debug_function(core)) \ 3749 /*if (debug_function(core)) \
3750 if (core->check_int_flag) \ 3750 if (core->check_int_flag) \
3751 goto END 3751 goto END*/
3752 //LOG_TRACE(Core_ARM11, "icounter is %llx pc is %x\n", cpu->icounter, cpu->Reg[15]) 3752 //LOG_TRACE(Core_ARM11, "icounter is %llx pc is %x\n", cpu->icounter, cpu->Reg[15])
3753 #else 3753 #else
3754 #define INC_ICOUNTER ; 3754 #define INC_ICOUNTER ;
@@ -3969,18 +3969,18 @@ unsigned InterpreterMainLoop(ARMul_State* state)
3969 3969
3970 #define UPDATE_NFLAG(dst) (cpu->NFlag = BIT(dst, 31) ? 1 : 0) 3970 #define UPDATE_NFLAG(dst) (cpu->NFlag = BIT(dst, 31) ? 1 : 0)
3971 #define UPDATE_ZFLAG(dst) (cpu->ZFlag = dst ? 0 : 1) 3971 #define UPDATE_ZFLAG(dst) (cpu->ZFlag = dst ? 0 : 1)
3972// #define UPDATE_CFLAG(dst, lop, rop) (cpu->CFlag = ((ISNEG(lop) && ISPOS(rop)) || \ 3972/* #define UPDATE_CFLAG(dst, lop, rop) (cpu->CFlag = ((ISNEG(lop) && ISPOS(rop)) || \
3973 (ISNEG(lop) && ISPOS(dst)) || \ 3973 (ISNEG(lop) && ISPOS(dst)) || \
3974 (ISPOS(rop) && ISPOS(dst)))) 3974 (ISPOS(rop) && ISPOS(dst)))) */
3975 #define UPDATE_CFLAG(dst, lop, rop) (cpu->CFlag = ((dst < lop) || (dst < rop))) 3975 #define UPDATE_CFLAG(dst, lop, rop) (cpu->CFlag = ((dst < lop) || (dst < rop)))
3976 #define UPDATE_CFLAG_CARRY_FROM_ADD(lop, rop, flag) (cpu->CFlag = (((uint64_t) lop + (uint64_t) rop + (uint64_t) flag) > 0xffffffff) ) 3976 #define UPDATE_CFLAG_CARRY_FROM_ADD(lop, rop, flag) (cpu->CFlag = (((uint64_t) lop + (uint64_t) rop + (uint64_t) flag) > 0xffffffff) )
3977 #define UPDATE_CFLAG_NOT_BORROW_FROM_FLAG(lop, rop, flag) (cpu->CFlag = ((uint64_t) lop >= ((uint64_t) rop + (uint64_t) flag))) 3977 #define UPDATE_CFLAG_NOT_BORROW_FROM_FLAG(lop, rop, flag) (cpu->CFlag = ((uint64_t) lop >= ((uint64_t) rop + (uint64_t) flag)))
3978 #define UPDATE_CFLAG_NOT_BORROW_FROM(lop, rop) (cpu->CFlag = (lop >= rop)) 3978 #define UPDATE_CFLAG_NOT_BORROW_FROM(lop, rop) (cpu->CFlag = (lop >= rop))
3979 #define UPDATE_CFLAG_WITH_NOT(dst, lop, rop) (cpu->CFlag = !(dst < lop)) 3979 #define UPDATE_CFLAG_WITH_NOT(dst, lop, rop) (cpu->CFlag = !(dst < lop))
3980 #define UPDATE_CFLAG_WITH_SC cpu->CFlag = cpu->shifter_carry_out 3980 #define UPDATE_CFLAG_WITH_SC cpu->CFlag = cpu->shifter_carry_out
3981// #define UPDATE_CFLAG_WITH_NOT(dst, lop, rop) cpu->CFlag = !((ISNEG(lop) && ISPOS(rop)) || \ 3981/* #define UPDATE_CFLAG_WITH_NOT(dst, lop, rop) cpu->CFlag = !((ISNEG(lop) && ISPOS(rop)) || \
3982 (ISNEG(lop) && ISPOS(dst)) || \ 3982 (ISNEG(lop) && ISPOS(dst)) || \
3983 (ISPOS(rop) && ISPOS(dst))) 3983 (ISPOS(rop) && ISPOS(dst))) */
3984 #define UPDATE_VFLAG(dst, lop, rop) (cpu->VFlag = (((lop < 0) && (rop < 0) && (dst >= 0)) || \ 3984 #define UPDATE_VFLAG(dst, lop, rop) (cpu->VFlag = (((lop < 0) && (rop < 0) && (dst >= 0)) || \
3985 ((lop >= 0) && (rop) >= 0 && (dst < 0)))) 3985 ((lop >= 0) && (rop) >= 0 && (dst < 0))))
3986 #define UPDATE_VFLAG_WITH_NOT(dst, lop, rop) (cpu->VFlag = !(((lop < 0) && (rop < 0) && (dst >= 0)) || \ 3986 #define UPDATE_VFLAG_WITH_NOT(dst, lop, rop) (cpu->VFlag = !(((lop < 0) && (rop < 0) && (dst >= 0)) || \
diff --git a/src/core/arm/dyncom/arm_dyncom_run.cpp b/src/core/arm/dyncom/arm_dyncom_run.cpp
index a2026cbf3..b66b92cf5 100644
--- a/src/core/arm/dyncom/arm_dyncom_run.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_run.cpp
@@ -29,7 +29,6 @@
29 29
30void switch_mode(arm_core_t *core, uint32_t mode) 30void switch_mode(arm_core_t *core, uint32_t mode)
31{ 31{
32 uint32_t tmp1, tmp2;
33 if (core->Mode == mode) { 32 if (core->Mode == mode) {
34 //Mode not changed. 33 //Mode not changed.
35 //printf("mode not changed\n"); 34 //printf("mode not changed\n");
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp
index ebfba4d8d..28b2517d8 100644
--- a/src/core/hle/service/apt_u.cpp
+++ b/src/core/hle/service/apt_u.cpp
@@ -315,8 +315,8 @@ Interface::Interface() {
315 315
316 if (file.IsOpen()) { 316 if (file.IsOpen()) {
317 // Read shared font data 317 // Read shared font data
318 shared_font.resize(file.GetSize()); 318 shared_font.resize((size_t)file.GetSize());
319 file.ReadBytes(shared_font.data(), file.GetSize()); 319 file.ReadBytes(shared_font.data(), (size_t)file.GetSize());
320 320
321 // Create shared font memory object 321 // Create shared font memory object
322 shared_font_mem = Kernel::CreateSharedMemory("APT_U:shared_font_mem"); 322 shared_font_mem = Kernel::CreateSharedMemory("APT_U:shared_font_mem");
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 9b8ecf8e3..0cc95860d 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -90,7 +90,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
90 const auto& index_info = registers.index_array; 90 const auto& index_info = registers.index_array;
91 const u8* index_address_8 = Memory::GetPointer(PAddrToVAddr(base_address + index_info.offset)); 91 const u8* index_address_8 = Memory::GetPointer(PAddrToVAddr(base_address + index_info.offset));
92 const u16* index_address_16 = (u16*)index_address_8; 92 const u16* index_address_16 = (u16*)index_address_8;
93 bool index_u16 = (bool)index_info.format; 93 bool index_u16 = index_info.format != 0;
94 94
95 DebugUtils::GeometryDumper geometry_dumper; 95 DebugUtils::GeometryDumper geometry_dumper;
96 PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value()); 96 PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value());
@@ -164,7 +164,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
164 164
165 case PICA_REG_INDEX(vs_bool_uniforms): 165 case PICA_REG_INDEX(vs_bool_uniforms):
166 for (unsigned i = 0; i < 16; ++i) 166 for (unsigned i = 0; i < 16; ++i)
167 VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i)); 167 VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i)) != 0;
168 168
169 break; 169 break;
170 170
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 06552a3ef..c98425f39 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -201,9 +201,9 @@ struct Regs {
201 }; 201 };
202 const std::array<FullTextureConfig, 3> GetTextures() const { 202 const std::array<FullTextureConfig, 3> GetTextures() const {
203 return {{ 203 return {{
204 { static_cast<bool>(texture0_enable), texture0, texture0_format }, 204 { texture0_enable.ToBool(), texture0, texture0_format },
205 { static_cast<bool>(texture1_enable), texture1, texture1_format }, 205 { texture1_enable.ToBool(), texture1, texture1_format },
206 { static_cast<bool>(texture2_enable), texture2, texture2_format } 206 { texture2_enable.ToBool(), texture2, texture2_format }
207 }}; 207 }};
208 } 208 }
209 209
@@ -590,11 +590,11 @@ struct Regs {
590 static std::string GetCommandName(int index) { 590 static std::string GetCommandName(int index) {
591 std::map<u32, std::string> map; 591 std::map<u32, std::string> map;
592 592
593 Regs regs;
594 #define ADD_FIELD(name) \ 593 #define ADD_FIELD(name) \
595 do { \ 594 do { \
596 map.insert({PICA_REG_INDEX(name), #name}); \ 595 map.insert({PICA_REG_INDEX(name), #name}); \
597 for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(regs.name) / 4; ++i) \ 596 /* TODO: change to Regs::name when VS2015 and other compilers support it */ \
597 for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \
598 map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ 598 map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \
599 } while(false) 599 } while(false)
600 600