Skip to content

Commit

Permalink
binding/src: finally enable deprecation warnings again. deprecation-f…
Browse files Browse the repository at this point in the history
…ree at last!
  • Loading branch information
chjj committed Dec 17, 2018
1 parent 6208874 commit 3a3bb28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 1 addition & 8 deletions binding.gyp
Expand Up @@ -93,15 +93,8 @@
"-Wno-unused-parameter",
"-Wno-unknown-warning-option",
"-Wno-unused-const-variable",
"-Wno-undefined-internal",
"-Wno-deprecated-declarations"
"-Wno-undefined-internal"
],
"xcode_settings": {
"OTHER_CFLAGS": [
"-Wno-deprecated-declarations"
]
},
"msvs_disabled_warnings": [4996],
"include_dirs": [
"/usr/local/include",
"<!(node -e \"require('nan')\")"
Expand Down
7 changes: 4 additions & 3 deletions src/secp256k1.cc
Expand Up @@ -64,7 +64,7 @@
#define UPDATE_COMPRESSED_VALUE(compressed, value, v_true, v_false) { \
if (!value->IsUndefined()) { \
CHECK_TYPE_BOOLEAN(value, COMPRESSED_TYPE_INVALID); \
compressed = value->BooleanValue() ? v_true : v_false; \
compressed = Nan::To<bool>(value).FromJust() ? v_true : v_false; \
} \
}

Expand Down Expand Up @@ -132,7 +132,8 @@
}

#define CHECK_NUMBER_IN_INTERVAL(number, x, y, message) { \
if (number->IntegerValue() <= x || number->IntegerValue() >= y) { \
if (Nan::To<int64_t>(number).FromJust() <= x || \
Nan::To<int64_t>(number).FromJust() >= y) { \
return Nan::ThrowRangeError(message); \
} \
}
Expand Down Expand Up @@ -677,7 +678,7 @@ NAN_METHOD(BSecp256k1::recover) {
v8::Local<v8::Object> recid_object = info[2].As<v8::Object>();
CHECK_TYPE_NUMBER(recid_object, RECOVERY_ID_TYPE_INVALID);
CHECK_NUMBER_IN_INTERVAL(recid_object, -1, 4, RECOVERY_ID_VALUE_INVALID);
int recid = (int) recid_object->IntegerValue();
int recid = (int) Nan::To<int64_t>(recid_object).FromJust();

unsigned int flags = SECP256K1_EC_COMPRESSED;
UPDATE_COMPRESSED_VALUE(flags, info[3], SECP256K1_EC_COMPRESSED, SECP256K1_EC_UNCOMPRESSED);
Expand Down

0 comments on commit 3a3bb28

Please sign in to comment.