visual studio 2012 Level 4 warning fixes

This commit is contained in:
Thomas Fischer 2014-03-15 11:38:53 +01:00
parent 835649aa2f
commit 502e346eb6
8 changed files with 19 additions and 24 deletions

View file

@ -99,12 +99,11 @@ namespace CPUInfo {
//
static unsigned int CpuIDSupported(void)
{
unsigned int MaxInputValue;
unsigned int maxInputValue = 0;
// If CPUID instruction is supported
#ifdef TORQUE_COMPILER_GCC
try
{
MaxInputValue = 0;
// call cpuid with eax = 0
asm
(
@ -112,7 +111,7 @@ namespace CPUInfo {
"xorl %%eax,%%eax\n\t"
"cpuid\n\t"
"popl %%ebx\n\t"
: "=a" (MaxInputValue)
: "=a" (maxInputValue)
:
: "%ecx", "%edx"
);
@ -124,25 +123,23 @@ namespace CPUInfo {
#elif defined( TORQUE_COMPILER_VISUALC )
try
{
MaxInputValue = 0;
// call cpuid with eax = 0
__asm
{
xor eax, eax
cpuid
mov MaxInputValue, eax
mov maxInputValue, eax
}
}
catch (...)
{
return(0); // cpuid instruction is unavailable
// cpuid instruction is unavailable
}
#else
# error Not implemented.
#endif
return MaxInputValue;
return maxInputValue;
}