Skip to content

Commit fb284e2

Browse files
bnoordhuisvkurchatkin
authored andcommitted
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::Object>, v8::Handle<v8::Value>, v8::Handle<v8::Context>)': ../src/smalloc.cc:601:203: warning: enumeral and non-enumeral type in conditional expression EXTERNAL_ARRAY_TYPES(V) PR-URL: #1055 Reviewed-By: Vladimir Kurchatkin <[email protected]>
1 parent 8f5f12b commit fb284e2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/smalloc.cc

+7-8
Original file line numberDiff line numberDiff line change
@@ -592,14 +592,13 @@ void Initialize(Handle<Object> exports,
592592

593593
uint32_t kMinType = ~0;
594594
uint32_t kMaxType = 0;
595-
#define V(name, value) \
596-
types->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \
597-
Uint32::NewFromUnsigned(env->isolate(), v8::value)); \
598-
kMinType = MIN(kMinType, v8::value); \
599-
kMaxType = MAX(kMinType, v8::value);
600-
601-
EXTERNAL_ARRAY_TYPES(V)
602-
#undef V
595+
#define V(name, value) \
596+
types->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \
597+
Uint32::NewFromUnsigned(env->isolate(), v8::value)); \
598+
kMinType = MIN(kMinType, static_cast<uint32_t>(v8::value)); \
599+
kMaxType = MAX(kMinType, static_cast<uint32_t>(v8::value));
600+
EXTERNAL_ARRAY_TYPES(V)
601+
#undef V
603602

604603
exports->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "types"), types);
605604
exports->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "kMinType"),

0 commit comments

Comments
 (0)