mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
visual studio 2012 Level 4 warning fixes
This commit is contained in:
parent
835649aa2f
commit
502e346eb6
8 changed files with 19 additions and 24 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue