eliminate -Wextra and -pedantic warnings

This commit is contained in:
Jinhao
2016-03-15 15:46:28 +08:00
parent 8f995ee2cf
commit 6b6b527007
38 changed files with 246 additions and 197 deletions

View File

@@ -153,7 +153,7 @@ namespace detail
delete impl_;
}
void bedrock::map_thread_root_buffer(core_window_t*, bool forced, const rectangle*)
void bedrock::map_thread_root_buffer(core_window_t*, bool /*forced*/, const rectangle*)
{
//GUI in X11 is thread-independent, so no implementation.
}
@@ -366,7 +366,7 @@ namespace detail
return impl_->estore;
}
void bedrock::map_through_widgets(core_window_t* wd, native_drawable_type drawable)
void bedrock::map_through_widgets(core_window_t*, native_drawable_type)
{
//No implementation for Linux
}
@@ -523,7 +523,7 @@ namespace detail
}
}
void window_proc_for_packet(Display * display, nana::detail::msg_packet_tag& msg)
void window_proc_for_packet(Display * /*display*/, nana::detail::msg_packet_tag& msg)
{
static auto& brock = detail::bedrock::instance();
@@ -642,7 +642,7 @@ namespace detail
return wchar_t(keysym);
}
void window_proc_for_xevent(Display* display, XEvent& xevent)
void window_proc_for_xevent(Display* /*display*/, XEvent& xevent)
{
typedef detail::bedrock::core_window_t core_window_t;
@@ -1308,7 +1308,7 @@ namespace detail
}
}
void bedrock::pump_event(window modal_window, bool is_modal)
void bedrock::pump_event(window modal_window, bool /*is_modal*/)
{
thread_context * context = open_thread_context();
if(0 == context->window_count)

View File

@@ -173,6 +173,8 @@ namespace nana{
mi.rcWork.right - mi.rcWork.left, mi.rcWork.bottom - mi.rcWork.top);
}
}
#else
static_cast<void>(pos); //eliminate unused parameter compiler warning.
#endif
return rectangle{ primary_monitor_size() };
}
@@ -547,6 +549,8 @@ namespace nana{
activate_window(reinterpret_cast<native_window_type>(
::GetWindow(reinterpret_cast<HWND>(wd), GW_OWNER)
));
#else
static_cast<void>(wd); //eliminate unused parameter compiler warning.
#endif
}
@@ -565,6 +569,8 @@ namespace nana{
else
::PostMessage(native_wd, nana::detail::messages::async_activate, 0, 0);
}
#else
static_cast<void>(wd); //eliminate unused parameter compiler warning.
#endif
}
@@ -640,6 +646,7 @@ namespace nana{
::XFlush(disp);
}
static_cast<void>(active); //eliminate unused parameter compiler warning.
#endif
}
@@ -715,6 +722,7 @@ namespace nana{
#if defined(NANA_WINDOWS)
::InvalidateRect(reinterpret_cast<HWND>(wd), nullptr, true);
#elif defined(NANA_X11)
static_cast<void>(wd); //eliminate unused parameter compiler warning.
#endif
}
@@ -963,6 +971,7 @@ namespace nana{
::SetWindowPos(native_wd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
::AttachThreadInput(::GetCurrentThreadId(), fg_tid, FALSE);
#else
static_cast<void>(activated); //eliminate unused parameter compiler warning.
set_window_z_order(wd, nullptr, z_order_action::top);
#endif
}
@@ -1414,6 +1423,11 @@ namespace nana{
if(static_cast<unsigned>(y) > sz.height + ext_height)
sz.height = static_cast<unsigned>(y);
}
#else
//eliminate unused parameter compiler warning.
static_cast<void>(ext_width);
static_cast<void>(ext_height);
static_cast<void>(true_for_max);
#endif
return sz;
}

View File

@@ -357,7 +357,7 @@ namespace nana
//_m_notify_glasses
//@brief: Notify the glass windows that are overlapped with the specified vis_rect
void window_layout::_m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& r_visual)
void window_layout::_m_notify_glasses(core_window_t* const sigwd, const nana::rectangle& /*r_visual*/)
{
typedef category::flags cat_flags;