[haiku-commits] Re: haiku: hrev52709 - src/libs/compat/freebsd_iflib

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 4 Jan 2019 12:12:13 -0500

On Fri, Jan 4, 2019, 9:37 AM Axel Dörfler <axeld@xxxxxxxxxxxxxxxx wrote:

Am 04/01/2019 um 05:45 schrieb waddlesplash:
189ed5d80619: freebsd_iflib: Get the thread_id from the thread*
indirectly.
   This is needed on 64-bit.
[...]
-     set_thread_priority((thread_id)td, prio);
+     uintptr_t tdi = (uintptr_t)td;
+     set_thread_priority((thread_id)tdi, prio);

What's the exact difference? The outcome should be the same, no?


The outcome is indeed the same, but GCC treats a cast from a pointer to an
integer of smaller size as an error. So we have to cast first to an integer
of the same size and then to one of smaller size.

-waddlesplash

Other related posts: