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.
This commit is contained in:
Mathias Gumz 2016-08-27 10:05:34 +02:00
parent 1e235e3f01
commit bb013f5c75
26 changed files with 45 additions and 51 deletions

View file

@ -127,7 +127,7 @@ private:
const int m_option;
const ClientPattern m_pat;
std::list<FluxboxWindow *> m_list;
std::auto_ptr<ClientMenu> m_menu;
std::unique_ptr<ClientMenu> m_menu;
};
class ShowCustomMenuCmd: public FbTk::Command<void> {
@ -137,7 +137,7 @@ public:
void reload();
private:
std::string custom_menu_file;
std::auto_ptr<FbMenu> m_menu;
std::unique_ptr<FbMenu> m_menu;
};
class ShowRootMenuCmd: public FbTk::Command<void> {

View file

@ -56,7 +56,7 @@ public:
private:
FbTk::LayerItem m_layeritem;
std::auto_ptr<FbTk::AutoReloadHelper> m_reloader;
std::unique_ptr<FbTk::AutoReloadHelper> m_reloader;
};
#endif // FBMENU_HH

View file

@ -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<FbTk::Transparent> m_transparent;
std::unique_ptr<FbTk::Transparent> m_transparent;
bool m_lastbg_color_set;
unsigned long m_lastbg_color;
Pixmap m_lastbg_pm;

View file

@ -60,7 +60,7 @@ const struct t_modlist modlist[] = {
namespace FbTk {
std::auto_ptr<KeyUtil> KeyUtil::s_keyutil;
std::unique_ptr<KeyUtil> KeyUtil::s_keyutil;
KeyUtil &KeyUtil::instance() {
if (s_keyutil.get() == 0)

View file

@ -93,7 +93,7 @@ private:
XModifierKeymap *m_modmap;
int m_numlock, m_scrolllock;
static std::auto_ptr<KeyUtil> s_keyutil;
static std::unique_ptr<KeyUtil> s_keyutil;
};
} // end namespace FbTk

View file

@ -95,7 +95,6 @@ Menu::Menu(FbTk::ThemeProxy<MenuTheme> &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();

View file

@ -189,7 +189,7 @@ private:
Menu *m_parent;
std::vector<MenuItem*> m_items;
std::auto_ptr<MenuSearch> m_search;
std::unique_ptr<MenuSearch> m_search;
struct State {
bool moving;
@ -239,7 +239,7 @@ private:
FbTk::ThemeProxy<MenuTheme>& m_theme;
ImageControl& m_image_ctrl;
std::auto_ptr<FbTk::Shape> m_shape; // the corners
std::unique_ptr<FbTk::Shape> m_shape; // the corners
Pixmap m_hilite_pixmap;
Alignment m_alignment;

View file

@ -155,10 +155,10 @@ private:
bool m_close_on_click, m_toggle_item;
struct Icon {
std::auto_ptr<PixmapWithMask> pixmap;
std::unique_ptr<PixmapWithMask> pixmap;
std::string filename;
};
std::auto_ptr<Icon> m_icon;
std::unique_ptr<Icon> m_icon;
};
} // end namespace FbTk

View file

@ -205,7 +205,7 @@ void ThemeItem<Texture>::load(const string *o_name, const string *o_altname) {
return;
}
std::auto_ptr<PixmapWithMask> pm(Image::load(pixmap_name, m_tm.screenNum()));
std::unique_ptr<PixmapWithMask> 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<PixmapWithMask> pm(Image::load(filename, m_tm.screenNum()));
std::unique_ptr<PixmapWithMask> pm(Image::load(filename, m_tm.screenNum()));
if (pm.get() == 0)
setDefaultValue();
else {

View file

@ -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;

View file

@ -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<ClientPattern> m_pat;
std::unique_ptr<ClientPattern> m_pat;
const FocusableList *m_parent;
BScreen &m_screen;
std::list<Focusable *> m_list;

View file

@ -65,7 +65,7 @@ protected:
private:
void themeReconfigured();
std::auto_ptr<FbTk::FbWindow> m_window;
std::unique_ptr<FbTk::FbWindow> m_window;
FbTk::ThemeProxy<ToolTheme> &m_theme;
FbTk::SignalTracker m_tracker;
};

View file

@ -40,7 +40,7 @@ public:
}
private:
std::auto_ptr<Strut> m_available_workspace_area;
std::unique_ptr<Strut> m_available_workspace_area;
std::list<Strut*> m_strutlist;
};

View file

@ -108,7 +108,7 @@ private:
FbTk::SignalTracker m_tracker;
std::auto_ptr<FocusableList> m_winlist;
std::unique_ptr<FocusableList> m_winlist;
IconMap m_icons;
std::string m_mode;
FbTk::Resource<std::string> m_rc_mode;

View file

@ -155,7 +155,7 @@ public:
private:
std::auto_ptr<Patterns> m_pats;
std::unique_ptr<Patterns> m_pats;
Clients m_clients;
Startups m_startups;

View file

