From fb284e2e4d2a3b23f385bda9617e1a4648627e20 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 4 Mar 2015 12:07:36 +0100 Subject: [PATCH] src: fix compiler warning in smalloc.cc Fix the following compiler warning by static_casting the enum values to an uint32_t: ../src/smalloc.cc: In function 'void node::smalloc::Initialize(v8::Handle, v8::Handle, v8::Handle)': ../src/smalloc.cc:601:203: warning: enumeral and non-enumeral type in conditional expression EXTERNAL_ARRAY_TYPES(V) PR-URL: https://github.com/iojs/io.js/pull/1055 Reviewed-By: Vladimir Kurchatkin --- src/smalloc.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/smalloc.cc b/src/smalloc.cc index 319c3937605404..97ae293b4bcd80 100644 --- a/src/smalloc.cc +++ b/src/smalloc.cc @@ -592,14 +592,13 @@ void Initialize(Handle exports, uint32_t kMinType = ~0; uint32_t kMaxType = 0; - #define V(name, value) \ - types->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Uint32::NewFromUnsigned(env->isolate(), v8::value)); \ - kMinType = MIN(kMinType, v8::value); \ - kMaxType = MAX(kMinType, v8::value); - - EXTERNAL_ARRAY_TYPES(V) - #undef V +#define V(name, value) \ + types->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Uint32::NewFromUnsigned(env->isolate(), v8::value)); \ + kMinType = MIN(kMinType, static_cast(v8::value)); \ + kMaxType = MAX(kMinType, static_cast(v8::value)); + EXTERNAL_ARRAY_TYPES(V) +#undef V exports->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "types"), types); exports->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "kMinType"),