[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 17/87: include: use unsigned literal in combination with binary n
From: |
Samuel Thibault |
Subject: |
[hurd] 17/87: include: use unsigned literal in combination with binary not |
Date: |
Sun, 09 Nov 2014 11:05:00 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 027bc17eca80bd379663e645aa9a7c59573bf0de
Author: Justus Winter <address@hidden>
Date: Fri Jun 6 10:20:47 2014 +0200
include: use unsigned literal in combination with binary not
* include/refcount.h (refcounts_promote): Use ~0U.
(refcounts_demote): Likewise.
---
include/refcount.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/refcount.h b/include/refcount.h
index 5c3302d..785b052 100644
--- a/include/refcount.h
+++ b/include/refcount.h
@@ -160,7 +160,7 @@ refcounts_promote (refcounts_t *ref, struct references
*result)
So we just add a hard reference. In combination, this is the
desired operation. */
const union _references op =
- { .references = { .weak = ~0, .hard = 1} };
+ { .references = { .weak = ~0U, .hard = 1} };
union _references r;
r.value = __atomic_add_fetch (&ref->value, op.value, __ATOMIC_RELAXED);
assert (r.references.hard != UINT32_MAX || !"refcount overflowed!");
@@ -188,7 +188,7 @@ refcounts_demote (refcounts_t *ref, struct references
*result)
significant bits. When we add ~0 to the hard references, it will
overflow into the weak references. This is the desired
operation. */
- const union _references op = { .references = { .hard = ~0 } };
+ const union _references op = { .references = { .hard = ~0U } };
union _references r;
r.value = __atomic_add_fetch (&ref->value, op.value, __ATOMIC_RELAXED);
assert (r.references.hard != UINT32_MAX || !"refcount underflowed!");
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 50/87: sutils: add urandom device target to MAKEDEV, (continued)
- [hurd] 50/87: sutils: add urandom device target to MAKEDEV, Samuel Thibault, 2014/11/09
- [hurd] 45/87: Revert "libpipe: fix calls to pipe_send with no data", Samuel Thibault, 2014/11/09
- [hurd] 57/87: include: detect use-after-free errors using the reference counts, Samuel Thibault, 2014/11/09
- [hurd] 73/87: libdiskfs: remove code counting cache misses, Samuel Thibault, 2014/11/09
- [hurd] 82/87: Fix dead name notification in static binaries, Samuel Thibault, 2014/11/09
- [hurd] 68/87: procfs: implement /proc/filesystems, Samuel Thibault, 2014/11/09
- [hurd] 71/87: procfs: reorganize rootdir.c, Samuel Thibault, 2014/11/09
- [hurd] 78/87: Fix proc_getprocinfo calls, Samuel Thibault, 2014/11/09
- [hurd] 80/87: Fix actual procinfo_t type, Samuel Thibault, 2014/11/09
- [hurd] 83/87: Use a mere weak attribute instead of a weak alias, Samuel Thibault, 2014/11/09
- [hurd] 17/87: include: use unsigned literal in combination with binary not,
Samuel Thibault <=
- [hurd] 79/87: Fix proc_getprocinfo calls, Samuel Thibault, 2014/11/09
- [hurd] 20/87: libdiskfs: avoid implicit integer conversion, Samuel Thibault, 2014/11/09
- [hurd] 67/87: procfs: implement /proc/N/maps, Samuel Thibault, 2014/11/09
- [hurd] 69/87: procfs: do not test whether /hurd/mtab exists, Samuel Thibault, 2014/11/09
- [hurd] 16/87: libnetfs: fix memory leak, Samuel Thibault, 2014/11/09
- [hurd] 13/87: Fix buffer allocation on io_read, Samuel Thibault, 2014/11/09
- [hurd] 77/87: pfinet: fix path in comment, Samuel Thibault, 2014/11/09
- [hurd] 76/87: libports: lock-less reference counting for port_info objects, Samuel Thibault, 2014/11/09
- [hurd] 81/87: Fix unlocking translator list, Samuel Thibault, 2014/11/09
- [hurd] 63/87: Update NEWS file, Samuel Thibault, 2014/11/09