Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/atomic Fix return value (typo, noticed by Ni...



details:   https://anonhg.NetBSD.org/src/rev/ff612a7ba419
branches:  trunk
changeset: 327439:ff612a7ba419
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 07 08:42:58 2014 +0000

description:
Fix return value (typo, noticed by Nick Hudson)

diffstat:

 common/lib/libc/atomic/atomic_cas_by_cas32.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r 18e9a5083a4e -r ff612a7ba419 common/lib/libc/atomic/atomic_cas_by_cas32.c
--- a/common/lib/libc/atomic/atomic_cas_by_cas32.c      Fri Mar 07 08:40:59 2014 +0000
+++ b/common/lib/libc/atomic/atomic_cas_by_cas32.c      Fri Mar 07 08:42:58 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic_cas_by_cas32.c,v 1.1 2014/02/24 16:15:43 martin Exp $   */
+/*     $NetBSD: atomic_cas_by_cas32.c,v 1.2 2014/03/07 08:42:58 martin Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
                new32 = (old32 & ~mask) | (uint32_t)new << shift;
                old32 = (old32 & ~mask) | (uint32_t)old << shift;
        } while (_atomic_cas_32(ptr, old32, new32) != old32);
-       return (old >> shift) & mask;
+       return (old & mask) >> shift;
 }
 
 uint8_t
@@ -73,5 +73,5 @@
                new32 = (old32 & ~mask) | (uint32_t)new << shift;
                old32 = (old32 & ~mask) | (uint32_t)old << shift;
        } while (_atomic_cas_32(ptr, old32, new32) != old32);
-       return (old >> shift) & mask;
+       return (old & mask) >> shift;
 }



Home | Main Index | Thread Index | Old Index