Jacek Caban : server: Remove no longer needed NULL checks.

Alexandre Julliard julliard at winehq.org
Wed Jul 5 15:41:01 CDT 2017


Module: wine
Branch: master
Commit: 99dfb290481783768ba7d7277905185c3c36d101
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=99dfb290481783768ba7d7277905185c3c36d101

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jul  4 15:26:26 2017 +0200

server: Remove no longer needed NULL checks.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/async.c | 11 +----------
 server/file.h  |  7 ++++++-
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/server/async.c b/server/async.c
index 2bf00b6..0205807 100644
--- a/server/async.c
+++ b/server/async.c
@@ -381,19 +381,12 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
     }
 }
 
-/* check if there are any queued async operations */
-int async_queued( struct async_queue *queue )
-{
-    return queue && list_head( &queue->queue );
-}
-
 /* check if an async operation is waiting to be alerted */
 int async_waiting( struct async_queue *queue )
 {
     struct list *ptr;
     struct async *async;
 
-    if (!queue) return 0;
     if (!(ptr = list_head( &queue->queue ))) return 0;
     async = LIST_ENTRY( ptr, struct async, queue_entry );
     return async->status == STATUS_PENDING;
@@ -430,8 +423,6 @@ void async_wake_up( struct async_queue *queue, unsigned int status )
 {
     struct list *ptr, *next;
 
-    if (!queue) return;
-
     LIST_FOR_EACH_SAFE( ptr, next, &queue->queue )
     {
         struct async *async = LIST_ENTRY( ptr, struct async, queue_entry );
@@ -516,7 +507,7 @@ int async_is_blocking( struct async *async )
 struct async *find_pending_async( struct async_queue *queue )
 {
     struct async *async;
-    if (queue) LIST_FOR_EACH_ENTRY( async, &queue->queue, struct async, queue_entry )
+    LIST_FOR_EACH_ENTRY( async, &queue->queue, struct async, queue_entry )
         if (async->status == STATUS_PENDING) return (struct async *)grab_object( async );
     return NULL;
 }
diff --git a/server/file.h b/server/file.h
index 506ef17..0633b87 100644
--- a/server/file.h
+++ b/server/file.h
@@ -185,7 +185,6 @@ extern obj_handle_t async_handoff( struct async *async, int success, data_size_t
 extern void queue_async( struct async_queue *queue, struct async *async );
 extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status );
 extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total );
-extern int async_queued( struct async_queue *queue );
 extern int async_waiting( struct async_queue *queue );
 extern void async_terminate( struct async *async, unsigned int status );
 extern void async_wake_up( struct async_queue *queue, unsigned int status );
@@ -202,6 +201,12 @@ static inline void init_async_queue( struct async_queue *queue )
     list_init( &queue->queue );
 }
 
+static inline int async_queued( struct async_queue *queue )
+{
+    return !list_empty( &queue->queue );
+}
+
+
 /* access rights that require Unix read permission */
 #define FILE_UNIX_READ_ACCESS (FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA)
 




More information about the wine-cvs mailing list