Commit 01bd4786 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add some casts to fix warnings

parent 68b9d28c
...@@ -291,10 +291,10 @@ INLINE_HEADER TaskId serialiseTaskId (OSThreadId taskID) { ...@@ -291,10 +291,10 @@ INLINE_HEADER TaskId serialiseTaskId (OSThreadId taskID) {
#if defined(freebsd_HOST_OS) || defined(darwin_HOST_OS) #if defined(freebsd_HOST_OS) || defined(darwin_HOST_OS)
// Here OSThreadId is a pthread_t and pthread_t is a pointer, but within // Here OSThreadId is a pthread_t and pthread_t is a pointer, but within
// the process we can still use that pointer value as a unique id. // the process we can still use that pointer value as a unique id.
return (TaskId) taskID return (TaskId) (size_t) taskID
#else #else
// On Windows, Linux and others it's an integral type to start with. // On Windows, Linux and others it's an integral type to start with.
return taskID; return (TaskId) taskID;
#endif #endif
} }
#endif #endif
...@@ -303,7 +303,11 @@ INLINE_HEADER TaskId serialiseTaskId (OSThreadId taskID) { ...@@ -303,7 +303,11 @@ INLINE_HEADER TaskId serialiseTaskId (OSThreadId taskID) {
// Get a serialisable Id for the Task's OS thread // Get a serialisable Id for the Task's OS thread
// Needed mainly for logging since the OSThreadId is an opaque type // Needed mainly for logging since the OSThreadId is an opaque type
INLINE_HEADER TaskId INLINE_HEADER TaskId
serialisableTaskId (Task *task STG_UNUSED) serialisableTaskId (Task *task
#if !defined(THREADED_RTS)
STG_UNUSED
#endif
)
{ {
#if defined(THREADED_RTS) #if defined(THREADED_RTS)
return serialiseTaskId(task->id); return serialiseTaskId(task->id);
......
...@@ -324,7 +324,7 @@ KernelThreadId kernelThreadId (void) ...@@ -324,7 +324,7 @@ KernelThreadId kernelThreadId (void)
{ {
#if defined(linux_HOST_OS) #if defined(linux_HOST_OS)
pid_t tid = syscall(SYS_gettid); // no really, see man gettid pid_t tid = syscall(SYS_gettid); // no really, see man gettid
return tid; return (KernelThreadId) tid;
#elif defined(freebsd_HOST_OS) #elif defined(freebsd_HOST_OS)
return pthread_getthreadid_np(); return pthread_getthreadid_np();
......
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