Use memset to initialize struct etpan_thread_op
authorJakub Kicinski <kubakici@wp.pl>
Fri, 12 Dec 2014 09:00:51 +0000 (10:00 +0100)
committerJakub Kicinski <kubakici@wp.pl>
Fri, 12 Dec 2014 09:35:02 +0000 (10:35 +0100)
also remove duplicated zeroing.

src/etpan/etpan-thread-manager.c
src/etpan/imap-thread.c
src/etpan/nntp-thread.c

index f72e8c7..f73dbfe 100644 (file)
@@ -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)
index 4998e33..5f79cdb 100644 (file)
@@ -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);
        
index ac5d210..c208028 100644 (file)
@@ -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;