From 4f02eceeb1d0311906bbd49572fa7758a3889ed5 Mon Sep 17 00:00:00 2001 From: June Tate-Gans Date: Sun, 25 Apr 2021 00:37:26 -0500 Subject: [PATCH] warnings: Fix a bunch of warnings This is in prep to turn on more warnings. - Stop using libusb_set_debug, according to the deprecation warning for libusb. - Return correctly in G13_Manager::run - Fix the ostream logging helper to return an ostream instead of just returning whatever the last expression was. --- src/g13.cc | 4 +++- src/helper.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/g13.cc b/src/g13.cc index 8e81d9f..938b24e 100644 --- a/src/g13.cc +++ b/src/g13.cc @@ -747,7 +747,7 @@ int G13_Manager::run() { return 1; } - libusb_set_debug(ctx, 3); + libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, 3); cnt = libusb_get_device_list(ctx, &devs); if (cnt < 0) { G13_LOG( error, "Error while getting device list" ); @@ -788,6 +788,8 @@ int G13_Manager::run() { } } while (running); cleanup(); + + return 0; } } // namespace G13 diff --git a/src/helper.h b/src/helper.h index b815473..dcd6dc0 100644 --- a/src/helper.h +++ b/src/helper.h @@ -178,6 +178,7 @@ STREAM_T &operator <<( STREAM_T &o, const _map_keys_out &_mko ) { o << _mko.sep << i->first; } } + return o; }; template