Skip to content

Commit

Permalink
src: fix compiler warning in node_os
Browse files Browse the repository at this point in the history
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.

PR-URL: nodejs#24356
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
danbev authored and addaleax committed Nov 16, 2018
1 parent 39a5e7d commit 9bce686
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void GetCPUInfo(const FunctionCallbackInfo<Value>& args) {
// The array is in the format
// [model, speed, (5 entries of cpu_times), model2, speed2, ...]
std::vector<Local<Value>> 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);
Expand Down

0 comments on commit 9bce686

Please sign in to comment.