[Cryptech-Commits] [sw/libhal] branch master updated: ~0 is actually more correct, or more portable

git at cryptech.is git at cryptech.is
Sat Oct 28 04:41:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

The following commit(s) were added to refs/heads/master by this push:
     new e5d8d55  ~0 is actually more correct, or more portable
e5d8d55 is described below

commit e5d8d558e954addf0e26ff887e9494d216da2225
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Thu Oct 26 13:22:51 2017 -0400

    ~0 is actually more correct, or more portable
---
 ks.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ks.c b/ks.c
index 000e109..b39e3f6 100644
--- a/ks.c
+++ b/ks.c
@@ -54,10 +54,7 @@ const hal_uuid_t hal_ks_pin_uuid = {{0}};
  * result, leave the lru values alone and the right thing will happen.
  */
 
-#define BLOCK_UNUSED ((unsigned) -1)
-/* Previous code used one's-complement ~0, which is exactly equal to
- * two's-complement -1, but more obscure.
- */
+#define BLOCK_UNUSED (~0U)
 
 hal_ks_block_t *hal_ks_cache_pick_lru(hal_ks_t *ks)
 {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list