@ -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<FbTk::Command<void> > cmd(0);
static std::unique_ptr<FbTk::Command<void> > cmd;
cmd.reset(FbTk::CommandParser<void>::instance().parse(str, false));
if (cmd.get()) {
cmd->execute();

View file

@ -492,31 +492,31 @@ private:
bool root_colormap_installed;
std::auto_ptr<FbTk::ImageControl> m_image_control;
std::auto_ptr<FbMenu> m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu;
std::unique_ptr<FbTk::ImageControl> m_image_control;
std::unique_ptr<FbMenu> m_configmenu, m_rootmenu, m_workspacemenu, m_windowmenu;
Icons m_icon_list;
std::auto_ptr<Slit> m_slit;
std::auto_ptr<Toolbar> m_toolbar;
std::auto_ptr<ToolButtonMap> m_toolButtonMap;
std::unique_ptr<Slit> m_slit;
std::unique_ptr<Toolbar> m_toolbar;
std::unique_ptr<ToolButtonMap> m_toolButtonMap;
Workspace *m_current_workspace;
WorkspaceNames m_workspace_names;
Workspaces m_workspaces_list;
std::auto_ptr<FbWinFrameTheme> m_focused_windowtheme,
std::unique_ptr<FbWinFrameTheme> m_focused_windowtheme,
m_unfocused_windowtheme;
std::auto_ptr<WinButtonTheme> m_focused_winbutton_theme,
std::unique_ptr<WinButtonTheme> m_focused_winbutton_theme,
m_unfocused_winbutton_theme, m_pressed_winbutton_theme;
std::auto_ptr<FbTk::MenuTheme> m_menutheme;
std::auto_ptr<RootTheme> m_root_theme;
std::unique_ptr<FbTk::MenuTheme> m_menutheme;
std::unique_ptr<RootTheme> m_root_theme;
FbRootWindow m_root_window;
std::auto_ptr<OSDWindow> m_geom_window;
std::auto_ptr<OSDWindow> m_pos_window;
std::auto_ptr<TooltipWindow> m_tooltip_window;
std::unique_ptr<OSDWindow> m_geom_window;
std::unique_ptr<OSDWindow> m_pos_window;
std::unique_ptr<TooltipWindow> m_tooltip_window;
FbTk::FbWindow m_dummy_window;
ScreenResource resource;

View file

@ -53,7 +53,6 @@ ScreenPlacement::ScreenPlacement(BScreen &screen):
screen.name()+".windowPlacement",
screen.altName()+".WindowPlacement"),
m_old_policy(ROWSMARTPLACEMENT),
m_strategy(0),
m_screen(screen)
{
}

View file

@ -80,8 +80,8 @@ private:
FbTk::Resource<ColumnDirection> m_col_direction; ///< column direction resource
FbTk::Resource<PlacementPolicy> m_placement_policy; ///< placement policy resource
PlacementPolicy m_old_policy; ///< holds old policy, used to determine if resources has changed
std::auto_ptr<PlacementStrategy> m_strategy; ///< main strategy
std::auto_ptr<PlacementStrategy> m_fallback_strategy; ///< a fallback strategy if the main strategy fails
std::unique_ptr<PlacementStrategy> m_strategy; ///< main strategy
std::unique_ptr<PlacementStrategy> m_fallback_strategy; ///< a fallback strategy if the main strategy fails
BScreen& m_screen;
};

View file

@ -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

View file

@ -152,7 +152,7 @@ private:
FbTk::Timer m_timer;
SlitClients m_client_list;
std::auto_ptr<LayerMenu> m_layermenu;
std::unique_ptr<LayerMenu> m_layermenu;
FbMenu m_clientlist_menu, m_slitmenu;
#ifdef XINERAMA
XineramaHeadMenu<Slit> *m_xineramaheadmenu;
@ -178,8 +178,8 @@ private:
// for KDE
Atom m_kwm1_dockwindow, m_kwm2_dockwindow;
std::auto_ptr<FbTk::LayerItem> m_layeritem;
std::auto_ptr<SlitTheme> m_slit_theme;
std::unique_ptr<FbTk::LayerItem> m_layeritem;
std::unique_ptr<SlitTheme> m_slit_theme;
static unsigned int s_eventmask;
Strut *m_strut;

View file

@ -106,7 +106,7 @@ private:
BScreen& m_screen;
Pixmap m_pixmap;
std::auto_ptr<AtomHandler> m_handler;
std::unique_ptr<AtomHandler> m_handler;
ClientList m_clients;
size_t m_num_visible_clients;

View file

@ -52,9 +52,9 @@ public:
private:
BScreen &m_screen;
ToolTheme m_clock_theme;
std::auto_ptr<ToolTheme> m_button_theme;
std::auto_ptr<ToolTheme> m_workspace_theme;
std::auto_ptr<ToolTheme> m_systray_theme;
std::unique_ptr<ToolTheme> m_button_theme;
std::unique_ptr<ToolTheme> m_workspace_theme;
std::unique_ptr<ToolTheme> m_systray_theme;
IconbarTheme m_iconbar_theme, m_focused_iconbar_theme,
m_unfocused_iconbar_theme;
};

View file

@ -197,7 +197,7 @@ private:
FbTk::Resource<Placement> m_rc_placement;
FbTk::Resource<int> m_rc_height;
FbTk::Resource<std::string> m_rc_tools;
std::auto_ptr<FbTk::Shape> m_shape;
std::unique_ptr<FbTk::Shape> m_shape;
typedef std::list<std::string> StringList;
StringList m_tools;

View file

@ -229,7 +229,7 @@ private:
//--- Resources
std::auto_ptr<FbAtoms> m_fbatoms;
std::unique_ptr<FbAtoms> m_fbatoms;
FbTk::ResourceManager m_resourcemanager;
FbTk::ResourceManager& m_screen_rm;
@ -260,7 +260,7 @@ private:
} m_config;
std::auto_ptr<Keys> m_key;
std::unique_ptr<Keys> m_key;
AtomHandlerContainer m_atomhandler;
AttentionNoticeHandler m_attention_handler;

View file

@ -83,7 +83,7 @@ private:
unsigned int next_y = 5;
TestTheme tm(screenNumber());
std::auto_ptr<ThemeItem<Texture> > text;
std::unique_ptr<ThemeItem<Texture> > text;
char value[18];
for (int i=0; i<m_num; ++i) {
sprintf(value, "%d", i);