Skip to content

Commit

Permalink
attempt at reducing warnings (U20)
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Sep 20, 2022
1 parent a90b131 commit c7715ac
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 18 deletions.
13 changes: 6 additions & 7 deletions src/linux/udev-device-watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,21 @@ udev_device_watcher::~udev_device_watcher()
{
stop();

if( _udev_monitor_fd == -1 )
throw runtime_error( "monitor fd was -1" );

/* Release the udev monitor */
udev_monitor_unref( _udev_monitor );
if( _udev_monitor )
udev_monitor_unref( _udev_monitor );
_udev_monitor = nullptr;
_udev_monitor_fd = -1;

/* Clean up the udev context */
udev_unref( _udev_ctx );
if( _udev_ctx )
udev_unref( _udev_ctx );
_udev_ctx = nullptr;
}


// Scan devices using udev
bool udev_device_watcher::foreach_device( std::function< bool( struct udev_device * udev_dev ) > callback )
void udev_device_watcher::foreach_device( std::function< void( struct udev_device * udev_dev ) > callback )
{
auto enumerator = udev_enumerate_new( _udev_ctx );
if( ! enumerator )
Expand All @@ -221,4 +220,4 @@ bool udev_device_watcher::foreach_device( std::function< bool( struct udev_devic
}


} // namespace librealsense
} // namespace librealsense
2 changes: 1 addition & 1 deletion src/linux/udev-device-watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class udev_device_watcher : public librealsense::platform::device_watcher
bool is_stopped() const override { return ! _active_object.is_active(); }

private:
bool foreach_device( std::function< bool( struct udev_device* udev_dev ) > );
void foreach_device( std::function< void( struct udev_device* udev_dev ) > );
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class BagCallbackT : public BagCallback
Callback cb_;
};
#ifdef _MSC_VER
#pragma warning( disable : 4290 ) // Suppress warning C4290:C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
//#pragma warning( disable : 4290 ) // Suppress warning C4290:C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
/* A class for playing back bag files at an API level. It supports
relatime, as well as accelerated and slowed playback. */
class BagPlayer
{
public:
/* Constructor expecting the filename of a bag */
BagPlayer(const std::string &filename) throw(BagException);
BagPlayer(const std::string &filename);

/* Register a callback for a specific topic and type */
template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace rosbag
{

BagPlayer::BagPlayer(const std::string &fname) throw(BagException) {
BagPlayer::BagPlayer(const std::string &fname) {
bag.open(fname, rosbag::bagmode::Read);
rs2rosinternal::Time::init();
View v(bag);
Expand Down
3 changes: 0 additions & 3 deletions third-party/realsense-file/rosbag/rostime/src/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ namespace rs2rosinternal
* (i.e. not exposed to users of the time classes)
*/
void ros_walltime(uint32_t& sec, uint32_t& nsec)
#ifndef WIN32
throw(NoHighPerformanceTimersException)
#endif
{
#ifndef WIN32
#if HAS_CLOCK_GETTIME
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/log/test-mixed-file-callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
TEST_CASE( "Mixed file & callback logging", "[log]" ) {

char filename[L_tmpnam];
tmpnam( filename );
REQUIRE( tmpnam( filename ));

TRACE( "Filename logging to: " << filename );
REQUIRE_NOTHROW( rs2::log_to_file( RS2_LOG_SEVERITY_ERROR, filename ));
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/log/test-mixed-file-console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
TEST_CASE( "Mixed file & console logging", "[log]" ) {

char filename[L_tmpnam];
tmpnam( filename );
REQUIRE( tmpnam( filename ));

TRACE( "Filename logging to: " << filename );
REQUIRE_NOTHROW( rs2::log_to_file( RS2_LOG_SEVERITY_ERROR, filename ));
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/log/test-two-files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ TEST_CASE( "Double file logging", "[log]" ) {

// Try to log to multiple destinations: callback, console, file...
char filename1[L_tmpnam], filename2[L_tmpnam];
tmpnam( filename1 );
tmpnam( filename2 );
REQUIRE( tmpnam( filename1 ));
REQUIRE( tmpnam( filename2 ));

TRACE( "Filename1 logging to: " << filename1 );
TRACE( "Filename2 logging to: " << filename2 );
Expand Down

0 comments on commit c7715ac

Please sign in to comment.