diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 266: NativeStateDRM: A few small cleanup items.

Message ID 20130305183018.26037.95716.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Jesse Barker March 5, 2013, 6:30 p.m. UTC
------------------------------------------------------------
revno: 266
committer: Jesse Barker <jesse.barker@linaro.org>
branch nick: trunk
timestamp: Tue 2013-03-05 10:27:46 -0800
message:
  NativeStateDRM: A few small cleanup items.
  
  - Mark NativeStateDRM::should_quit_ as volatile and of type sig_atomic_t
  - Fixup a few C-style casts that snuck in during the last refactor
  - Comment out, rather than cast awaw unused function parameters
modified:
  src/native-state-drm.cpp
  src/native-state-drm.h


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/native-state-drm.cpp'
--- src/native-state-drm.cpp	2013-03-04 18:52:20 +0000
+++ src/native-state-drm.cpp	2013-03-05 18:27:46 +0000
@@ -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'
--- src/native-state-drm.h	2013-03-04 18:52:20 +0000
+++ src/native-state-drm.h	2013-03-05 18:27:46 +0000
@@ -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();