Michael Stefaniuc : server: Fix some comparisons between signed and unsigned.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 26 04:22:52 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: a624977f21a1a1668326882f84a47d3a7f5cb58d
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=a624977f21a1a1668326882f84a47d3a7f5cb58d

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Jul 25 10:30:04 2006 +0200

server: Fix some comparisons between signed and unsigned.

---

 server/console.c  |    2 +-
 server/ptrace.c   |    2 +-
 server/queue.c    |    2 +-
 server/registry.c |    4 ++--
 server/token.c    |   10 ++++------
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/server/console.c b/server/console.c
index 5e65704..f57e4fe 100644
--- a/server/console.c
+++ b/server/console.c
@@ -1021,7 +1021,7 @@ static int write_console_output( struct 
                                  const void* data, enum char_info_mode mode,
                                  int x, int y, int wrap )
 {
-    int i;
+    unsigned int i;
     char_info_t *end, *dest = screen_buffer->data + y * screen_buffer->width + x;
 
     if (y >= screen_buffer->height) return 0;
diff --git a/server/ptrace.c b/server/ptrace.c
index c84451b..4de242f 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -288,7 +288,7 @@ static int read_thread_int( struct threa
 static int write_thread_int( struct thread *thread, int *addr, int data, unsigned int mask )
 {
     int res;
-    if (mask != ~0)
+    if (mask != ~0u)
     {
         if (read_thread_int( thread, addr, &res ) == -1) return -1;
         data = (data & mask) | (res & ~mask);
diff --git a/server/queue.c b/server/queue.c
index 965ede0..a292c80 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1298,7 +1298,7 @@ static int check_hw_message_filter( user
 
 
 /* find a hardware message for the given queue */
-static int get_hardware_message( struct thread *thread, int hw_id, user_handle_t filter_win,
+static int get_hardware_message( struct thread *thread, unsigned int hw_id, user_handle_t filter_win,
                                  unsigned int first, unsigned int last, struct get_message_reply *reply )
 {
     struct thread_input *input = thread->queue->input;
diff --git a/server/registry.c b/server/registry.c
index f56051c..9251188 100644
--- a/server/registry.c
+++ b/server/registry.c
@@ -669,8 +669,8 @@ static void enum_key( const struct key *
 {
     int i;
     data_size_t len, namelen, classlen;
-    int max_subkey = 0, max_class = 0;
-    int max_value = 0, max_data = 0;
+    data_size_t max_subkey = 0, max_class = 0;
+    data_size_t max_value = 0, max_data = 0;
     char *data;
 
     if (index != -1)  /* -1 means use the specified key directly */
diff --git a/server/token.c b/server/token.c
index 1d08eeb..ce08e95 100644
--- a/server/token.c
+++ b/server/token.c
@@ -419,7 +419,7 @@ static struct token *create_token( unsig
     struct token *token = alloc_object( &token_ops );
     if (token)
     {
-        int i;
+        unsigned int i;
 
         list_init( &token->privileges );
         list_init( &token->groups );
@@ -623,8 +623,7 @@ static unsigned int token_adjust_privile
                                              unsigned int count, LUID_AND_ATTRIBUTES *mod_privs,
                                              unsigned int mod_privs_count )
 {
-    int i;
-    unsigned int modified_count = 0;
+    unsigned int i, modified_count = 0;
 
     for (i = 0; i < count; i++)
     {
@@ -669,8 +668,7 @@ int token_check_privileges( struct token
                             const LUID_AND_ATTRIBUTES *reqprivs,
                             unsigned int count, LUID_AND_ATTRIBUTES *usedprivs)
 {
-    int i;
-    unsigned int enabled_count = 0;
+    unsigned int i, enabled_count = 0;
 
     for (i = 0; i < count; i++)
     {
@@ -944,7 +942,7 @@ DECL_HANDLER(adjust_token_privileges)
 
         if (req->get_modified_state && !req->disable_all)
         {
-            int i;
+            unsigned int i;
             /* count modified privs */
             for (i = 0; i < priv_count; i++)
             {




More information about the wine-cvs mailing list