=== modified file 'src/native-state-drm.cpp'
@@ -24,7 +24,6 @@
*/
#include "native-state-drm.h"
#include "log.h"
-#include <csignal>
/******************
* Public methods *
@@ -42,7 +41,7 @@
void*
NativeStateDRM::display()
{
- return (void*)dev_;
+ return static_cast<void*>(dev_);
}
bool
@@ -62,7 +61,7 @@
properties = WindowProperties(mode_->hdisplay,
mode_->vdisplay,
true, 0);
- return (void*)surface_;
+ return static_cast<void*>(surface_);
}
void
@@ -292,25 +291,19 @@
return true;
}
-bool NativeStateDRM::should_quit_ = false;
+volatile std::sig_atomic_t NativeStateDRM::should_quit_(false);
void
-NativeStateDRM::quit_handler(int signo)
+NativeStateDRM::quit_handler(int /*signo*/)
{
- Log::debug("Got SIGINT (%d).\n", signo);
should_quit_ = true;
}
void
-NativeStateDRM::page_flip_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void* data)
+NativeStateDRM::page_flip_handler(int/* fd */, unsigned int /* frame */, unsigned int /* sec */, unsigned int /* usec */, void* data)
{
unsigned int* waiting = reinterpret_cast<unsigned int*>(data);
*waiting = 0;
- // Deal with unused parameters
- static_cast<void>(fd);
- static_cast<void>(frame);
- static_cast<void>(sec);
- static_cast<void>(usec);
}
void
=== modified file 'src/native-state-drm.h'
@@ -26,6 +26,7 @@
#define GLMARK2_NATIVE_STATE_DRM_H_
#include "native-state.h"
+#include <csignal>
#include <cstring>
#include <gbm.h>
#include <drm.h>
@@ -68,7 +69,7 @@
unsigned int usec, void* data);
static void fb_destroy_callback(gbm_bo* bo, void* data);
static void quit_handler(int signum);
- static bool should_quit_;
+ static volatile std::sig_atomic_t should_quit_;
DRMFBState* fb_get_from_bo(gbm_bo* bo);
bool init_gbm();