From 1e1b1050e7796f116aa08dcc9ba84ead75985e17 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 14 Nov 2018 05:24:07 +0100 Subject: [PATCH] src: fix compiler warning in node_os Currently the following compiler warnings is generated: ../src/node_os.cc:167:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare] for (size_t i = 0; i < count; i++) { ~ ^ ~~~~~ 1 warning generated. This commit changes the type of i to int. --- src/node_os.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_os.cc b/src/node_os.cc index 0b46af95f4ba78..9e5530646a3708 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -163,7 +163,7 @@ static void GetCPUInfo(const FunctionCallbackInfo& args) { // The array is in the format // [model, speed, (5 entries of cpu_times), model2, speed2, ...] std::vector> result(count * 7); - for (size_t i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { uv_cpu_info_t* ci = cpu_infos + i; result[i * 7] = OneByteString(isolate, ci->model); result[i * 7 + 1] = Number::New(isolate, ci->speed);