diff options
author | 2016-04-24 12:57:58 +0200 | |
---|---|---|
committer | 2016-04-24 12:58:31 +0200 | |
commit | 89c5e1f681107b6d9f8ba7f761c388d1e2052fe4 (patch) | |
tree | c5ce4530d0c03fa1c04021844272b82b7b7ebcbc /src/osd/modules/osdwindow.h | |
parent | ef0968b87042040e1f0e18c84ce804f744f8e23e (diff) |
Various cleanups suggested by static analyzer (nw)
Diffstat (limited to 'src/osd/modules/osdwindow.h')
-rw-r--r-- | src/osd/modules/osdwindow.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h index 05b1020d9ab..7f20c7c7b62 100644 --- a/src/osd/modules/osdwindow.h +++ b/src/osd/modules/osdwindow.h @@ -53,7 +53,7 @@ class osd_monitor_info { public: osd_monitor_info(void *handle, const char *monitor_device, float aspect) - : m_next(NULL), m_handle(handle), m_aspect(aspect) + : m_next(nullptr), m_is_primary(false), m_handle(handle), m_aspect(aspect) { strncpy(m_name, monitor_device, ARRAY_LENGTH(m_name) - 1); } @@ -62,21 +62,21 @@ public: virtual void refresh() = 0; - const void *oshandle() { return m_handle; } + const void *oshandle() const { return m_handle; } - const osd_rect &position_size() { return m_pos_size; } - const osd_rect &usuable_position_size() { return m_usuable_pos_size; } + const osd_rect &position_size() const { return m_pos_size; } + const osd_rect &usuable_position_size() const { return m_usuable_pos_size; } const char *devicename() { return m_name[0] ? m_name : "UNKNOWN"; } - float aspect() { return m_aspect; } - float pixel_aspect() { return m_aspect / ((float)m_pos_size.width() / (float)m_pos_size.height()); } + float aspect() const { return m_aspect; } + float pixel_aspect() const { return m_aspect / ((float)m_pos_size.width() / (float)m_pos_size.height()); } - void update_resolution(const int new_width, const int new_height) { m_pos_size.resize(new_width, new_height); } + void update_resolution(const int new_width, const int new_height) const { m_pos_size.resize(new_width, new_height); } void set_aspect(const float a) { m_aspect = a; } - bool is_primary() { return m_is_primary; } + bool is_primary() const { return m_is_primary; } - osd_monitor_info * next() { return m_next; } // pointer to next monitor in list + osd_monitor_info * next() const { return m_next; } // pointer to next monitor in list static osd_monitor_info *pick_monitor(osd_options &options, int index); static osd_monitor_info *list; @@ -114,7 +114,7 @@ public: osd_window() : #ifndef OSD_SDL - m_dc(0), m_resize_state(0), + m_dc(nullptr), m_resize_state(0), #endif m_primlist(nullptr), m_index(0), @@ -162,7 +162,7 @@ public: m_platform_window = window; } - std::shared_ptr<osd_window> main_window() { return m_main; } + std::shared_ptr<osd_window> main_window() const { return m_main; } void set_main_window(std::shared_ptr<osd_window> main) { m_main = main; } // Clips the pointer to the bounds of this window @@ -176,7 +176,7 @@ public: #ifndef OSD_SDL virtual bool win_has_menu() = 0; - // FIXME: cann we replace winwindow_video_window_monitor(NULL) with monitor() ? + // FIXME: cann we replace winwindow_video_window_monitor(nullptr) with monitor() ? virtual osd_monitor_info *winwindow_video_window_monitor(const osd_rect *proposed) = 0; HDC m_dc; // only used by GDI renderer! @@ -225,7 +225,7 @@ public: return m_window.lock(); } - bool has_flags(const int flag) { return ((m_flags & flag)) == flag; } + bool has_flags(const int flag) const { return ((m_flags & flag)) == flag; } void set_flags(int aflag) { m_flags |= aflag; } void clear_flags(int aflag) { m_flags &= ~aflag; } |