From f9f8a057b34568b3150791ca593a53510c51a457 Mon Sep 17 00:00:00 2001 From: Isabel Paredes Date: Thu, 14 Mar 2024 09:07:17 +0100 Subject: [PATCH] Minor fixes (#618) * Prevent double conversion The size would be converted from int to size_t and then back to int when calling the function backtrace_symbols_fd(). * Remove deprecated setsockop --- src/xutils.cpp | 2 +- test/xeus_client.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xutils.cpp b/src/xutils.cpp index 1b7d6207..5600a94c 100644 --- a/src/xutils.cpp +++ b/src/xutils.cpp @@ -113,7 +113,7 @@ namespace xpyt void* array[10]; // get void*'s for all entries on the stack - size_t size = backtrace(array, 10); + int size = backtrace(array, 10); // print out all the frames to stderr fprintf(stderr, "Error: signal %d:\n", sig); diff --git a/test/xeus_client.cpp b/test/xeus_client.cpp index 10424b2a..db94be5d 100644 --- a/test/xeus_client.cpp +++ b/test/xeus_client.cpp @@ -95,12 +95,12 @@ nl::json xeus_client_base::receive_on_control() void xeus_client_base::subscribe_iopub(const std::string& filter) { - m_iopub.setsockopt(ZMQ_SUBSCRIBE, filter.c_str(), filter.length()); + m_iopub.set(zmq::sockopt::subscribe, filter); } void xeus_client_base::unsubscribe_iopub(const std::string& filter) { - m_iopub.setsockopt(ZMQ_UNSUBSCRIBE, filter.c_str(), filter.length()); + m_iopub.set(zmq::sockopt::unsubscribe, filter); } nl::json xeus_client_base::receive_on_iopub()