aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/LogicCommands.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-22 15:52:58 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-09-14 17:39:11 (GMT)
commitd21ceb4a235d8f8994390d7bc7611b990e6c0c31 (patch)
tree909bd768f8b9893e0a425d01ef63e10185bfd3ac /src/FbTk/LogicCommands.cc
parent1f34dee9b3ce82a2b9f3578ecb14ad3c59080c46 (diff)
downloadfluxbox_pavel-d21ceb4a235d8f8994390d7bc7611b990e6c0c31.zip
fluxbox_pavel-d21ceb4a235d8f8994390d7bc7611b990e6c0c31.tar.bz2
Remove the assignment operator from a regular pointer to a RefCount
it is too easy too shoot yourself in the foot with it, other smart pointers also don't allow such assignments. If you do want to assign to a RefCount pointer, use reset(). ps: assignment between two RefCounts remains possible, of course.
Diffstat (limited to 'src/FbTk/LogicCommands.cc')
-rw-r--r--src/FbTk/LogicCommands.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/LogicCommands.cc b/src/FbTk/LogicCommands.cc
index bda67f5..121823f 100644
--- a/src/FbTk/LogicCommands.cc
+++ b/src/FbTk/LogicCommands.cc
@@ -43,7 +43,7 @@ M *addCommands(M *macro, const string &args, bool trusted) {
43 43
44 std::vector<std::string>::iterator it = cmds.begin(), it_end = cmds.end(); 44 std::vector<std::string>::iterator it = cmds.begin(), it_end = cmds.end();
45 for (; it != it_end; ++it) { 45 for (; it != it_end; ++it) {
46 cmd = CommandParser<bool>::instance().parse(*it, trusted); 46 cmd.reset( CommandParser<bool>::instance().parse(*it, trusted) );
47 if (cmd) 47 if (cmd)
48 macro->add(cmd); 48 macro->add(cmd);
49 } 49 }
@@ -90,13 +90,13 @@ Command<void> *IfCommand::parse(const std::string &command, const std::string &a
90 if (cmds.size() < 2) 90 if (cmds.size() < 2)
91 return 0; 91 return 0;
92 92
93 cond = CommandParser<bool>::instance().parse(cmds[0], trusted); 93 cond.reset( CommandParser<bool>::instance().parse(cmds[0], trusted) );
94 if (cond == 0) 94 if (cond == 0)
95 return 0; 95 return 0;
96 96
97 t = CommandParser<void>::instance().parse(cmds[1], trusted); 97 t.reset( CommandParser<void>::instance().parse(cmds[1], trusted) );
98 if (cmds.size() >= 3) 98 if (cmds.size() >= 3)
99 f = CommandParser<void>::instance().parse(cmds[2], trusted); 99 f.reset( CommandParser<void>::instance().parse(cmds[2], trusted) );
100 if (t == 0 && f == 0) 100 if (t == 0 && f == 0)
101 return 0; 101 return 0;
102 102