summaryrefslogtreecommitdiff
path: root/src/task_proto.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_proto.cc')
-rw-r--r--src/task_proto.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/task_proto.cc b/src/task_proto.cc
index 39232dd..10cfe35 100644
--- a/src/task_proto.cc
+++ b/src/task_proto.cc
@@ -98,7 +98,7 @@ int callback_lws_task(struct libwebsocket_context * context,
std::string init_str;
TaskList::iterator it;
for(it = tasklist.begin(); it != tasklist.end(); it++) {
- task_t t = *it;
+ task_t &t = *it;
sprintf(buf, "add %d %s %s %d %d;",
t.id, t.title.c_str(), t.desc.c_str(), t.x, t.y);
@@ -180,8 +180,8 @@ int callback_lws_task(struct libwebsocket_context * context,
case cmd::add: {
printf("Handling add cmd:\n");
- task_t t =create_task(m.add.title, m.add.desc,
- m.add.x, m.add.y);
+ task_t t = create_task(m.add.title, m.add.desc,
+ m.add.x, m.add.y);
tasklist.push_back(t);
buf_len = sprintf(buf, "add %d %s %s %d %d;",
t.id, t.title.c_str(), t.desc.c_str(),
@@ -197,7 +197,7 @@ int callback_lws_task(struct libwebsocket_context * context,
bool id_found = false;
TaskList::iterator it;
for(it = tasklist.begin(); it != tasklist.end(); it++) {
- task_t t = *it;
+ task_t &t = *it;
if(t.id == m.del.id) {
id_found = true;
tasklist.erase(it);
@@ -224,7 +224,7 @@ int callback_lws_task(struct libwebsocket_context * context,
int x = m.move.x / 300 * 300;
for(it = tasklist.begin(); it != tasklist.end(); it++) {
- task_t t = *it;
+ task_t &t = *it;
if(t.id == m.move.id) {
id_found = true;
t.x = x;