From bb013f5c75120df0f86a7a17cbae61bdca2618f4 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 27 Aug 2016 10:05:34 +0200 Subject: fix compiler warning about std::auto_ptr fluxbox uses std::unique_ptr<> where it previously used std::auto_ptr<>. C++0X was approved in 2011. among other things, it deprecates std::auto_ptr. 5 years is long enough for compilers to catch up the standard. --- src/FbCommands.hh | 4 ++-- src/FbMenu.hh | 2 +- src/FbTk/FbWindow.hh | 2 +- src/FbTk/KeyUtil.cc | 2 +- src/FbTk/KeyUtil.hh | 2 +- src/FbTk/Menu.cc | 1 - src/FbTk/Menu.hh | 4 ++-- src/FbTk/MenuItem.hh | 4 ++-- src/FbTk/ThemeItems.cc | 4 ++-- src/FocusableList.cc | 2 +- src/FocusableList.hh | 4 ++-- src/GenericTool.hh | 2 +- src/HeadArea.hh | 2 +- src/IconbarTool.hh | 2 +- src/Remember.hh | 2 +- src/Screen.cc | 4 +--- src/Screen.hh | 24 ++++++++++++------------ src/ScreenPlacement.cc | 1 - src/ScreenPlacement.hh | 4 ++-- src/Slit.cc | 2 -- src/Slit.hh | 6 +++--- src/SystemTray.hh | 2 +- src/ToolFactory.hh | 6 +++--- src/Toolbar.hh | 2 +- src/fluxbox.hh | 4 ++-- src/tests/texturetest.cc | 2 +- 26 files changed, 45 insertions(+), 51 deletions(-) diff --git a/src/FbCommands.hh b/src/FbCommands.hh index d9639ad..4470bb3 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -127,7 +127,7 @@ private: const int m_option; const ClientPattern m_pat; std::list m_list; - std::auto_ptr m_menu; + std::unique_ptr m_menu; }; class ShowCustomMenuCmd: public FbTk::Command { @@ -137,7 +137,7 @@ public: void reload(); private: std::string custom_menu_file; - std::auto_ptr m_menu; + std::unique_ptr m_menu; }; class ShowRootMenuCmd: public FbTk::Command { diff --git a/src/FbMenu.hh b/src/FbMenu.hh index 193149f..bb23130 100644 --- a/src/FbMenu.hh +++ b/src/FbMenu.hh @@ -56,7 +56,7 @@ public: private: FbTk::LayerItem m_layeritem; - std::auto_ptr m_reloader; + std::unique_ptr m_reloader; }; #endif // FBMENU_HH diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index 5501d88..f1bbb19 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -241,7 +241,7 @@ private: unsigned long m_border_color; ///< border color unsigned int m_depth; ///< bit depth bool m_destroy; ///< wheter the x window was created before - std::auto_ptr m_transparent; + std::unique_ptr m_transparent; bool m_lastbg_color_set; unsigned long m_lastbg_color; Pixmap m_lastbg_pm; diff --git a/src/FbTk/KeyUtil.cc b/src/FbTk/KeyUtil.cc index 46a712a..73f2ea0 100644 --- a/src/FbTk/KeyUtil.cc +++ b/src/FbTk/KeyUtil.cc @@ -60,7 +60,7 @@ const struct t_modlist modlist[] = { namespace FbTk { -std::auto_ptr KeyUtil::s_keyutil; +std::unique_ptr KeyUtil::s_keyutil; KeyUtil &KeyUtil::instance() { if (s_keyutil.get() == 0) diff --git a/src/FbTk/KeyUtil.hh b/src/FbTk/KeyUtil.hh index c900763..5698fb4 100644 --- a/src/FbTk/KeyUtil.hh +++ b/src/FbTk/KeyUtil.hh @@ -93,7 +93,7 @@ private: XModifierKeymap *m_modmap; int m_numlock, m_scrolllock; - static std::auto_ptr s_keyutil; + static std::unique_ptr s_keyutil; }; } // end namespace FbTk diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 34cc6ae..6b2db3a 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -95,7 +95,6 @@ Menu::Menu(FbTk::ThemeProxy &tm, ImageControl &imgctrl): m_active_index(-1), m_theme(tm), m_image_ctrl(imgctrl), - m_shape(0), m_alignment(ALIGNDONTCARE) { Display* disp = FbTk::App::instance()->display(); diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 8bb5fdd..231b622 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh @@ -189,7 +189,7 @@ private: Menu *m_parent; std::vector m_items; - std::auto_ptr m_search; + std::unique_ptr m_search; struct State { bool moving; @@ -239,7 +239,7 @@ private: FbTk::ThemeProxy& m_theme; ImageControl& m_image_ctrl; - std::auto_ptr m_shape; // the corners + std::unique_ptr m_shape; // the corners Pixmap m_hilite_pixmap; Alignment m_alignment; diff --git a/src/FbTk/MenuItem.hh b/src/FbTk/MenuItem.hh index 4bbfcf3..6189955 100644 --- a/src/FbTk/MenuItem.hh +++ b/src/FbTk/MenuItem.hh @@ -155,10 +155,10 @@ private: bool m_close_on_click, m_toggle_item; struct Icon { - std::auto_ptr pixmap; + std::unique_ptr pixmap; std::string filename; }; - std::auto_ptr m_icon; + std::unique_ptr m_icon; }; } // end namespace FbTk diff --git a/src/FbTk/ThemeItems.cc b/src/FbTk/ThemeItems.cc index b1f9a60..a54cabb 100644 --- a/src/FbTk/ThemeItems.cc +++ b/src/FbTk/ThemeItems.cc @@ -205,7 +205,7 @@ void ThemeItem::load(const string *o_name, const string *o_altname) { return; } - std::auto_ptr pm(Image::load(pixmap_name, m_tm.screenNum())); + std::unique_ptr pm(Image::load(pixmap_name, m_tm.screenNum())); if (pm.get() == 0) { if (ThemeManager::instance().verbose()) { @@ -255,7 +255,7 @@ setFromString(const char *str) { StringUtil::removeFirstWhitespace(filename); StringUtil::removeTrailingWhitespace(filename); - std::auto_ptr pm(Image::load(filename, m_tm.screenNum())); + std::unique_ptr pm(Image::load(filename, m_tm.screenNum())); if (pm.get() == 0) setDefaultValue(); else { diff --git a/src/FocusableList.cc b/src/FocusableList.cc index 3689283..da4f6b4 100644 --- a/src/FocusableList.cc +++ b/src/FocusableList.cc @@ -74,7 +74,7 @@ const FocusableList *FocusableList::getListFromOptions(BScreen &scr, int opts) { } FocusableList::FocusableList(BScreen &scr, const string & pat): - m_pat(0), m_parent(0), m_screen(scr) { + m_parent(0), m_screen(scr) { int options = 0; string pattern; diff --git a/src/FocusableList.hh b/src/FocusableList.hh index 88bba44..bd70108 100644 --- a/src/FocusableList.hh +++ b/src/FocusableList.hh @@ -48,7 +48,7 @@ public: STATIC_ORDER = 0x02 ///< use creation order instead of focused order }; - FocusableList(BScreen &scr): m_pat(0), m_parent(0), m_screen(scr) { } + FocusableList(BScreen &scr): m_parent(0), m_screen(scr) { } FocusableList(BScreen &scr, const std::string & pat); FocusableList(BScreen &scr, const FocusableList &parent, const std::string & pat); @@ -102,7 +102,7 @@ private: void windowUpdated(FluxboxWindow &fbwin); - std::auto_ptr m_pat; + std::unique_ptr m_pat; const FocusableList *m_parent; BScreen &m_screen; std::list m_list; diff --git a/src/GenericTool.hh b/src/GenericTool.hh index 72ff462..a4307aa 100644 --- a/src/GenericTool.hh +++ b/src/GenericTool.hh @@ -65,7 +65,7 @@ protected: private: void themeReconfigured(); - std::auto_ptr m_window; + std::unique_ptr m_window; FbTk::ThemeProxy &m_theme; FbTk::SignalTracker m_tracker; }; diff --git a/src/HeadArea.hh b/src/HeadArea.hh index b0c33a6..823eba5 100644 --- a/src/HeadArea.hh +++ b/src/HeadArea.hh @@ -40,7 +40,7 @@ public: } private: - std::auto_ptr m_available_workspace_area; + std::unique_ptr m_available_workspace_area; std::list m_strutlist; }; diff --git a/src/IconbarTool.hh b/src/IconbarTool.hh index 1680f5c..21c8078 100644 --- a/src/IconbarTool.hh +++ b/src/IconbarTool.hh @@ -108,7 +108,7 @@ private: FbTk::SignalTracker m_tracker; - std::auto_ptr m_winlist; + std::unique_ptr m_winlist; IconMap m_icons; std::string m_mode; FbTk::Resource m_rc_mode; diff --git a/src/Remember.hh b/src/Remember.hh index 880fbe1..eb54821 100644 --- a/src/Remember.hh +++ b/src/Remember.hh @@ -155,7 +155,7 @@ public: private: - std::auto_ptr m_pats; + std::unique_ptr m_pats; Clients m_clients; Startups m_startups; diff --git a/src/Screen.cc b/src/Screen.cc index 277952b..53b772e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -193,7 +193,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm, unsigned int opts) : m_layermanager(num_layers), root_colormap_installed(false), - m_image_control(0), m_current_workspace(0), m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")), @@ -215,7 +214,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm, m_altname(altscreenname), m_focus_control(new FocusControl(*this)), m_placement_strategy(new ScreenPlacement(*this)), - m_cycle_opts(0), m_opts(opts) { @@ -643,7 +641,7 @@ void BScreen::propertyNotify(Atom atom) { &ret_bytes_after, (unsigned char **)&str); } - static std::auto_ptr > cmd(0); + static std::unique_ptr > cmd; cmd.reset(FbTk::CommandParser::instance().parse(str, false)); if (cmd.get()) { cmd->execute(); diff --git a/src/Screen.hh b/src/Screen.hh index f418d0c..30228ee 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -492,31 +492,31 @@ private: bool root_colormap_installed; - std::auto_ptr m_image_control; - std::auto_ptr m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu; + std::unique_ptr m_image_control; + std::unique_ptr m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu; Icons m_icon_list; - std::auto_ptr m_slit; - std::auto_ptr m_toolbar; - std::auto_ptr m_toolButtonMap; + std::unique_ptr m_slit; + std::unique_ptr m_toolbar; + std::unique_ptr m_toolButtonMap; Workspace *m_current_workspace; WorkspaceNames m_workspace_names; Workspaces m_workspaces_list; - std::auto_ptr m_focused_windowtheme, + std::unique_ptr m_focused_windowtheme, m_unfocused_windowtheme; - std::auto_ptr m_focused_winbutton_theme, + std::unique_ptr m_focused_winbutton_theme, m_unfocused_winbutton_theme, m_pressed_winbutton_theme; - std::auto_ptr m_menutheme; - std::auto_ptr m_root_theme; + std::unique_ptr m_menutheme; + std::unique_ptr m_root_theme; FbRootWindow m_root_window; - std::auto_ptr m_geom_window; - std::auto_ptr m_pos_window; - std::auto_ptr m_tooltip_window; + std::unique_ptr m_geom_window; + std::unique_ptr m_pos_window; + std::unique_ptr m_tooltip_window; FbTk::FbWindow m_dummy_window; ScreenResource resource; diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc index 29c8b5f..79149a0 100644 --- a/src/ScreenPlacement.cc +++ b/src/ScreenPlacement.cc @@ -53,7 +53,6 @@ ScreenPlacement::ScreenPlacement(BScreen &screen): screen.name()+".windowPlacement", screen.altName()+".WindowPlacement"), m_old_policy(ROWSMARTPLACEMENT), - m_strategy(0), m_screen(screen) { } diff --git a/src/ScreenPlacement.hh b/src/ScreenPlacement.hh index 05db90d..ceec2d2 100644 --- a/src/ScreenPlacement.hh +++ b/src/ScreenPlacement.hh @@ -80,8 +80,8 @@ private: FbTk::Resource m_col_direction; ///< column direction resource FbTk::Resource m_placement_policy; ///< placement policy resource PlacementPolicy m_old_policy; ///< holds old policy, used to determine if resources has changed - std::auto_ptr m_strategy; ///< main strategy - std::auto_ptr m_fallback_strategy; ///< a fallback strategy if the main strategy fails + std::unique_ptr m_strategy; ///< main strategy + std::unique_ptr m_fallback_strategy; ///< a fallback strategy if the main strategy fails BScreen& m_screen; }; diff --git a/src/Slit.cc b/src/Slit.cc index 7eb7dea..37c3b1f 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -225,8 +225,6 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) m_kwm2_dockwindow(XInternAtom(FbTk::App::instance()->display(), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False)), //KDE v2.x - m_layeritem(0), - m_slit_theme(new SlitTheme(scr.rootWindow().screenNumber())), m_strut(0), // resources diff --git a/src/Slit.hh b/src/Slit.hh index d882309..a5fdeb9 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -152,7 +152,7 @@ private: FbTk::Timer m_timer; SlitClients m_client_list; - std::auto_ptr m_layermenu; + std::unique_ptr m_layermenu; FbMenu m_clientlist_menu, m_slitmenu; #ifdef XINERAMA XineramaHeadMenu *m_xineramaheadmenu; @@ -178,8 +178,8 @@ private: // for KDE Atom m_kwm1_dockwindow, m_kwm2_dockwindow; - std::auto_ptr m_layeritem; - std::auto_ptr m_slit_theme; + std::unique_ptr m_layeritem; + std::unique_ptr m_slit_theme; static unsigned int s_eventmask; Strut *m_strut; diff --git a/src/SystemTray.hh b/src/SystemTray.hh index 470f9b9..16e703e 100644 --- a/src/SystemTray.hh +++ b/src/SystemTray.hh @@ -106,7 +106,7 @@ private: BScreen& m_screen; Pixmap m_pixmap; - std::auto_ptr m_handler; + std::unique_ptr m_handler; ClientList m_clients; size_t m_num_visible_clients; diff --git a/src/ToolFactory.hh b/src/ToolFactory.hh index 7550f48..e9490c5 100644 --- a/src/ToolFactory.hh +++ b/src/ToolFactory.hh @@ -52,9 +52,9 @@ public: private: BScreen &m_screen; ToolTheme m_clock_theme; - std::auto_ptr m_button_theme; - std::auto_ptr m_workspace_theme; - std::auto_ptr m_systray_theme; + std::unique_ptr m_button_theme; + std::unique_ptr m_workspace_theme; + std::unique_ptr m_systray_theme; IconbarTheme m_iconbar_theme, m_focused_iconbar_theme, m_unfocused_iconbar_theme; }; diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 919b22f..6521136 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -197,7 +197,7 @@ private: FbTk::Resource m_rc_placement; FbTk::Resource m_rc_height; FbTk::Resource m_rc_tools; - std::auto_ptr m_shape; + std::unique_ptr m_shape; typedef std::list StringList; StringList m_tools; diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 86c3103..42739fb 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -229,7 +229,7 @@ private: //--- Resources - std::auto_ptr m_fbatoms; + std::unique_ptr m_fbatoms; FbTk::ResourceManager m_resourcemanager; FbTk::ResourceManager& m_screen_rm; @@ -260,7 +260,7 @@ private: } m_config; - std::auto_ptr m_key; + std::unique_ptr m_key; AtomHandlerContainer m_atomhandler; AttentionNoticeHandler m_attention_handler; diff --git a/src/tests/texturetest.cc b/src/tests/texturetest.cc index 3736493..86654bd 100644 --- a/src/tests/texturetest.cc +++ b/src/tests/texturetest.cc @@ -83,7 +83,7 @@ private: unsigned int next_y = 5; TestTheme tm(screenNumber()); - std::auto_ptr > text; + std::unique_ptr > text; char value[18]; for (int i=0; i