Marcus Meissner : server: Use longer int in bitshift operation (Coverity).

Alexandre Julliard julliard at winehq.org
Thu Apr 17 13:43:23 CDT 2014


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Thu Apr 17 07:38:18 2014 +0200

server: Use longer int in bitshift operation (Coverity).

---

 server/thread.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/thread.c b/server/thread.c
index 896ce0f..b310e93 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -450,10 +450,10 @@ affinity_t get_thread_affinity( struct thread *thread )
 
         if (!sched_getaffinity( thread->unix_tid, sizeof(set), &set ))
             for (i = 0; i < 8 * sizeof(mask); i++)
-                if (CPU_ISSET( i, &set )) mask |= 1 << i;
+                if (CPU_ISSET( i, &set )) mask |= (affinity_t)1 << i;
     }
 #endif
-    if (!mask) mask = ~0;
+    if (!mask) mask = ~(affinity_t)0;
     return mask;
 }
 




More information about the wine-cvs mailing list