commit 0d02a35cc1f0798e1be6861433a7e78602f0b90f
parent 7d5e6ca5a32586434e0ecaa2ce16dc1ce7419b91
Author: Jakub Kicinski <kubakici@wp.pl>
Date: Fri, 12 Dec 2014 10:00:51 +0100
Use memset to initialize struct etpan_thread_op
also remove duplicated zeroing.
Diffstat:
3 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/src/etpan/etpan-thread-manager.c b/src/etpan/etpan-thread-manager.c
@@ -187,19 +187,8 @@ struct etpan_thread_op * etpan_thread_op_new(void)
op = malloc(sizeof(* op));
if (op == NULL)
goto err;
-
- op->thread = NULL;
- op->run = NULL;
- op->callback = NULL;
- op->callback_data = NULL;
- op->callback_called = 0;
- op->cancellable = 0;
- op->cancelled = 0;
- op->param = NULL;
- op->result = NULL;
- op->finished = 0;
- op->imap = NULL;
- op->nntp = NULL;
+
+ memset(op, 0, sizeof(* op));
r = pthread_mutex_init(&op->lock, NULL);
if (r != 0)
diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c
@@ -416,14 +416,10 @@ static int threaded_run(Folder * folder, void * param, void * result,
op->param = param;
op->result = result;
- op->cancellable = 0;
op->run = func;
op->callback = generic_cb;
op->callback_data = op;
- op->cleanup = NULL;
-
- op->finished = 0;
-
+
thread = get_thread(folder);
etpan_thread_op_schedule(thread, op);
diff --git a/src/etpan/nntp-thread.c b/src/etpan/nntp-thread.c
@@ -277,14 +277,10 @@ static void threaded_run(Folder * folder, void * param, void * result,
op->nntp = get_nntp(folder);
op->param = param;
op->result = result;
-
- op->cancellable = 0;
+
op->run = func;
op->callback = generic_cb;
op->callback_data = op;
- op->cleanup = NULL;
-
- op->finished = 0;
previous_stream_logger = mailstream_logger;
mailstream_logger = nntp_logger;