From: Andrew Gallagher Date: Thu, 14 Jun 2012 19:24:31 +0000 (-0700) Subject: Fix clang narrowing error in GroupVarintTables X-Git-Tag: v0.22.0~1263 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2ec852705e5b65f11d8f4488ba22f89ae4246062;p=folly.git Fix clang narrowing error in GroupVarintTables Summary: The __m128i type is a pair of 64-bit signed ints and the values generated in generate_varint_tables.py overflow this range, which causes clang to complain. Test Plan: Built and ran unittests. Also verified that the GroupVarintTable.o data section was identical with and w/o this change. Reviewed By: tudorb@fb.com FB internal diff: D494645 --- diff --git a/folly/build/generate_varint_tables.py b/folly/build/generate_varint_tables.py index 6bd88a0c..55375d2f 100755 --- a/folly/build/generate_varint_tables.py +++ b/folly/build/generate_varint_tables.py @@ -73,7 +73,8 @@ def generate(f): # 0xff: set corresponding byte in result to 0 for k in range(d, 4): vals[j] |= 0xff << (8 * k) - f.write(" {{0x{1:08x}{0:08x}LL, 0x{3:08x}{2:08x}LL}},\n".format(*vals)) + f.write(" {{static_cast(0x{1:08x}{0:08x}), " + "static_cast(0x{3:08x}{2:08x})}},\n".format(*vals)) f.write("};\n" "\n"