Author: des
Date: Sun Aug 15 14:55:32 2010
New Revision: 211338
URL: http://svn.freebsd.org/changeset/base/211338

Log:
  no-op commit to note that the example given in the previous commit is
  a very bad one, since the shift does not actually overflow.  This is
  a better example (assuming uint64_t = unsigned long long):
  
    ~0LLU >> 9             =   0x7fffffffffffffLLU
    ~0LLU >> 9 << 10       = 0xfffffffffffffc00LLU
    ~0LLU >> 9 << 10 >> 10 =   0x3fffffffffffffLLU

Modified:
  head/lib/libutil/expand_number.c

Modified: head/lib/libutil/expand_number.c
==============================================================================
--- head/lib/libutil/expand_number.c    Sun Aug 15 14:50:03 2010        
(r211337)
+++ head/lib/libutil/expand_number.c    Sun Aug 15 14:55:32 2010        
(r211338)
@@ -66,7 +66,7 @@ expand_number(const char *buf, uint64_t 
                return (0);
        }
 
-#define SHIFT(n, b)                                                    \
+#define SHIFT(n, b) \
        do { if (((n << b) >> b) != n) goto overflow; n <<= b; } while (0)
 
        switch (tolower((unsigned char)*endptr)) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to