From: Mathieu Desnoyers Date: Mon, 26 Mar 2012 15:27:01 +0000 (-0400) Subject: Fix uatomic sign cast X-Git-Tag: v0.6.9~3 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=ecf2edf639926ad2a7842ebe1e6c456cc106e4c0;hp=ecf2edf639926ad2a7842ebe1e6c456cc106e4c0;p=userspace-rcu.git Fix uatomic sign cast Passing an unsigned int to uatomic_sub does not honor sign extend to long, as we should be allowed by assume. Fix this by introducing caa_cast_long_keep_sign(), which casts either to long or unsigned long depending on the signedness of the argument received. It is used in uatomic_sub before applying the "-" operator, since this operator needs to operate on the "long" type size (since sign extension might not be performed if the argument received is unsigned). Signed-off-by: Mathieu Desnoyers ---