After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 322351 - Wrong usage of InterlockedCompareExchange?
Wrong usage of InterlockedCompareExchange?
Status: RESOLVED DUPLICATE of bug 155884
Product: glib
Classification: Platform
Component: win32
2.8.x
Other Windows
: Normal major
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-24 17:36 UTC by Friedrich
Modified: 2006-04-19 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Friedrich 2005-11-24 17:36:47 UTC
The prototy according to MSDN is:
LONG InterlockedCompareExchange(
  LONG volatile* Destination,
  LONG Exchange,
  LONG Comperand
);


But is is used in 
g_atomic_int_compare_and_exchange
with a cast to PVOID in second place and third place. 

The other use in 
g_atomic_pointer_compare_and_exchange
is wrong also IMHO it is called:
gpointer  oldval,
gpointer  newval)

as second and third parameter 

I'd argue this is not correct.

Regards
Friedrich
Comment 1 Hans Breuer 2005-11-24 22:11:26 UTC
More fun with InterlockedCompareExchange in bug #155884 
Comment 2 Tor Lillqvist 2006-04-19 10:01:21 UTC
Yes, this is a duplicate surely.

*** This bug has been marked as a duplicate of 155884 ***