Skip to content

src: use hex not decimal in IsArrayIndex

Rodrigo Muino Tomonari requested to merge github/fork/codebytere/no-xor-pow into master

In Electron, clang enforces -Wxor-used-as-pow, so the previous line would cause the following error:

../../third_party/electron_node/src/module_wrap.cc:926:34: error: result of '2 ^ 32' is 34; did you mean '1LL << 32'? [-Werror,-Wxor-used-as-pow]
  return n_dbl > 0 && n_dbl < (2 ^ 32) - 1;
                               ~~^~~~

The simplest solution i see is to just use hex to clarify intent for the compiler, and so this PR does so.

cc @guybedford

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading