Converted the server to -DSTRICT.
diff --git a/server/user.c b/server/user.c
index b4f3e0e..6f99ac4 100644
--- a/server/user.c
+++ b/server/user.c
@@ -35,17 +35,18 @@
static struct user_handle *handle_to_entry( user_handle_t handle )
{
- int index = (handle & 0xffff) - FIRST_USER_HANDLE;
+ int index = ((unsigned int)handle & 0xffff) - FIRST_USER_HANDLE;
if (index < 0 || index >= nb_handles) return NULL;
if (!handles[index].type) return NULL;
- if ((handle >> 16) && (handle >> 16 != handles[index].generation)) return NULL;
+ if (((unsigned int)handle >> 16) && ((unsigned int)handle >> 16 != handles[index].generation))
+ return NULL;
return &handles[index];
}
inline static user_handle_t entry_to_handle( struct user_handle *ptr )
{
int index = ptr - handles;
- return (index + FIRST_USER_HANDLE) + (ptr->generation << 16);
+ return (user_handle_t)((index + FIRST_USER_HANDLE) + (ptr->generation << 16));
}
inline static struct user_handle *alloc_user_entry(void)
@@ -110,7 +111,7 @@
{
struct user_handle *entry;
- if (handle >> 16) return handle;
+ if ((unsigned int)handle >> 16) return handle;
if (!(entry = handle_to_entry( handle ))) return handle;
return entry_to_handle( entry );
}
@@ -146,7 +147,7 @@
if (!*handle) entry = handles;
else
{
- int index = (*handle & 0xffff) - FIRST_USER_HANDLE;
+ int index = ((unsigned int)*handle & 0xffff) - FIRST_USER_HANDLE;
if (index < 0 || index >= nb_handles) return NULL;
entry = handles + index + 1; /* start from the next one */
}