Hey guys,

I stumbled on this and I think it's wrong, correct me if I misunderstood it. But to me this seems like a masking which should not be done with && ;-)


-  uint32_t retVal = (uint32_t)(value && 0x00000000FFFFFFFF);
+  uint32_t retVal = (uint32_t)(value & 0x00000000FFFFFFFF);

Patch is attached,

Cheers & happy hacking.

Moritz
>From 109dd66f45ab93c70fe3e8f1efea3d14656aa6c8 Mon Sep 17 00:00:00 2001
From: Moritz Fischer <moritz.fisc...@student.kit.edu>
Date: Sun, 6 May 2012 12:37:32 +0200
Subject: [PATCH] Fixed a masking issue in volk_64u_popcnt_a.h .

---
 volk/include/volk/volk_64u_popcnt_a.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/volk/include/volk/volk_64u_popcnt_a.h b/volk/include/volk/volk_64u_popcnt_a.h
index 7d7359c..9e5b903 100644
--- a/volk/include/volk/volk_64u_popcnt_a.h
+++ b/volk/include/volk/volk_64u_popcnt_a.h
@@ -14,7 +14,7 @@ static inline void volk_64u_popcnt_a_generic(uint64_t* ret, const uint64_t value
 
   // This is faster than a lookup table
   //uint32_t retVal = valueVector[0];
-  uint32_t retVal = (uint32_t)(value && 0x00000000FFFFFFFF);
+  uint32_t retVal = (uint32_t)(value & 0x00000000FFFFFFFF);
 
   retVal = (retVal & 0x55555555) + (retVal >> 1 & 0x55555555);
   retVal = (retVal & 0x33333333) + (retVal >> 2 & 0x33333333);
-- 
1.7.10.1

_______________________________________________
Patch-gnuradio mailing list
Patch-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/patch-gnuradio

Reply via email to