Skip to content

Commit

Permalink
fix: remove to_string override for int64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 22, 2024
1 parent 8818a66 commit b02d478
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "./socket.h"
#include "./zmq_inc.h"
#include "util/error.h"
#include "util/to_string.h"

namespace zmq {
static inline Napi::String Version(const Napi::Env& env) {
Expand All @@ -17,8 +16,9 @@ static inline Napi::String Version(const Napi::Env& env) {
int32_t patch = 0;
zmq_version(&major, &minor, &patch);

return Napi::String::New(
env, to_string(major) + "." + to_string(minor) + "." + to_string(patch));
return Napi::String::New(env,
std::to_string(major) + "." + std::to_string(minor) + "."
+ std::to_string(patch));
}

static inline Napi::Object Capabilities(const Napi::Env& env) {
Expand Down
2 changes: 1 addition & 1 deletion src/observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Observer::Observer(const Napi::CallbackInfo& info)

/* Use `this` pointer as unique identifier for monitoring socket. */
auto address = std::string("inproc://zmq.monitor.")
+ to_string(reinterpret_cast<uintptr_t>(this));
+ std::to_string(reinterpret_cast<uintptr_t>(this));

if (zmq_socket_monitor(target->socket, address.c_str(), ZMQ_EVENT_ALL) < 0) {
ErrnoException(Env(), zmq_errno()).ThrowAsJavaScriptException();
Expand Down
2 changes: 1 addition & 1 deletion src/proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Napi::Value Proxy::Run(const Napi::CallbackInfo& info) {

/* Use `this` pointer as unique identifier for control socket. */
auto address = std::string("inproc://zmq.proxycontrol.")
+ to_string(reinterpret_cast<uintptr_t>(this));
+ std::to_string(reinterpret_cast<uintptr_t>(this));

/* Connect publisher so we can start queueing control messages. */
if (zmq_connect(control_pub, address.c_str()) < 0) {
Expand Down
5 changes: 2 additions & 3 deletions src/util/arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include <optional>

#include "to_string.h"

namespace zmq::Arg {

using ValueMethod = bool (Napi::Value::*)() const;
Expand Down Expand Up @@ -89,7 +87,8 @@ class Validator {
[[nodiscard]] std::optional<Napi::Error> eval(const Napi::CallbackInfo& info) const {
if constexpr (I == N) {
if (info.Length() > N) {
auto msg = "Expected " + to_string(N) + " argument" + (N != 1 ? "s" : "");
auto msg =
"Expected " + std::to_string(N) + " argument" + (N != 1 ? "s" : "");
return Napi::TypeError::New(info.Env(), msg);
}

Expand Down
21 changes: 0 additions & 21 deletions src/util/to_string.h

This file was deleted.

0 comments on commit b02d478

Please sign in to comment.