sunos: fix argument/prototype mismatch in atomics

The `atomic_cas_uint` and `atomic_cas_ulong` functions expect `uint_t`
and `ulong_t` parameters, respectively, so cast the `int`/`long` inputs
to avoid loud compiler warnings.

PR-URL: https://github.com/libuv/libuv/pull/2200
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Andrew Paprocki 2019-02-21 10:38:49 -05:00 committed by cjihrig
parent 53c15c09e4
commit c75893fd13
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -49,7 +49,7 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
else
return op4;
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
return atomic_cas_uint(ptr, oldval, newval);
return atomic_cas_uint((uint_t *)ptr, (uint_t)oldval, (uint_t)newval);
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif
@ -85,7 +85,7 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
else
return op4;
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
return atomic_cas_ulong(ptr, oldval, newval);
return atomic_cas_ulong((ulong_t *)ptr, (ulong_t)oldval, (ulong_t)newval);
#else
return __sync_val_compare_and_swap(ptr, oldval, newval);
#endif