Skip to content

Commit

Permalink
deps: update dependencies
Browse files Browse the repository at this point in the history
- deps: update dependencies
  - @mapbox/node-pre-gyp from v1.0.6 -> 1.0.8
  - autod from 3.1.1 -> 3.1.2
  - urllib from 2.37.4 -> 2.38.0
- chore: add gcc flag -Wconversion & -Wno-sign-conversion to detect precision loss by implicit conversions

PR-URL: #116
Reviewed-BY: hyj1991 <[email protected]>
  • Loading branch information
hyj1991 authored Dec 18, 2021
1 parent 170052b commit ca07a81
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': [
"-std=c++14"
"-std=c++14",
"-Wconversion",
"-Wno-sign-conversion",
]
},
"defines": [
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
},
"homepage": "https://github.com/X-Profiler/xprofiler#readme",
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.6",
"@mapbox/node-pre-gyp": "^1.0.8",
"moment": "^2.29.1",
"nan": "^2.15.0",
"uuid": "^8.3.2",
"yargs": "^15.4.1"
},
"devDependencies": {
"@istanbuljs/schema": "^0.1.3",
"autod": "^3.1.1",
"autod": "^3.1.2",
"clang-format": "^1.6.0",
"codecov": "^3.8.3",
"eslint": "^6.8.0",
Expand All @@ -73,7 +73,7 @@
"mocha": "^7.2.0",
"nyc": "^15.1.0",
"tunnel-agent": "^0.6.0",
"urllib": "^2.37.4"
"urllib": "^2.38.0"
},
"xctlIpcPath": {
"unix": "xprofiler-ctl-uds-path.sock",
Expand Down
2 changes: 1 addition & 1 deletion src/library/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ string FmtMessage(const char *format, ...) {
}

string RandNum() {
srand(uv_hrtime() + rand());
srand(static_cast<int>(uv_hrtime() + rand()));
return std::to_string(rand() % 900000 + 100000);
}

Expand Down
4 changes: 2 additions & 2 deletions src/logbypass/gc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ unsigned int TotalGcTimes() {
return gc_statistics->total_gc_times;
}

unsigned int TotalGcDuration() {
unsigned long TotalGcDuration() {
if (gc_statistics == nullptr) {
return 0;
}
Expand All @@ -44,7 +44,7 @@ NAN_GC_CALLBACK(GCEpilogueCallback) {
}

gc_statistics->total_gc_times++;
unsigned int duration = (now - start) / 10e5; // cost, ms
unsigned int duration = static_cast<int>((now - start) / 10e5); // cost, ms

// check duration is legal
if (duration >= 5 * 60 * 1000) {
Expand Down
2 changes: 1 addition & 1 deletion src/logbypass/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef struct GcStatistics {
int InitGcStatusHooks();
void WriteGcStatusToLog(bool log_format_alinode);
unsigned int TotalGcTimes();
unsigned int TotalGcDuration();
unsigned long TotalGcDuration();
} // namespace xprofiler

#endif
4 changes: 2 additions & 2 deletions src/platform/unix/ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void CreateIpcServer(void (*parsecmd)(char *)) {

// read client data
char data_buffer[CLIENT_BUFFER_SIZE] = {0};
int recv_res = recv(new_client_fd, data_buffer, CLIENT_BUFFER_SIZE, 0);
ssize_t recv_res = recv(new_client_fd, data_buffer, CLIENT_BUFFER_SIZE, 0);
if (recv_res == -1) {
TEARDOWN("recv client data error.")
continue;
Expand Down Expand Up @@ -158,7 +158,7 @@ void CreateIpcClient(char *message) {
}

// send message
int send_res = send(client_fd, message, strlen(message), 0);
ssize_t send_res = send(client_fd, message, strlen(message), 0);
if (send_res == -1) {
Error("ipc", "send message failed: %s.", message);
return;
Expand Down

0 comments on commit ca07a81

Please sign in to comment.