summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-31 11:51:33 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-31 19:51:59 +0000
commitd5d2c0e651a53d1a9f9f6e5825b26511efdf267f (patch)
tree15fa057d9261bebdf2f6a4a6f170ab6169a3ce98
parent35cf7c6b3c8cb68ab2dc394b7d30c2eacd438dd7 (diff)
downloadwireshark-d5d2c0e651a53d1a9f9f6e5825b26511efdf267f.tar.gz
ws_cpuid() returns a success/failure indication; make it gboolean.
Change-Id: I03403ce29c4ac343d56fc2cf33aa8da90a082cbb Reviewed-on: https://code.wireshark.org/review/6185 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--wsutil/ws_cpuid.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/wsutil/ws_cpuid.h b/wsutil/ws_cpuid.h
index b1bd5baebc..4ef0fc88f6 100644
--- a/wsutil/ws_cpuid.h
+++ b/wsutil/ws_cpuid.h
@@ -28,19 +28,19 @@
*/
#if defined(_MSC_VER) /* MSVC */
-static int
+static gboolean
ws_cpuid(guint32 *CPUInfo, guint32 selector)
{
CPUInfo[0] = CPUInfo[1] = CPUInfo[2] = CPUInfo[3] = 0;
__cpuid((int *) CPUInfo, selector);
/* XXX, how to check if it's supported on MSVC? just in case clear all flags above */
- return 1;
+ return TRUE;
}
#elif defined(__GNUC__) /* GCC/clang */
#if defined(__x86_64__)
-static inline int
+static inline gboolean
ws_cpuid(guint32 *CPUInfo, int selector)
{
__asm__ __volatile__("cpuid"
@@ -49,30 +49,30 @@ ws_cpuid(guint32 *CPUInfo, int selector)
"=c" (CPUInfo[2]),
"=d" (CPUInfo[3])
: "a"(selector));
- return 1;
+ return TRUE;
}
#elif defined(__i386__)
-static int
+static gboolean
ws_cpuid(guint32 *CPUInfo _U_, int selector _U_)
{
/* TODO: need a test if older proccesors have the cpuid instruction */
- return 0;
+ return FALSE;
}
#elif
-static int
+static gboolean
ws_cpuid(guint32 *CPUInfo _U_, int selector _U_)
{
/* Not x86, so no cpuid instruction */
- return 0;
+ return FALSE;
}
#endif
#else /* Other compilers */
-static int
+static gboolean
ws_cpuid(guint32 *CPUInfo _U_, int selector _U_)
{
- return 0;
+ return FALSE;
}
#endif