Skip to content

Commit 20372ac

Browse files
gibfahnmattcolegate
authored andcommitted
Fix clang warnings (#449)
* Remove TryCatch compiler warning ``` Release/obj.target/appmetrics/geni/appmetrics.cpp:396:18: warning: 'TryCatch' is deprecated [-Wdeprecated-declarations] TryCatch try_catch; ^ ``` * Fix CallAsFunction compiler warning ``` Release/obj.target/appmetrics/geni/appmetrics.cpp:597:93: warning: 'CallAsFunction' is deprecated [-Wdeprecated-declarations] Local<Value> m = module->Get(Nan::New<String>("require").ToLocalChecked())->ToObject()->CallAsFunction(Nan::GetCurrentContext()->Global(), 1, args); ^ /Users/gib/.cache/node-gyp/6.10.3/include/node/v8.h:2984:30: note: 'CallAsFunction' has been explicitly marked deprecated here Local<Value> CallAsFunction(Local<Value> recv, int argc, ^ ``` * Fix other compiler warnings
1 parent 5e72dc8 commit 20372ac

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/appmetrics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ static void emitMessage(uv_async_t *handle, int status) {
393393
uv_mutex_unlock(messageListMutex);
394394

395395
while(currentMessage != NULL ) {
396+
396397
Nan::TryCatch try_catch;
398+
397399
const unsigned argc = 2;
398400
Local<Value> argv[argc];
399401
const char * source = (*currentMessage->source).c_str();

src/plugins/node/gc/nodegcplugin.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ static unsigned long long GetRealTime() {
128128
}
129129
#endif
130130

131-
void beforeGC(GCType type, GCCallbackFlags flags) {
131+
void beforeGC(v8::Isolate *isolate, GCType type, GCCallbackFlags flags) {
132132
plugin::timingOK = GetSteadyTime(&plugin::gcSteadyStart);
133133
}
134134

135-
void afterGC(GCType type, GCCallbackFlags flags) {
135+
void afterGC(v8::Isolate *isolate, GCType type, GCCallbackFlags flags) {
136136
unsigned long long gcRealEnd;
137137

138138
// GC pause time
@@ -201,12 +201,12 @@ extern "C" {
201201

202202
NODEGCPLUGIN_DECL int ibmras_monitoring_plugin_start() {
203203
plugin::api.logMessage(fine, "[gc_node] Starting");
204-
205-
V8::AddGCPrologueCallback(beforeGC);
206-
V8::AddGCEpilogueCallback(afterGC);
204+
205+
v8::Isolate::GetCurrent()->AddGCPrologueCallback(beforeGC);
206+
v8::Isolate::GetCurrent()->AddGCEpilogueCallback(afterGC);
207207
return 0;
208208
}
209-
209+
210210
NODEGCPLUGIN_DECL int ibmras_monitoring_plugin_stop() {
211211
plugin::api.logMessage(fine, "[gc_node] Stopping");
212212
// TODO Unhook GC hooks...

src/plugins/node/loop/nodeloopplugin.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ static char* NewCString(const std::string& s) {
5151
return result;
5252
}
5353

54-
static void cleanupHandle(uv_handle_t *handle) {
55-
delete handle;
56-
}
57-
5854
uv_check_t check_handle;
5955
int32_t min = 9999;
6056
int32_t max = 0;

0 commit comments

Comments
 (0)