Commit d5e2ab1a authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fix int/long type mismatches.

parent f63a9b59
...@@ -474,11 +474,12 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO ...@@ -474,11 +474,12 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
size = call->virtual_protect.size; size = call->virtual_protect.size;
if ((ULONG_PTR)addr == call->virtual_protect.addr && size == call->virtual_protect.size) if ((ULONG_PTR)addr == call->virtual_protect.addr && size == call->virtual_protect.size)
{ {
ULONG prot;
result->virtual_protect.status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, result->virtual_protect.status = NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size,
call->virtual_protect.prot, call->virtual_protect.prot, &prot );
&result->virtual_protect.prot );
result->virtual_protect.addr = wine_server_client_ptr( addr ); result->virtual_protect.addr = wine_server_client_ptr( addr );
result->virtual_protect.size = size; result->virtual_protect.size = size;
result->virtual_protect.prot = prot;
} }
else result->virtual_protect.status = STATUS_INVALID_PARAMETER; else result->virtual_protect.status = STATUS_INVALID_PARAMETER;
break; break;
......
...@@ -113,7 +113,7 @@ struct async_recv_ioctl ...@@ -113,7 +113,7 @@ struct async_recv_ioctl
void *control; void *control;
struct WS_sockaddr *addr; struct WS_sockaddr *addr;
int *addr_len; int *addr_len;
DWORD *ret_flags; unsigned int *ret_flags;
int unix_flags; int unix_flags;
unsigned int count; unsigned int count;
BOOL icmp_over_dgram; BOOL icmp_over_dgram;
...@@ -907,7 +907,7 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi ...@@ -907,7 +907,7 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
static NTSTATUS sock_ioctl_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, static NTSTATUS sock_ioctl_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io,
int fd, const void *buffers_ptr, unsigned int count, WSABUF *control, int fd, const void *buffers_ptr, unsigned int count, WSABUF *control,
struct WS_sockaddr *addr, int *addr_len, DWORD *ret_flags, int unix_flags, int force_async ) struct WS_sockaddr *addr, int *addr_len, unsigned int *ret_flags, int unix_flags, int force_async )
{ {
struct async_recv_ioctl *async; struct async_recv_ioctl *async;
DWORD async_size; DWORD async_size;
......
...@@ -109,7 +109,7 @@ static inline ULONGLONG monotonic_counter(void) ...@@ -109,7 +109,7 @@ static inline ULONGLONG monotonic_counter(void)
static int futex_private = 128; static int futex_private = 128;
static inline int futex_wait( const int *addr, int val, struct timespec *timeout ) static inline int futex_wait( const LONG *addr, int val, struct timespec *timeout )
{ {
#if (defined(__i386__) || defined(__arm__)) && _TIME_BITS==64 #if (defined(__i386__) || defined(__arm__)) && _TIME_BITS==64
if (timeout && sizeof(*timeout) != 8) if (timeout && sizeof(*timeout) != 8)
...@@ -125,14 +125,14 @@ static inline int futex_wait( const int *addr, int val, struct timespec *timeout ...@@ -125,14 +125,14 @@ static inline int futex_wait( const int *addr, int val, struct timespec *timeout
return syscall( __NR_futex, addr, FUTEX_WAIT | futex_private, val, timeout, 0, 0 ); return syscall( __NR_futex, addr, FUTEX_WAIT | futex_private, val, timeout, 0, 0 );
} }
static inline int futex_wake( const int *addr, int val ) static inline int futex_wake( const LONG *addr, int val )
{ {
return syscall( __NR_futex, addr, FUTEX_WAKE | futex_private, val, NULL, 0, 0 ); return syscall( __NR_futex, addr, FUTEX_WAKE | futex_private, val, NULL, 0, 0 );
} }
static inline int use_futexes(void) static inline int use_futexes(void)
{ {
static int supported = -1; static LONG supported = -1;
if (supported == -1) if (supported == -1)
{ {
...@@ -2309,7 +2309,7 @@ union tid_alert_entry ...@@ -2309,7 +2309,7 @@ union tid_alert_entry
#else #else
HANDLE event; HANDLE event;
#ifdef __linux__ #ifdef __linux__
int futex; LONG futex;
#endif #endif
#endif #endif
}; };
...@@ -2395,7 +2395,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) ...@@ -2395,7 +2395,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid )
#ifdef __linux__ #ifdef __linux__
if (use_futexes()) if (use_futexes())
{ {
int *futex = &entry->futex; LONG *futex = &entry->futex;
if (!InterlockedExchange( futex, 1 )) if (!InterlockedExchange( futex, 1 ))
futex_wake( futex, 1 ); futex_wake( futex, 1 );
return STATUS_SUCCESS; return STATUS_SUCCESS;
...@@ -2496,7 +2496,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG ...@@ -2496,7 +2496,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
#ifdef __linux__ #ifdef __linux__
if (use_futexes()) if (use_futexes())
{ {
int *futex = &entry->futex; LONG *futex = &entry->futex;
ULONGLONG end; ULONGLONG end;
int ret; int ret;
......
...@@ -777,7 +777,7 @@ static BOOL logical_proc_info_add_group( DWORD num_cpus, ULONG_PTR mask ) ...@@ -777,7 +777,7 @@ static BOOL logical_proc_info_add_group( DWORD num_cpus, ULONG_PTR mask )
static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask) static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask)
{ {
FILE *f; FILE *f;
DWORD r; unsigned int r;
f = fopen(filename, "r"); f = fopen(filename, "r");
if (!f) return FALSE; if (!f) return FALSE;
...@@ -802,7 +802,7 @@ static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask) ...@@ -802,7 +802,7 @@ static BOOL sysfs_parse_bitmap(const char *filename, ULONG_PTR *mask)
* - /sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list * - /sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list
* - /sys/devices/system/cpu/cpu0/topology/thread_siblings_list. * - /sys/devices/system/cpu/cpu0/topology/thread_siblings_list.
*/ */
static BOOL sysfs_count_list_elements(const char *filename, DWORD *result) static BOOL sysfs_count_list_elements(const char *filename, unsigned int *result)
{ {
FILE *f; FILE *f;
...@@ -812,7 +812,7 @@ static BOOL sysfs_count_list_elements(const char *filename, DWORD *result) ...@@ -812,7 +812,7 @@ static BOOL sysfs_count_list_elements(const char *filename, DWORD *result)
while (!feof(f)) while (!feof(f))
{ {
char op; char op;
DWORD beg, end; unsigned int beg, end;
if (!fscanf(f, "%u%c ", &beg, &op)) break; if (!fscanf(f, "%u%c ", &beg, &op)) break;
if(op == '-') if(op == '-')
...@@ -834,7 +834,7 @@ static NTSTATUS create_logical_proc_info(void) ...@@ -834,7 +834,7 @@ static NTSTATUS create_logical_proc_info(void)
static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap"; static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap";
FILE *fcpu_list, *fnuma_list, *f; FILE *fcpu_list, *fnuma_list, *f;
DWORD beg, end, i, j, r, num_cpus = 0, max_cpus = 0; unsigned int beg, end, i, j, r, num_cpus = 0, max_cpus = 0;
char op, name[MAX_PATH]; char op, name[MAX_PATH];
ULONG_PTR all_cpus_mask = 0; ULONG_PTR all_cpus_mask = 0;
...@@ -863,7 +863,7 @@ static NTSTATUS create_logical_proc_info(void) ...@@ -863,7 +863,7 @@ static NTSTATUS create_logical_proc_info(void)
for(i = beg; i <= end; i++) for(i = beg; i <= end; i++)
{ {
DWORD phys_core = 0; unsigned int phys_core = 0;
ULONG_PTR thread_mask = 0; ULONG_PTR thread_mask = 0;
if (i > 8 * sizeof(ULONG_PTR)) if (i > 8 * sizeof(ULONG_PTR))
...@@ -3682,14 +3682,15 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input, ...@@ -3682,14 +3682,15 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input,
if ((out_size / sizeof(PROCESSOR_POWER_INFORMATION)) < out_cpus) return STATUS_BUFFER_TOO_SMALL; if ((out_size / sizeof(PROCESSOR_POWER_INFORMATION)) < out_cpus) return STATUS_BUFFER_TOO_SMALL;
#if defined(linux) #if defined(linux)
{ {
unsigned int val;
char filename[128]; char filename[128];
FILE* f; FILE* f;
for(i = 0; i < out_cpus; i++) { for(i = 0; i < out_cpus; i++) {
sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i); sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", i);
f = fopen(filename, "r"); f = fopen(filename, "r");
if (f && (fscanf(f, "%d", &cpu_power[i].MaxMhz) == 1)) { if (f && (fscanf(f, "%u", &val) == 1)) {
cpu_power[i].MaxMhz /= 1000; cpu_power[i].MaxMhz = val / 1000;
fclose(f); fclose(f);
cpu_power[i].CurrentMhz = cpu_power[i].MaxMhz; cpu_power[i].CurrentMhz = cpu_power[i].MaxMhz;
} }
...@@ -3707,8 +3708,8 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input, ...@@ -3707,8 +3708,8 @@ NTSTATUS WINAPI NtPowerInformation( POWER_INFORMATION_LEVEL level, void *input,
sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", i); sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", i);
f = fopen(filename, "r"); f = fopen(filename, "r");
if(f && (fscanf(f, "%d", &cpu_power[i].MhzLimit) == 1)) { if(f && (fscanf(f, "%u", &val) == 1)) {
cpu_power[i].MhzLimit /= 1000; cpu_power[i].MhzLimit = val / 1000;
fclose(f); fclose(f);
} }
else else
......
...@@ -79,7 +79,7 @@ WINE_DECLARE_DEBUG_CHANNEL(threadname); ...@@ -79,7 +79,7 @@ WINE_DECLARE_DEBUG_CHANNEL(threadname);
pthread_key_t teb_key = 0; pthread_key_t teb_key = 0;
static int nb_threads = 1; static LONG nb_threads = 1;
static inline int get_unix_exit_code( NTSTATUS status ) static inline int get_unix_exit_code( NTSTATUS status )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment