diff --git a/hphp/compiler/analysis/class_scope.cpp b/hphp/compiler/analysis/class_scope.cpp index e31069cf6..67fd97245 100644 --- a/hphp/compiler/analysis/class_scope.cpp +++ b/hphp/compiler/analysis/class_scope.cpp @@ -1330,7 +1330,7 @@ void ClassScope::serialize(JSON::DocTarget::OutputStream &out) const { ms.add("parent"); if (m_parent.empty()) { - out << JSON::Null; + out << JSON::Null(); } else { out << GetDocName(out.analysisResult(), self, m_parent); } diff --git a/hphp/compiler/analysis/symbol_table.cpp b/hphp/compiler/analysis/symbol_table.cpp index 21c0e8125..5a9e0bdeb 100644 --- a/hphp/compiler/analysis/symbol_table.cpp +++ b/hphp/compiler/analysis/symbol_table.cpp @@ -285,9 +285,9 @@ void Symbol::serializeParam(JSON::DocTarget::OutputStream &out) const { assert(valueExp); const string &init = ExtractInitializer(out.analysisResult(), valueExp); if (!init.empty()) out << init; - else out << JSON::Null; + else out << JSON::Null(); } else { - out << JSON::Null; + out << JSON::Null(); } ms.done(); @@ -336,9 +336,9 @@ void Symbol::serializeClassVar(JSON::DocTarget::OutputStream &out) const { assert(initExp); const string &init = ExtractInitializer(out.analysisResult(), initExp); if (!init.empty()) out << init; - else out << JSON::Null; + else out << JSON::Null(); } else { - out << JSON::Null; + out << JSON::Null(); } const string &docs = ExtractDocComment( diff --git a/hphp/runtime/base/array/array_inline.h b/hphp/runtime/base/array/array_inline.h index 8b323d21f..e95353d37 100644 --- a/hphp/runtime/base/array/array_inline.h +++ b/hphp/runtime/base/array/array_inline.h @@ -26,15 +26,15 @@ namespace HPHP { namespace { typedef Variant::TypedValueAccessor TypedValueAccessor; -inline static bool isIntKey(TypedValueAccessor tva) { +inline bool isIntKey(TypedValueAccessor tva) { return Variant::GetAccessorType(tva) <= KindOfInt64; } -inline static int64_t getIntKey(TypedValueAccessor tva) { +inline int64_t getIntKey(TypedValueAccessor tva) { return Variant::GetInt64(tva); } -inline static StringData *getStringKey(TypedValueAccessor tva) { +inline StringData *getStringKey(TypedValueAccessor tva) { return Variant::GetStringData(tva); } } diff --git a/hphp/runtime/base/array/policy_array.h b/hphp/runtime/base/array/policy_array.h index 83ed4505a..18a52b8cc 100644 --- a/hphp/runtime/base/array/policy_array.h +++ b/hphp/runtime/base/array/policy_array.h @@ -40,14 +40,14 @@ static_assert(ssize_t(PosType::invalid) == ArrayData::invalid_index, " ArrayData::invalid_index mean distinct things."); // Change of type, no effect on representation -static int64_t toInt64(PosType pos) { +inline int64_t toInt64(PosType pos) { static_assert(sizeof(int64_t) == sizeof(PosType), "can't"); return static_cast(pos); } // Assumes a valid position, convert to an uint32_t. Useful for array // indices because they can't be larger than 32 bits anyway. -static uint32_t toUint32(PosType pos) { +inline uint32_t toUint32(PosType pos) { static_assert(uint32_t(PosType::invalid) == uint32_t(-1), ""); assert(pos != PosType::invalid); return static_cast(pos); @@ -58,13 +58,13 @@ inline PosType toPos(int32_t n) { static_assert(sizeof(int64_t) == sizeof(PosType), ""); return static_cast(n); } -static PosType toPos(int64_t n) { +inline PosType toPos(int64_t n) { static_assert(sizeof(int64_t) == sizeof(PosType), "can't"); return static_cast(n); } // Unsigned to pos. -static PosType toPos(uint32_t n) { +inline PosType toPos(uint32_t n) { // If this fails it's weird - uint max doesn't become // PosType::invalid; instead, it'll be 4 billion something, which is // unhelpful. @@ -408,7 +408,7 @@ private: const Variant& getImpl(K k, bool error) const; public: - // Andrei: this API forces storage to store variants in the + // aalexandre: this API forces storage to store variants in the // TypedValue/Variant layout, thus disallowing e.g. implementations // that store type tags and values separately. virtual const Variant& diff --git a/hphp/runtime/base/execution_context.h b/hphp/runtime/base/execution_context.h index 59930604b..d2a66d56c 100644 --- a/hphp/runtime/base/execution_context.h +++ b/hphp/runtime/base/execution_context.h @@ -155,12 +155,12 @@ enum InclOpFlags { InclOpRelative = 16 }; -static inline InclOpFlags +inline InclOpFlags operator|(const InclOpFlags &l, const InclOpFlags &r) { return InclOpFlags(int(l) | int(r)); } -static inline InclOpFlags +inline InclOpFlags operator&(const InclOpFlags &l, const InclOpFlags &r) { return InclOpFlags(int(l) & int(r)); } diff --git a/hphp/runtime/base/md5.h b/hphp/runtime/base/md5.h index b8739e731..9e17ae193 100644 --- a/hphp/runtime/base/md5.h +++ b/hphp/runtime/base/md5.h @@ -26,14 +26,13 @@ namespace HPHP { * are 128-bits, though, and fit economically in a fixed-size struct. */ -static const char* kDefaultMD5 = "00000000000000000000000000000000"; struct MD5 { uint64_t q[2]; - MD5(const char* str = kDefaultMD5) { - if (str == kDefaultMD5) { - q[0] = q[1] = 0; - return; - } + MD5() { + q[0] = q[1] = 0; + } + + explicit MD5(const char* str) { // We expect our input to be null-terminated output from PHP::md5(). assert(strlen(str) == 32); const int kQWordAsciiLen = 16; @@ -56,7 +55,7 @@ struct MD5 { } // blob is assumed to be in network byte order. - MD5(const void* blob) { + explicit MD5(const void* blob) { q[0] = ntohq(((const uint64_t*)blob)[0]); q[1] = ntohq(((const uint64_t*)blob)[1]); } diff --git a/hphp/runtime/base/stat_cache.cpp b/hphp/runtime/base/stat_cache.cpp index 0934102b8..0ae55c9b2 100644 --- a/hphp/runtime/base/stat_cache.cpp +++ b/hphp/runtime/base/stat_cache.cpp @@ -470,7 +470,7 @@ StatCache::NodePtr StatCache::getNode(const std::string& path, bool follow) { if (wd == -1 && errno != ENOTDIR) { TRACE(2, "StatCache: getNode('%s', follow=%s) failed\n", path.c_str(), follow ? "true" : "false"); - return nullptr; + return NodePtr(nullptr); } NodePtr node; if (wd != -1) { diff --git a/hphp/runtime/base/stats.h b/hphp/runtime/base/stats.h index 5e8974c97..8e8279cad 100644 --- a/hphp/runtime/base/stats.h +++ b/hphp/runtime/base/stats.h @@ -199,44 +199,44 @@ extern __thread uint64_t tl_counters[kNumStatCounters]; extern __thread uint64_t tl_helper_counters[]; extern const char* volatile helperNames[]; -static inline bool enabled() { +inline bool enabled() { return Trace::moduleEnabled(Trace::stats, 1); } -static inline bool enabledAny() { +inline bool enabledAny() { return enabled() || Trace::moduleEnabled(Trace::statgroups); } -static inline bool enableInstrCount() { +inline bool enableInstrCount() { return Trace::moduleEnabled(Trace::stats, 2); } -static inline void inc(StatCounter stat, int n = 1) { +inline void inc(StatCounter stat, int n = 1) { if (enabled()) { tl_counters[stat] += n; } } -static inline StatCounter opcodeToStatCounter(Opcode opc) { +inline StatCounter opcodeToStatCounter(Opcode opc) { assert(OpLowInvalid == 0); return StatCounter(Instr_InterpBBLowInvalid + STATS_PER_OPCODE * opc); } -static inline void incOp(Opcode opc) { +inline void incOp(Opcode opc) { inc(opcodeToStatCounter(opc)); } -static inline StatCounter opcodeToTranslStatCounter(Opcode opc) { +inline StatCounter opcodeToTranslStatCounter(Opcode opc) { assert(OpLowInvalid == 0); return StatCounter(Instr_TranslLowInvalid + STATS_PER_OPCODE * opc); } -static inline StatCounter opcodeToIRPreStatCounter(Opcode opc) { +inline StatCounter opcodeToIRPreStatCounter(Opcode opc) { assert(OpLowInvalid == 0); return StatCounter(Instr_TranslIRPreLowInvalid + STATS_PER_OPCODE * opc); } -static inline StatCounter opcodeToIRPostStatCounter(Opcode opc) { +inline StatCounter opcodeToIRPostStatCounter(Opcode opc) { assert(OpLowInvalid == 0); return StatCounter(Instr_TranslIRPostLowInvalid + STATS_PER_OPCODE * opc); } diff --git a/hphp/runtime/base/util/smart_ptr.h b/hphp/runtime/base/util/smart_ptr.h index da520fa60..a2648ebe1 100644 --- a/hphp/runtime/base/util/smart_ptr.h +++ b/hphp/runtime/base/util/smart_ptr.h @@ -31,7 +31,7 @@ namespace HPHP { * we want to assert that offsetof(T, m_px) is a specific value in all * these classes. */ -static const std::size_t kExpectedMPxOffset = 0; +const std::size_t kExpectedMPxOffset = 0; /** * Work with Countable to implement reference counting. For example, @@ -48,7 +48,7 @@ template class SmartPtr { public: SmartPtr() : m_px(nullptr) {} - SmartPtr(T* px) : m_px(px) { if (m_px) m_px->incRefCount(); } + explicit SmartPtr(T* px) : m_px(px) { if (m_px) m_px->incRefCount(); } SmartPtr(const SmartPtr& src) : m_px(src.get()) { if (m_px) m_px->incRefCount(); } @@ -165,11 +165,11 @@ template class AtomicSmartPtr { public: AtomicSmartPtr() : m_px(nullptr) {} - AtomicSmartPtr(T* px) : m_px(px) { + explicit AtomicSmartPtr(T* px) : m_px(px) { if (m_px) m_px->incAtomicCount(); } template - AtomicSmartPtr(Y* px) : m_px(px) { + explicit AtomicSmartPtr(Y* px) : m_px(px) { if (m_px) m_px->incAtomicCount(); } AtomicSmartPtr(const AtomicSmartPtr& src) : m_px(nullptr) { diff --git a/hphp/runtime/base/zend/zend_math.h b/hphp/runtime/base/zend/zend_math.h index 072214a9f..0150eb042 100644 --- a/hphp/runtime/base/zend/zend_math.h +++ b/hphp/runtime/base/zend/zend_math.h @@ -28,7 +28,7 @@ namespace HPHP { #define PHP_ROUND_HALF_EVEN 3 #define PHP_ROUND_HALF_ODD 4 -static inline double php_round_helper(double value, int mode) { +inline double php_round_helper(double value, int mode) { double tmp_value; if (value >= 0.0) { @@ -52,7 +52,7 @@ static inline double php_round_helper(double value, int mode) { return tmp_value; } -static inline double php_math_round(double value, int places, +inline double php_math_round(double value, int places, int mode = PHP_ROUND_HALF_UP) { double tmp_value; diff --git a/hphp/runtime/ext/hash/hash_murmur.h b/hphp/runtime/ext/hash/hash_murmur.h index 0675077f4..5837fc443 100644 --- a/hphp/runtime/ext/hash/hash_murmur.h +++ b/hphp/runtime/ext/hash/hash_murmur.h @@ -30,7 +30,7 @@ uint64_t murmur_rehash_64A(uint64_t k); /* Seed constant for MurmurHash64A selected by search for optimum diffusion * including recursive application. */ -static const int SEED = 4193360111ul; +const int SEED = 4193360111ul; /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/ext/hash/php_hash_crc32_tables.h b/hphp/runtime/ext/hash/php_hash_crc32_tables.h index 1fa4ce029..bda90de5f 100644 --- a/hphp/runtime/ext/hash/php_hash_crc32_tables.h +++ b/hphp/runtime/ext/hash/php_hash_crc32_tables.h @@ -17,125 +17,125 @@ /* $Id: php_hash_crc32_tables.h,v 1.2.2.3.2.1 2007/01/01 09:36:01 sebastian Exp $ */ -static const unsigned int crc32_table[] = { 0x0, - 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, - 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, - 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, - 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, - 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, - 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, - 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, - 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, - 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, - 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, - 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, - 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, - 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, - 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, - 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, - 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, - 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, - 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, - 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, - 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, - 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, - 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, - 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, - 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, - 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, - 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, - 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, - 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, - 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, - 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, - 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, - 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, - 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, - 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, - 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, - 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, - 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, - 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, - 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 +const unsigned int crc32_table[] = { 0x0, + 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, + 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, + 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, + 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, + 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, + 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, + 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, + 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, + 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, + 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, + 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, + 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, + 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, + 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, + 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, + 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, + 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, + 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, + 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, + 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, + 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, + 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, + 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, + 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, + 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, + 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, + 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, + 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, + 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, + 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, + 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, + 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, + 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, + 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, + 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, + 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, + 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, + 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 }; -static const unsigned int crc32b_table[] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, - 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, - 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, - 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, - 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, - 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, - 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, - 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, - 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, - 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, - 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, - 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, - 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, - 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, - 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, - 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, - 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, - 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, - 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, - 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, - 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, - 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, - 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, - 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, - 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, - 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, - 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, - 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, - 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, - 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, - 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, - 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, - 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, - 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, - 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, - 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, - 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, - 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, - 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, - 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, - 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, - 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, - 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, - 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +extern const unsigned int crc32b_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; /* diff --git a/hphp/runtime/ext/hash/php_hash_gost_tables.h b/hphp/runtime/ext/hash/php_hash_gost_tables.h index 1ce025643..de44ee455 100644 --- a/hphp/runtime/ext/hash/php_hash_gost_tables.h +++ b/hphp/runtime/ext/hash/php_hash_gost_tables.h @@ -14,141 +14,141 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ -static const unsigned int tables[4][256] = { - { /* table 1 */ - 0x00072000LU, 0x00075000LU, 0x00074800LU, 0x00071000LU, 0x00076800LU, 0x00074000LU, 0x00070000LU, 0x00077000LU, - 0x00073000LU, 0x00075800LU, 0x00070800LU, 0x00076000LU, 0x00073800LU, 0x00077800LU, 0x00072800LU, 0x00071800LU, - 0x0005A000LU, 0x0005D000LU, 0x0005C800LU, 0x00059000LU, 0x0005E800LU, 0x0005C000LU, 0x00058000LU, 0x0005F000LU, - 0x0005B000LU, 0x0005D800LU, 0x00058800LU, 0x0005E000LU, 0x0005B800LU, 0x0005F800LU, 0x0005A800LU, 0x00059800LU, - 0x00022000LU, 0x00025000LU, 0x00024800LU, 0x00021000LU, 0x00026800LU, 0x00024000LU, 0x00020000LU, 0x00027000LU, - 0x00023000LU, 0x00025800LU, 0x00020800LU, 0x00026000LU, 0x00023800LU, 0x00027800LU, 0x00022800LU, 0x00021800LU, - 0x00062000LU, 0x00065000LU, 0x00064800LU, 0x00061000LU, 0x00066800LU, 0x00064000LU, 0x00060000LU, 0x00067000LU, - 0x00063000LU, 0x00065800LU, 0x00060800LU, 0x00066000LU, 0x00063800LU, 0x00067800LU, 0x00062800LU, 0x00061800LU, - 0x00032000LU, 0x00035000LU, 0x00034800LU, 0x00031000LU, 0x00036800LU, 0x00034000LU, 0x00030000LU, 0x00037000LU, - 0x00033000LU, 0x00035800LU, 0x00030800LU, 0x00036000LU, 0x00033800LU, 0x00037800LU, 0x00032800LU, 0x00031800LU, - 0x0006A000LU, 0x0006D000LU, 0x0006C800LU, 0x00069000LU, 0x0006E800LU, 0x0006C000LU, 0x00068000LU, 0x0006F000LU, - 0x0006B000LU, 0x0006D800LU, 0x00068800LU, 0x0006E000LU, 0x0006B800LU, 0x0006F800LU, 0x0006A800LU, 0x00069800LU, - 0x0007A000LU, 0x0007D000LU, 0x0007C800LU, 0x00079000LU, 0x0007E800LU, 0x0007C000LU, 0x00078000LU, 0x0007F000LU, - 0x0007B000LU, 0x0007D800LU, 0x00078800LU, 0x0007E000LU, 0x0007B800LU, 0x0007F800LU, 0x0007A800LU, 0x00079800LU, - 0x00052000LU, 0x00055000LU, 0x00054800LU, 0x00051000LU, 0x00056800LU, 0x00054000LU, 0x00050000LU, 0x00057000LU, - 0x00053000LU, 0x00055800LU, 0x00050800LU, 0x00056000LU, 0x00053800LU, 0x00057800LU, 0x00052800LU, 0x00051800LU, - 0x00012000LU, 0x00015000LU, 0x00014800LU, 0x00011000LU, 0x00016800LU, 0x00014000LU, 0x00010000LU, 0x00017000LU, - 0x00013000LU, 0x00015800LU, 0x00010800LU, 0x00016000LU, 0x00013800LU, 0x00017800LU, 0x00012800LU, 0x00011800LU, - 0x0001A000LU, 0x0001D000LU, 0x0001C800LU, 0x00019000LU, 0x0001E800LU, 0x0001C000LU, 0x00018000LU, 0x0001F000LU, - 0x0001B000LU, 0x0001D800LU, 0x00018800LU, 0x0001E000LU, 0x0001B800LU, 0x0001F800LU, 0x0001A800LU, 0x00019800LU, - 0x00042000LU, 0x00045000LU, 0x00044800LU, 0x00041000LU, 0x00046800LU, 0x00044000LU, 0x00040000LU, 0x00047000LU, - 0x00043000LU, 0x00045800LU, 0x00040800LU, 0x00046000LU, 0x00043800LU, 0x00047800LU, 0x00042800LU, 0x00041800LU, - 0x0000A000LU, 0x0000D000LU, 0x0000C800LU, 0x00009000LU, 0x0000E800LU, 0x0000C000LU, 0x00008000LU, 0x0000F000LU, - 0x0000B000LU, 0x0000D800LU, 0x00008800LU, 0x0000E000LU, 0x0000B800LU, 0x0000F800LU, 0x0000A800LU, 0x00009800LU, - 0x00002000LU, 0x00005000LU, 0x00004800LU, 0x00001000LU, 0x00006800LU, 0x00004000LU, 0x00000000LU, 0x00007000LU, - 0x00003000LU, 0x00005800LU, 0x00000800LU, 0x00006000LU, 0x00003800LU, 0x00007800LU, 0x00002800LU, 0x00001800LU, - 0x0003A000LU, 0x0003D000LU, 0x0003C800LU, 0x00039000LU, 0x0003E800LU, 0x0003C000LU, 0x00038000LU, 0x0003F000LU, - 0x0003B000LU, 0x0003D800LU, 0x00038800LU, 0x0003E000LU, 0x0003B800LU, 0x0003F800LU, 0x0003A800LU, 0x00039800LU, - 0x0002A000LU, 0x0002D000LU, 0x0002C800LU, 0x00029000LU, 0x0002E800LU, 0x0002C000LU, 0x00028000LU, 0x0002F000LU, - 0x0002B000LU, 0x0002D800LU, 0x00028800LU, 0x0002E000LU, 0x0002B800LU, 0x0002F800LU, 0x0002A800LU, 0x00029800LU, - 0x0004A000LU, 0x0004D000LU, 0x0004C800LU, 0x00049000LU, 0x0004E800LU, 0x0004C000LU, 0x00048000LU, 0x0004F000LU, - 0x0004B000LU, 0x0004D800LU, 0x00048800LU, 0x0004E000LU, 0x0004B800LU, 0x0004F800LU, 0x0004A800LU, 0x00049800LU, - }, - { /* table 2 */ - 0x03A80000LU, 0x03C00000LU, 0x03880000LU, 0x03E80000LU, 0x03D00000LU, 0x03980000LU, 0x03A00000LU, 0x03900000LU, - 0x03F00000LU, 0x03F80000LU, 0x03E00000LU, 0x03B80000LU, 0x03B00000LU, 0x03800000LU, 0x03C80000LU, 0x03D80000LU, - 0x06A80000LU, 0x06C00000LU, 0x06880000LU, 0x06E80000LU, 0x06D00000LU, 0x06980000LU, 0x06A00000LU, 0x06900000LU, - 0x06F00000LU, 0x06F80000LU, 0x06E00000LU, 0x06B80000LU, 0x06B00000LU, 0x06800000LU, 0x06C80000LU, 0x06D80000LU, - 0x05280000LU, 0x05400000LU, 0x05080000LU, 0x05680000LU, 0x05500000LU, 0x05180000LU, 0x05200000LU, 0x05100000LU, - 0x05700000LU, 0x05780000LU, 0x05600000LU, 0x05380000LU, 0x05300000LU, 0x05000000LU, 0x05480000LU, 0x05580000LU, - 0x00A80000LU, 0x00C00000LU, 0x00880000LU, 0x00E80000LU, 0x00D00000LU, 0x00980000LU, 0x00A00000LU, 0x00900000LU, - 0x00F00000LU, 0x00F80000LU, 0x00E00000LU, 0x00B80000LU, 0x00B00000LU, 0x00800000LU, 0x00C80000LU, 0x00D80000LU, - 0x00280000LU, 0x00400000LU, 0x00080000LU, 0x00680000LU, 0x00500000LU, 0x00180000LU, 0x00200000LU, 0x00100000LU, - 0x00700000LU, 0x00780000LU, 0x00600000LU, 0x00380000LU, 0x00300000LU, 0x00000000LU, 0x00480000LU, 0x00580000LU, - 0x04280000LU, 0x04400000LU, 0x04080000LU, 0x04680000LU, 0x04500000LU, 0x04180000LU, 0x04200000LU, 0x04100000LU, - 0x04700000LU, 0x04780000LU, 0x04600000LU, 0x04380000LU, 0x04300000LU, 0x04000000LU, 0x04480000LU, 0x04580000LU, - 0x04A80000LU, 0x04C00000LU, 0x04880000LU, 0x04E80000LU, 0x04D00000LU, 0x04980000LU, 0x04A00000LU, 0x04900000LU, - 0x04F00000LU, 0x04F80000LU, 0x04E00000LU, 0x04B80000LU, 0x04B00000LU, 0x04800000LU, 0x04C80000LU, 0x04D80000LU, - 0x07A80000LU, 0x07C00000LU, 0x07880000LU, 0x07E80000LU, 0x07D00000LU, 0x07980000LU, 0x07A00000LU, 0x07900000LU, - 0x07F00000LU, 0x07F80000LU, 0x07E00000LU, 0x07B80000LU, 0x07B00000LU, 0x07800000LU, 0x07C80000LU, 0x07D80000LU, - 0x07280000LU, 0x07400000LU, 0x07080000LU, 0x07680000LU, 0x07500000LU, 0x07180000LU, 0x07200000LU, 0x07100000LU, - 0x07700000LU, 0x07780000LU, 0x07600000LU, 0x07380000LU, 0x07300000LU, 0x07000000LU, 0x07480000LU, 0x07580000LU, - 0x02280000LU, 0x02400000LU, 0x02080000LU, 0x02680000LU, 0x02500000LU, 0x02180000LU, 0x02200000LU, 0x02100000LU, - 0x02700000LU, 0x02780000LU, 0x02600000LU, 0x02380000LU, 0x02300000LU, 0x02000000LU, 0x02480000LU, 0x02580000LU, - 0x03280000LU, 0x03400000LU, 0x03080000LU, 0x03680000LU, 0x03500000LU, 0x03180000LU, 0x03200000LU, 0x03100000LU, - 0x03700000LU, 0x03780000LU, 0x03600000LU, 0x03380000LU, 0x03300000LU, 0x03000000LU, 0x03480000LU, 0x03580000LU, - 0x06280000LU, 0x06400000LU, 0x06080000LU, 0x06680000LU, 0x06500000LU, 0x06180000LU, 0x06200000LU, 0x06100000LU, - 0x06700000LU, 0x06780000LU, 0x06600000LU, 0x06380000LU, 0x06300000LU, 0x06000000LU, 0x06480000LU, 0x06580000LU, - 0x05A80000LU, 0x05C00000LU, 0x05880000LU, 0x05E80000LU, 0x05D00000LU, 0x05980000LU, 0x05A00000LU, 0x05900000LU, - 0x05F00000LU, 0x05F80000LU, 0x05E00000LU, 0x05B80000LU, 0x05B00000LU, 0x05800000LU, 0x05C80000LU, 0x05D80000LU, - 0x01280000LU, 0x01400000LU, 0x01080000LU, 0x01680000LU, 0x01500000LU, 0x01180000LU, 0x01200000LU, 0x01100000LU, - 0x01700000LU, 0x01780000LU, 0x01600000LU, 0x01380000LU, 0x01300000LU, 0x01000000LU, 0x01480000LU, 0x01580000LU, - 0x02A80000LU, 0x02C00000LU, 0x02880000LU, 0x02E80000LU, 0x02D00000LU, 0x02980000LU, 0x02A00000LU, 0x02900000LU, - 0x02F00000LU, 0x02F80000LU, 0x02E00000LU, 0x02B80000LU, 0x02B00000LU, 0x02800000LU, 0x02C80000LU, 0x02D80000LU, - 0x01A80000LU, 0x01C00000LU, 0x01880000LU, 0x01E80000LU, 0x01D00000LU, 0x01980000LU, 0x01A00000LU, 0x01900000LU, - 0x01F00000LU, 0x01F80000LU, 0x01E00000LU, 0x01B80000LU, 0x01B00000LU, 0x01800000LU, 0x01C80000LU, 0x01D80000LU, - }, - { /* table 3 */ - 0x30000002LU, 0x60000002LU, 0x38000002LU, 0x08000002LU, 0x28000002LU, 0x78000002LU, 0x68000002LU, 0x40000002LU, - 0x20000002LU, 0x50000002LU, 0x48000002LU, 0x70000002LU, 0x00000002LU, 0x18000002LU, 0x58000002LU, 0x10000002LU, - 0xB0000005LU, 0xE0000005LU, 0xB8000005LU, 0x88000005LU, 0xA8000005LU, 0xF8000005LU, 0xE8000005LU, 0xC0000005LU, - 0xA0000005LU, 0xD0000005LU, 0xC8000005LU, 0xF0000005LU, 0x80000005LU, 0x98000005LU, 0xD8000005LU, 0x90000005LU, - 0x30000005LU, 0x60000005LU, 0x38000005LU, 0x08000005LU, 0x28000005LU, 0x78000005LU, 0x68000005LU, 0x40000005LU, - 0x20000005LU, 0x50000005LU, 0x48000005LU, 0x70000005LU, 0x00000005LU, 0x18000005LU, 0x58000005LU, 0x10000005LU, - 0x30000000LU, 0x60000000LU, 0x38000000LU, 0x08000000LU, 0x28000000LU, 0x78000000LU, 0x68000000LU, 0x40000000LU, - 0x20000000LU, 0x50000000LU, 0x48000000LU, 0x70000000LU, 0x00000000LU, 0x18000000LU, 0x58000000LU, 0x10000000LU, - 0xB0000003LU, 0xE0000003LU, 0xB8000003LU, 0x88000003LU, 0xA8000003LU, 0xF8000003LU, 0xE8000003LU, 0xC0000003LU, - 0xA0000003LU, 0xD0000003LU, 0xC8000003LU, 0xF0000003LU, 0x80000003LU, 0x98000003LU, 0xD8000003LU, 0x90000003LU, - 0x30000001LU, 0x60000001LU, 0x38000001LU, 0x08000001LU, 0x28000001LU, 0x78000001LU, 0x68000001LU, 0x40000001LU, - 0x20000001LU, 0x50000001LU, 0x48000001LU, 0x70000001LU, 0x00000001LU, 0x18000001LU, 0x58000001LU, 0x10000001LU, - 0xB0000000LU, 0xE0000000LU, 0xB8000000LU, 0x88000000LU, 0xA8000000LU, 0xF8000000LU, 0xE8000000LU, 0xC0000000LU, - 0xA0000000LU, 0xD0000000LU, 0xC8000000LU, 0xF0000000LU, 0x80000000LU, 0x98000000LU, 0xD8000000LU, 0x90000000LU, - 0xB0000006LU, 0xE0000006LU, 0xB8000006LU, 0x88000006LU, 0xA8000006LU, 0xF8000006LU, 0xE8000006LU, 0xC0000006LU, - 0xA0000006LU, 0xD0000006LU, 0xC8000006LU, 0xF0000006LU, 0x80000006LU, 0x98000006LU, 0xD8000006LU, 0x90000006LU, - 0xB0000001LU, 0xE0000001LU, 0xB8000001LU, 0x88000001LU, 0xA8000001LU, 0xF8000001LU, 0xE8000001LU, 0xC0000001LU, - 0xA0000001LU, 0xD0000001LU, 0xC8000001LU, 0xF0000001LU, 0x80000001LU, 0x98000001LU, 0xD8000001LU, 0x90000001LU, - 0x30000003LU, 0x60000003LU, 0x38000003LU, 0x08000003LU, 0x28000003LU, 0x78000003LU, 0x68000003LU, 0x40000003LU, - 0x20000003LU, 0x50000003LU, 0x48000003LU, 0x70000003LU, 0x00000003LU, 0x18000003LU, 0x58000003LU, 0x10000003LU, - 0x30000004LU, 0x60000004LU, 0x38000004LU, 0x08000004LU, 0x28000004LU, 0x78000004LU, 0x68000004LU, 0x40000004LU, - 0x20000004LU, 0x50000004LU, 0x48000004LU, 0x70000004LU, 0x00000004LU, 0x18000004LU, 0x58000004LU, 0x10000004LU, - 0xB0000002LU, 0xE0000002LU, 0xB8000002LU, 0x88000002LU, 0xA8000002LU, 0xF8000002LU, 0xE8000002LU, 0xC0000002LU, - 0xA0000002LU, 0xD0000002LU, 0xC8000002LU, 0xF0000002LU, 0x80000002LU, 0x98000002LU, 0xD8000002LU, 0x90000002LU, - 0xB0000004LU, 0xE0000004LU, 0xB8000004LU, 0x88000004LU, 0xA8000004LU, 0xF8000004LU, 0xE8000004LU, 0xC0000004LU, - 0xA0000004LU, 0xD0000004LU, 0xC8000004LU, 0xF0000004LU, 0x80000004LU, 0x98000004LU, 0xD8000004LU, 0x90000004LU, - 0x30000006LU, 0x60000006LU, 0x38000006LU, 0x08000006LU, 0x28000006LU, 0x78000006LU, 0x68000006LU, 0x40000006LU, - 0x20000006LU, 0x50000006LU, 0x48000006LU, 0x70000006LU, 0x00000006LU, 0x18000006LU, 0x58000006LU, 0x10000006LU, - 0xB0000007LU, 0xE0000007LU, 0xB8000007LU, 0x88000007LU, 0xA8000007LU, 0xF8000007LU, 0xE8000007LU, 0xC0000007LU, - 0xA0000007LU, 0xD0000007LU, 0xC8000007LU, 0xF0000007LU, 0x80000007LU, 0x98000007LU, 0xD8000007LU, 0x90000007LU, - 0x30000007LU, 0x60000007LU, 0x38000007LU, 0x08000007LU, 0x28000007LU, 0x78000007LU, 0x68000007LU, 0x40000007LU, - 0x20000007LU, 0x50000007LU, 0x48000007LU, 0x70000007LU, 0x00000007LU, 0x18000007LU, 0x58000007LU, 0x10000007LU, - }, - { /* table 4 */ - 0x000000E8LU, 0x000000D8LU, 0x000000A0LU, 0x00000088LU, 0x00000098LU, 0x000000F8LU, 0x000000A8LU, 0x000000C8LU, - 0x00000080LU, 0x000000D0LU, 0x000000F0LU, 0x000000B8LU, 0x000000B0LU, 0x000000C0LU, 0x00000090LU, 0x000000E0LU, - 0x000007E8LU, 0x000007D8LU, 0x000007A0LU, 0x00000788LU, 0x00000798LU, 0x000007F8LU, 0x000007A8LU, 0x000007C8LU, - 0x00000780LU, 0x000007D0LU, 0x000007F0LU, 0x000007B8LU, 0x000007B0LU, 0x000007C0LU, 0x00000790LU, 0x000007E0LU, - 0x000006E8LU, 0x000006D8LU, 0x000006A0LU, 0x00000688LU, 0x00000698LU, 0x000006F8LU, 0x000006A8LU, 0x000006C8LU, - 0x00000680LU, 0x000006D0LU, 0x000006F0LU, 0x000006B8LU, 0x000006B0LU, 0x000006C0LU, 0x00000690LU, 0x000006E0LU, - 0x00000068LU, 0x00000058LU, 0x00000020LU, 0x00000008LU, 0x00000018LU, 0x00000078LU, 0x00000028LU, 0x00000048LU, - 0x00000000LU, 0x00000050LU, 0x00000070LU, 0x00000038LU, 0x00000030LU, 0x00000040LU, 0x00000010LU, 0x00000060LU, - 0x000002E8LU, 0x000002D8LU, 0x000002A0LU, 0x00000288LU, 0x00000298LU, 0x000002F8LU, 0x000002A8LU, 0x000002C8LU, - 0x00000280LU, 0x000002D0LU, 0x000002F0LU, 0x000002B8LU, 0x000002B0LU, 0x000002C0LU, 0x00000290LU, 0x000002E0LU, - 0x000003E8LU, 0x000003D8LU, 0x000003A0LU, 0x00000388LU, 0x00000398LU, 0x000003F8LU, 0x000003A8LU, 0x000003C8LU, - 0x00000380LU, 0x000003D0LU, 0x000003F0LU, 0x000003B8LU, 0x000003B0LU, 0x000003C0LU, 0x00000390LU, 0x000003E0LU, - 0x00000568LU, 0x00000558LU, 0x00000520LU, 0x00000508LU, 0x00000518LU, 0x00000578LU, 0x00000528LU, 0x00000548LU, - 0x00000500LU, 0x00000550LU, 0x00000570LU, 0x00000538LU, 0x00000530LU, 0x00000540LU, 0x00000510LU, 0x00000560LU, - 0x00000268LU, 0x00000258LU, 0x00000220LU, 0x00000208LU, 0x00000218LU, 0x00000278LU, 0x00000228LU, 0x00000248LU, - 0x00000200LU, 0x00000250LU, 0x00000270LU, 0x00000238LU, 0x00000230LU, 0x00000240LU, 0x00000210LU, 0x00000260LU, - 0x000004E8LU, 0x000004D8LU, 0x000004A0LU, 0x00000488LU, 0x00000498LU, 0x000004F8LU, 0x000004A8LU, 0x000004C8LU, - 0x00000480LU, 0x000004D0LU, 0x000004F0LU, 0x000004B8LU, 0x000004B0LU, 0x000004C0LU, 0x00000490LU, 0x000004E0LU, - 0x00000168LU, 0x00000158LU, 0x00000120LU, 0x00000108LU, 0x00000118LU, 0x00000178LU, 0x00000128LU, 0x00000148LU, - 0x00000100LU, 0x00000150LU, 0x00000170LU, 0x00000138LU, 0x00000130LU, 0x00000140LU, 0x00000110LU, 0x00000160LU, - 0x000001E8LU, 0x000001D8LU, 0x000001A0LU, 0x00000188LU, 0x00000198LU, 0x000001F8LU, 0x000001A8LU, 0x000001C8LU, - 0x00000180LU, 0x000001D0LU, 0x000001F0LU, 0x000001B8LU, 0x000001B0LU, 0x000001C0LU, 0x00000190LU, 0x000001E0LU, - 0x00000768LU, 0x00000758LU, 0x00000720LU, 0x00000708LU, 0x00000718LU, 0x00000778LU, 0x00000728LU, 0x00000748LU, - 0x00000700LU, 0x00000750LU, 0x00000770LU, 0x00000738LU, 0x00000730LU, 0x00000740LU, 0x00000710LU, 0x00000760LU, - 0x00000368LU, 0x00000358LU, 0x00000320LU, 0x00000308LU, 0x00000318LU, 0x00000378LU, 0x00000328LU, 0x00000348LU, - 0x00000300LU, 0x00000350LU, 0x00000370LU, 0x00000338LU, 0x00000330LU, 0x00000340LU, 0x00000310LU, 0x00000360LU, - 0x000005E8LU, 0x000005D8LU, 0x000005A0LU, 0x00000588LU, 0x00000598LU, 0x000005F8LU, 0x000005A8LU, 0x000005C8LU, - 0x00000580LU, 0x000005D0LU, 0x000005F0LU, 0x000005B8LU, 0x000005B0LU, 0x000005C0LU, 0x00000590LU, 0x000005E0LU, - 0x00000468LU, 0x00000458LU, 0x00000420LU, 0x00000408LU, 0x00000418LU, 0x00000478LU, 0x00000428LU, 0x00000448LU, - 0x00000400LU, 0x00000450LU, 0x00000470LU, 0x00000438LU, 0x00000430LU, 0x00000440LU, 0x00000410LU, 0x00000460LU, - 0x00000668LU, 0x00000658LU, 0x00000620LU, 0x00000608LU, 0x00000618LU, 0x00000678LU, 0x00000628LU, 0x00000648LU, - 0x00000600LU, 0x00000650LU, 0x00000670LU, 0x00000638LU, 0x00000630LU, 0x00000640LU, 0x00000610LU, 0x00000660LU, - }, +const unsigned int tables[4][256] = { + { /* table 1 */ + 0x00072000LU, 0x00075000LU, 0x00074800LU, 0x00071000LU, 0x00076800LU, 0x00074000LU, 0x00070000LU, 0x00077000LU, + 0x00073000LU, 0x00075800LU, 0x00070800LU, 0x00076000LU, 0x00073800LU, 0x00077800LU, 0x00072800LU, 0x00071800LU, + 0x0005A000LU, 0x0005D000LU, 0x0005C800LU, 0x00059000LU, 0x0005E800LU, 0x0005C000LU, 0x00058000LU, 0x0005F000LU, + 0x0005B000LU, 0x0005D800LU, 0x00058800LU, 0x0005E000LU, 0x0005B800LU, 0x0005F800LU, 0x0005A800LU, 0x00059800LU, + 0x00022000LU, 0x00025000LU, 0x00024800LU, 0x00021000LU, 0x00026800LU, 0x00024000LU, 0x00020000LU, 0x00027000LU, + 0x00023000LU, 0x00025800LU, 0x00020800LU, 0x00026000LU, 0x00023800LU, 0x00027800LU, 0x00022800LU, 0x00021800LU, + 0x00062000LU, 0x00065000LU, 0x00064800LU, 0x00061000LU, 0x00066800LU, 0x00064000LU, 0x00060000LU, 0x00067000LU, + 0x00063000LU, 0x00065800LU, 0x00060800LU, 0x00066000LU, 0x00063800LU, 0x00067800LU, 0x00062800LU, 0x00061800LU, + 0x00032000LU, 0x00035000LU, 0x00034800LU, 0x00031000LU, 0x00036800LU, 0x00034000LU, 0x00030000LU, 0x00037000LU, + 0x00033000LU, 0x00035800LU, 0x00030800LU, 0x00036000LU, 0x00033800LU, 0x00037800LU, 0x00032800LU, 0x00031800LU, + 0x0006A000LU, 0x0006D000LU, 0x0006C800LU, 0x00069000LU, 0x0006E800LU, 0x0006C000LU, 0x00068000LU, 0x0006F000LU, + 0x0006B000LU, 0x0006D800LU, 0x00068800LU, 0x0006E000LU, 0x0006B800LU, 0x0006F800LU, 0x0006A800LU, 0x00069800LU, + 0x0007A000LU, 0x0007D000LU, 0x0007C800LU, 0x00079000LU, 0x0007E800LU, 0x0007C000LU, 0x00078000LU, 0x0007F000LU, + 0x0007B000LU, 0x0007D800LU, 0x00078800LU, 0x0007E000LU, 0x0007B800LU, 0x0007F800LU, 0x0007A800LU, 0x00079800LU, + 0x00052000LU, 0x00055000LU, 0x00054800LU, 0x00051000LU, 0x00056800LU, 0x00054000LU, 0x00050000LU, 0x00057000LU, + 0x00053000LU, 0x00055800LU, 0x00050800LU, 0x00056000LU, 0x00053800LU, 0x00057800LU, 0x00052800LU, 0x00051800LU, + 0x00012000LU, 0x00015000LU, 0x00014800LU, 0x00011000LU, 0x00016800LU, 0x00014000LU, 0x00010000LU, 0x00017000LU, + 0x00013000LU, 0x00015800LU, 0x00010800LU, 0x00016000LU, 0x00013800LU, 0x00017800LU, 0x00012800LU, 0x00011800LU, + 0x0001A000LU, 0x0001D000LU, 0x0001C800LU, 0x00019000LU, 0x0001E800LU, 0x0001C000LU, 0x00018000LU, 0x0001F000LU, + 0x0001B000LU, 0x0001D800LU, 0x00018800LU, 0x0001E000LU, 0x0001B800LU, 0x0001F800LU, 0x0001A800LU, 0x00019800LU, + 0x00042000LU, 0x00045000LU, 0x00044800LU, 0x00041000LU, 0x00046800LU, 0x00044000LU, 0x00040000LU, 0x00047000LU, + 0x00043000LU, 0x00045800LU, 0x00040800LU, 0x00046000LU, 0x00043800LU, 0x00047800LU, 0x00042800LU, 0x00041800LU, + 0x0000A000LU, 0x0000D000LU, 0x0000C800LU, 0x00009000LU, 0x0000E800LU, 0x0000C000LU, 0x00008000LU, 0x0000F000LU, + 0x0000B000LU, 0x0000D800LU, 0x00008800LU, 0x0000E000LU, 0x0000B800LU, 0x0000F800LU, 0x0000A800LU, 0x00009800LU, + 0x00002000LU, 0x00005000LU, 0x00004800LU, 0x00001000LU, 0x00006800LU, 0x00004000LU, 0x00000000LU, 0x00007000LU, + 0x00003000LU, 0x00005800LU, 0x00000800LU, 0x00006000LU, 0x00003800LU, 0x00007800LU, 0x00002800LU, 0x00001800LU, + 0x0003A000LU, 0x0003D000LU, 0x0003C800LU, 0x00039000LU, 0x0003E800LU, 0x0003C000LU, 0x00038000LU, 0x0003F000LU, + 0x0003B000LU, 0x0003D800LU, 0x00038800LU, 0x0003E000LU, 0x0003B800LU, 0x0003F800LU, 0x0003A800LU, 0x00039800LU, + 0x0002A000LU, 0x0002D000LU, 0x0002C800LU, 0x00029000LU, 0x0002E800LU, 0x0002C000LU, 0x00028000LU, 0x0002F000LU, + 0x0002B000LU, 0x0002D800LU, 0x00028800LU, 0x0002E000LU, 0x0002B800LU, 0x0002F800LU, 0x0002A800LU, 0x00029800LU, + 0x0004A000LU, 0x0004D000LU, 0x0004C800LU, 0x00049000LU, 0x0004E800LU, 0x0004C000LU, 0x00048000LU, 0x0004F000LU, + 0x0004B000LU, 0x0004D800LU, 0x00048800LU, 0x0004E000LU, 0x0004B800LU, 0x0004F800LU, 0x0004A800LU, 0x00049800LU, + }, + { /* table 2 */ + 0x03A80000LU, 0x03C00000LU, 0x03880000LU, 0x03E80000LU, 0x03D00000LU, 0x03980000LU, 0x03A00000LU, 0x03900000LU, + 0x03F00000LU, 0x03F80000LU, 0x03E00000LU, 0x03B80000LU, 0x03B00000LU, 0x03800000LU, 0x03C80000LU, 0x03D80000LU, + 0x06A80000LU, 0x06C00000LU, 0x06880000LU, 0x06E80000LU, 0x06D00000LU, 0x06980000LU, 0x06A00000LU, 0x06900000LU, + 0x06F00000LU, 0x06F80000LU, 0x06E00000LU, 0x06B80000LU, 0x06B00000LU, 0x06800000LU, 0x06C80000LU, 0x06D80000LU, + 0x05280000LU, 0x05400000LU, 0x05080000LU, 0x05680000LU, 0x05500000LU, 0x05180000LU, 0x05200000LU, 0x05100000LU, + 0x05700000LU, 0x05780000LU, 0x05600000LU, 0x05380000LU, 0x05300000LU, 0x05000000LU, 0x05480000LU, 0x05580000LU, + 0x00A80000LU, 0x00C00000LU, 0x00880000LU, 0x00E80000LU, 0x00D00000LU, 0x00980000LU, 0x00A00000LU, 0x00900000LU, + 0x00F00000LU, 0x00F80000LU, 0x00E00000LU, 0x00B80000LU, 0x00B00000LU, 0x00800000LU, 0x00C80000LU, 0x00D80000LU, + 0x00280000LU, 0x00400000LU, 0x00080000LU, 0x00680000LU, 0x00500000LU, 0x00180000LU, 0x00200000LU, 0x00100000LU, + 0x00700000LU, 0x00780000LU, 0x00600000LU, 0x00380000LU, 0x00300000LU, 0x00000000LU, 0x00480000LU, 0x00580000LU, + 0x04280000LU, 0x04400000LU, 0x04080000LU, 0x04680000LU, 0x04500000LU, 0x04180000LU, 0x04200000LU, 0x04100000LU, + 0x04700000LU, 0x04780000LU, 0x04600000LU, 0x04380000LU, 0x04300000LU, 0x04000000LU, 0x04480000LU, 0x04580000LU, + 0x04A80000LU, 0x04C00000LU, 0x04880000LU, 0x04E80000LU, 0x04D00000LU, 0x04980000LU, 0x04A00000LU, 0x04900000LU, + 0x04F00000LU, 0x04F80000LU, 0x04E00000LU, 0x04B80000LU, 0x04B00000LU, 0x04800000LU, 0x04C80000LU, 0x04D80000LU, + 0x07A80000LU, 0x07C00000LU, 0x07880000LU, 0x07E80000LU, 0x07D00000LU, 0x07980000LU, 0x07A00000LU, 0x07900000LU, + 0x07F00000LU, 0x07F80000LU, 0x07E00000LU, 0x07B80000LU, 0x07B00000LU, 0x07800000LU, 0x07C80000LU, 0x07D80000LU, + 0x07280000LU, 0x07400000LU, 0x07080000LU, 0x07680000LU, 0x07500000LU, 0x07180000LU, 0x07200000LU, 0x07100000LU, + 0x07700000LU, 0x07780000LU, 0x07600000LU, 0x07380000LU, 0x07300000LU, 0x07000000LU, 0x07480000LU, 0x07580000LU, + 0x02280000LU, 0x02400000LU, 0x02080000LU, 0x02680000LU, 0x02500000LU, 0x02180000LU, 0x02200000LU, 0x02100000LU, + 0x02700000LU, 0x02780000LU, 0x02600000LU, 0x02380000LU, 0x02300000LU, 0x02000000LU, 0x02480000LU, 0x02580000LU, + 0x03280000LU, 0x03400000LU, 0x03080000LU, 0x03680000LU, 0x03500000LU, 0x03180000LU, 0x03200000LU, 0x03100000LU, + 0x03700000LU, 0x03780000LU, 0x03600000LU, 0x03380000LU, 0x03300000LU, 0x03000000LU, 0x03480000LU, 0x03580000LU, + 0x06280000LU, 0x06400000LU, 0x06080000LU, 0x06680000LU, 0x06500000LU, 0x06180000LU, 0x06200000LU, 0x06100000LU, + 0x06700000LU, 0x06780000LU, 0x06600000LU, 0x06380000LU, 0x06300000LU, 0x06000000LU, 0x06480000LU, 0x06580000LU, + 0x05A80000LU, 0x05C00000LU, 0x05880000LU, 0x05E80000LU, 0x05D00000LU, 0x05980000LU, 0x05A00000LU, 0x05900000LU, + 0x05F00000LU, 0x05F80000LU, 0x05E00000LU, 0x05B80000LU, 0x05B00000LU, 0x05800000LU, 0x05C80000LU, 0x05D80000LU, + 0x01280000LU, 0x01400000LU, 0x01080000LU, 0x01680000LU, 0x01500000LU, 0x01180000LU, 0x01200000LU, 0x01100000LU, + 0x01700000LU, 0x01780000LU, 0x01600000LU, 0x01380000LU, 0x01300000LU, 0x01000000LU, 0x01480000LU, 0x01580000LU, + 0x02A80000LU, 0x02C00000LU, 0x02880000LU, 0x02E80000LU, 0x02D00000LU, 0x02980000LU, 0x02A00000LU, 0x02900000LU, + 0x02F00000LU, 0x02F80000LU, 0x02E00000LU, 0x02B80000LU, 0x02B00000LU, 0x02800000LU, 0x02C80000LU, 0x02D80000LU, + 0x01A80000LU, 0x01C00000LU, 0x01880000LU, 0x01E80000LU, 0x01D00000LU, 0x01980000LU, 0x01A00000LU, 0x01900000LU, + 0x01F00000LU, 0x01F80000LU, 0x01E00000LU, 0x01B80000LU, 0x01B00000LU, 0x01800000LU, 0x01C80000LU, 0x01D80000LU, + }, + { /* table 3 */ + 0x30000002LU, 0x60000002LU, 0x38000002LU, 0x08000002LU, 0x28000002LU, 0x78000002LU, 0x68000002LU, 0x40000002LU, + 0x20000002LU, 0x50000002LU, 0x48000002LU, 0x70000002LU, 0x00000002LU, 0x18000002LU, 0x58000002LU, 0x10000002LU, + 0xB0000005LU, 0xE0000005LU, 0xB8000005LU, 0x88000005LU, 0xA8000005LU, 0xF8000005LU, 0xE8000005LU, 0xC0000005LU, + 0xA0000005LU, 0xD0000005LU, 0xC8000005LU, 0xF0000005LU, 0x80000005LU, 0x98000005LU, 0xD8000005LU, 0x90000005LU, + 0x30000005LU, 0x60000005LU, 0x38000005LU, 0x08000005LU, 0x28000005LU, 0x78000005LU, 0x68000005LU, 0x40000005LU, + 0x20000005LU, 0x50000005LU, 0x48000005LU, 0x70000005LU, 0x00000005LU, 0x18000005LU, 0x58000005LU, 0x10000005LU, + 0x30000000LU, 0x60000000LU, 0x38000000LU, 0x08000000LU, 0x28000000LU, 0x78000000LU, 0x68000000LU, 0x40000000LU, + 0x20000000LU, 0x50000000LU, 0x48000000LU, 0x70000000LU, 0x00000000LU, 0x18000000LU, 0x58000000LU, 0x10000000LU, + 0xB0000003LU, 0xE0000003LU, 0xB8000003LU, 0x88000003LU, 0xA8000003LU, 0xF8000003LU, 0xE8000003LU, 0xC0000003LU, + 0xA0000003LU, 0xD0000003LU, 0xC8000003LU, 0xF0000003LU, 0x80000003LU, 0x98000003LU, 0xD8000003LU, 0x90000003LU, + 0x30000001LU, 0x60000001LU, 0x38000001LU, 0x08000001LU, 0x28000001LU, 0x78000001LU, 0x68000001LU, 0x40000001LU, + 0x20000001LU, 0x50000001LU, 0x48000001LU, 0x70000001LU, 0x00000001LU, 0x18000001LU, 0x58000001LU, 0x10000001LU, + 0xB0000000LU, 0xE0000000LU, 0xB8000000LU, 0x88000000LU, 0xA8000000LU, 0xF8000000LU, 0xE8000000LU, 0xC0000000LU, + 0xA0000000LU, 0xD0000000LU, 0xC8000000LU, 0xF0000000LU, 0x80000000LU, 0x98000000LU, 0xD8000000LU, 0x90000000LU, + 0xB0000006LU, 0xE0000006LU, 0xB8000006LU, 0x88000006LU, 0xA8000006LU, 0xF8000006LU, 0xE8000006LU, 0xC0000006LU, + 0xA0000006LU, 0xD0000006LU, 0xC8000006LU, 0xF0000006LU, 0x80000006LU, 0x98000006LU, 0xD8000006LU, 0x90000006LU, + 0xB0000001LU, 0xE0000001LU, 0xB8000001LU, 0x88000001LU, 0xA8000001LU, 0xF8000001LU, 0xE8000001LU, 0xC0000001LU, + 0xA0000001LU, 0xD0000001LU, 0xC8000001LU, 0xF0000001LU, 0x80000001LU, 0x98000001LU, 0xD8000001LU, 0x90000001LU, + 0x30000003LU, 0x60000003LU, 0x38000003LU, 0x08000003LU, 0x28000003LU, 0x78000003LU, 0x68000003LU, 0x40000003LU, + 0x20000003LU, 0x50000003LU, 0x48000003LU, 0x70000003LU, 0x00000003LU, 0x18000003LU, 0x58000003LU, 0x10000003LU, + 0x30000004LU, 0x60000004LU, 0x38000004LU, 0x08000004LU, 0x28000004LU, 0x78000004LU, 0x68000004LU, 0x40000004LU, + 0x20000004LU, 0x50000004LU, 0x48000004LU, 0x70000004LU, 0x00000004LU, 0x18000004LU, 0x58000004LU, 0x10000004LU, + 0xB0000002LU, 0xE0000002LU, 0xB8000002LU, 0x88000002LU, 0xA8000002LU, 0xF8000002LU, 0xE8000002LU, 0xC0000002LU, + 0xA0000002LU, 0xD0000002LU, 0xC8000002LU, 0xF0000002LU, 0x80000002LU, 0x98000002LU, 0xD8000002LU, 0x90000002LU, + 0xB0000004LU, 0xE0000004LU, 0xB8000004LU, 0x88000004LU, 0xA8000004LU, 0xF8000004LU, 0xE8000004LU, 0xC0000004LU, + 0xA0000004LU, 0xD0000004LU, 0xC8000004LU, 0xF0000004LU, 0x80000004LU, 0x98000004LU, 0xD8000004LU, 0x90000004LU, + 0x30000006LU, 0x60000006LU, 0x38000006LU, 0x08000006LU, 0x28000006LU, 0x78000006LU, 0x68000006LU, 0x40000006LU, + 0x20000006LU, 0x50000006LU, 0x48000006LU, 0x70000006LU, 0x00000006LU, 0x18000006LU, 0x58000006LU, 0x10000006LU, + 0xB0000007LU, 0xE0000007LU, 0xB8000007LU, 0x88000007LU, 0xA8000007LU, 0xF8000007LU, 0xE8000007LU, 0xC0000007LU, + 0xA0000007LU, 0xD0000007LU, 0xC8000007LU, 0xF0000007LU, 0x80000007LU, 0x98000007LU, 0xD8000007LU, 0x90000007LU, + 0x30000007LU, 0x60000007LU, 0x38000007LU, 0x08000007LU, 0x28000007LU, 0x78000007LU, 0x68000007LU, 0x40000007LU, + 0x20000007LU, 0x50000007LU, 0x48000007LU, 0x70000007LU, 0x00000007LU, 0x18000007LU, 0x58000007LU, 0x10000007LU, + }, + { /* table 4 */ + 0x000000E8LU, 0x000000D8LU, 0x000000A0LU, 0x00000088LU, 0x00000098LU, 0x000000F8LU, 0x000000A8LU, 0x000000C8LU, + 0x00000080LU, 0x000000D0LU, 0x000000F0LU, 0x000000B8LU, 0x000000B0LU, 0x000000C0LU, 0x00000090LU, 0x000000E0LU, + 0x000007E8LU, 0x000007D8LU, 0x000007A0LU, 0x00000788LU, 0x00000798LU, 0x000007F8LU, 0x000007A8LU, 0x000007C8LU, + 0x00000780LU, 0x000007D0LU, 0x000007F0LU, 0x000007B8LU, 0x000007B0LU, 0x000007C0LU, 0x00000790LU, 0x000007E0LU, + 0x000006E8LU, 0x000006D8LU, 0x000006A0LU, 0x00000688LU, 0x00000698LU, 0x000006F8LU, 0x000006A8LU, 0x000006C8LU, + 0x00000680LU, 0x000006D0LU, 0x000006F0LU, 0x000006B8LU, 0x000006B0LU, 0x000006C0LU, 0x00000690LU, 0x000006E0LU, + 0x00000068LU, 0x00000058LU, 0x00000020LU, 0x00000008LU, 0x00000018LU, 0x00000078LU, 0x00000028LU, 0x00000048LU, + 0x00000000LU, 0x00000050LU, 0x00000070LU, 0x00000038LU, 0x00000030LU, 0x00000040LU, 0x00000010LU, 0x00000060LU, + 0x000002E8LU, 0x000002D8LU, 0x000002A0LU, 0x00000288LU, 0x00000298LU, 0x000002F8LU, 0x000002A8LU, 0x000002C8LU, + 0x00000280LU, 0x000002D0LU, 0x000002F0LU, 0x000002B8LU, 0x000002B0LU, 0x000002C0LU, 0x00000290LU, 0x000002E0LU, + 0x000003E8LU, 0x000003D8LU, 0x000003A0LU, 0x00000388LU, 0x00000398LU, 0x000003F8LU, 0x000003A8LU, 0x000003C8LU, + 0x00000380LU, 0x000003D0LU, 0x000003F0LU, 0x000003B8LU, 0x000003B0LU, 0x000003C0LU, 0x00000390LU, 0x000003E0LU, + 0x00000568LU, 0x00000558LU, 0x00000520LU, 0x00000508LU, 0x00000518LU, 0x00000578LU, 0x00000528LU, 0x00000548LU, + 0x00000500LU, 0x00000550LU, 0x00000570LU, 0x00000538LU, 0x00000530LU, 0x00000540LU, 0x00000510LU, 0x00000560LU, + 0x00000268LU, 0x00000258LU, 0x00000220LU, 0x00000208LU, 0x00000218LU, 0x00000278LU, 0x00000228LU, 0x00000248LU, + 0x00000200LU, 0x00000250LU, 0x00000270LU, 0x00000238LU, 0x00000230LU, 0x00000240LU, 0x00000210LU, 0x00000260LU, + 0x000004E8LU, 0x000004D8LU, 0x000004A0LU, 0x00000488LU, 0x00000498LU, 0x000004F8LU, 0x000004A8LU, 0x000004C8LU, + 0x00000480LU, 0x000004D0LU, 0x000004F0LU, 0x000004B8LU, 0x000004B0LU, 0x000004C0LU, 0x00000490LU, 0x000004E0LU, + 0x00000168LU, 0x00000158LU, 0x00000120LU, 0x00000108LU, 0x00000118LU, 0x00000178LU, 0x00000128LU, 0x00000148LU, + 0x00000100LU, 0x00000150LU, 0x00000170LU, 0x00000138LU, 0x00000130LU, 0x00000140LU, 0x00000110LU, 0x00000160LU, + 0x000001E8LU, 0x000001D8LU, 0x000001A0LU, 0x00000188LU, 0x00000198LU, 0x000001F8LU, 0x000001A8LU, 0x000001C8LU, + 0x00000180LU, 0x000001D0LU, 0x000001F0LU, 0x000001B8LU, 0x000001B0LU, 0x000001C0LU, 0x00000190LU, 0x000001E0LU, + 0x00000768LU, 0x00000758LU, 0x00000720LU, 0x00000708LU, 0x00000718LU, 0x00000778LU, 0x00000728LU, 0x00000748LU, + 0x00000700LU, 0x00000750LU, 0x00000770LU, 0x00000738LU, 0x00000730LU, 0x00000740LU, 0x00000710LU, 0x00000760LU, + 0x00000368LU, 0x00000358LU, 0x00000320LU, 0x00000308LU, 0x00000318LU, 0x00000378LU, 0x00000328LU, 0x00000348LU, + 0x00000300LU, 0x00000350LU, 0x00000370LU, 0x00000338LU, 0x00000330LU, 0x00000340LU, 0x00000310LU, 0x00000360LU, + 0x000005E8LU, 0x000005D8LU, 0x000005A0LU, 0x00000588LU, 0x00000598LU, 0x000005F8LU, 0x000005A8LU, 0x000005C8LU, + 0x00000580LU, 0x000005D0LU, 0x000005F0LU, 0x000005B8LU, 0x000005B0LU, 0x000005C0LU, 0x00000590LU, 0x000005E0LU, + 0x00000468LU, 0x00000458LU, 0x00000420LU, 0x00000408LU, 0x00000418LU, 0x00000478LU, 0x00000428LU, 0x00000448LU, + 0x00000400LU, 0x00000450LU, 0x00000470LU, 0x00000438LU, 0x00000430LU, 0x00000440LU, 0x00000410LU, 0x00000460LU, + 0x00000668LU, 0x00000658LU, 0x00000620LU, 0x00000608LU, 0x00000618LU, 0x00000678LU, 0x00000628LU, 0x00000648LU, + 0x00000600LU, 0x00000650LU, 0x00000670LU, 0x00000638LU, 0x00000630LU, 0x00000640LU, 0x00000610LU, 0x00000660LU, + }, }; diff --git a/hphp/runtime/ext/hash/php_hash_snefru_tables.h b/hphp/runtime/ext/hash/php_hash_snefru_tables.h index d7b73e9b3..ed1012b34 100644 --- a/hphp/runtime/ext/hash/php_hash_snefru_tables.h +++ b/hphp/runtime/ext/hash/php_hash_snefru_tables.h @@ -17,7 +17,7 @@ /* $Id: php_hash_snefru_tables.h,v 1.3.2.3.2.1 2007/01/01 09:36:01 sebastian Exp $ */ -static const unsigned int tables[16][256]= { +const unsigned int tables[16][256]= { { /* Start of S Box 0 */ diff --git a/hphp/runtime/ext/hash/php_hash_tiger_tables.h b/hphp/runtime/ext/hash/php_hash_tiger_tables.h index 700ee71e1..ac8f2ae3f 100644 --- a/hphp/runtime/ext/hash/php_hash_tiger_tables.h +++ b/hphp/runtime/ext/hash/php_hash_tiger_tables.h @@ -24,7 +24,7 @@ namespace HPHP { -static const uint64_t table[4*256] = { +const uint64_t table[4*256] = { L64(0x02AAB17CF7E90C5E) /* 0 */, L64(0xAC424B03E243A8EC) /* 1 */, L64(0x72CD5BE30DD5FCD3) /* 2 */, L64(0x6D019B93F6F97F3A) /* 3 */, L64(0xCD9978FFD21F9193) /* 4 */, L64(0x7573A1C9708029E2) /* 5 */, diff --git a/hphp/runtime/ext/hash/php_hash_whirlpool_tables.h b/hphp/runtime/ext/hash/php_hash_whirlpool_tables.h index 59d164a36..a020525f8 100644 --- a/hphp/runtime/ext/hash/php_hash_whirlpool_tables.h +++ b/hphp/runtime/ext/hash/php_hash_whirlpool_tables.h @@ -24,7 +24,7 @@ namespace HPHP { #define R 10 -static const uint64_t rc[R + 1] = { +const uint64_t rc[R + 1] = { L64(0x0000000000000000), L64(0x1823c6e887b8014f), L64(0x36a6d2f5796f9152), @@ -38,7 +38,7 @@ static const uint64_t rc[R + 1] = { L64(0xca2dbf07ad5a8333), }; -static const uint64_t C0[256] = { +const uint64_t C0[256] = { L64(0x18186018c07830d8), L64(0x23238c2305af4626), L64(0xc6c63fc67ef991b8), L64(0xe8e887e8136fcdfb), L64(0x878726874ca113cb), L64(0xb8b8dab8a9626d11), L64(0x0101040108050209), L64(0x4f4f214f426e9e0d), L64(0x3636d836adee6c9b), L64(0xa6a6a2a6590451ff), L64(0xd2d26fd2debdb90c), L64(0xf5f5f3f5fb06f70e), @@ -105,7 +105,7 @@ static const uint64_t C0[256] = { L64(0x2828a0285d885075), L64(0x5c5c6d5cda31b886), L64(0xf8f8c7f8933fed6b), L64(0x8686228644a411c2), }; -static const uint64_t C1[256] = { +const uint64_t C1[256] = { L64(0xd818186018c07830), L64(0x2623238c2305af46), L64(0xb8c6c63fc67ef991), L64(0xfbe8e887e8136fcd), L64(0xcb878726874ca113), L64(0x11b8b8dab8a9626d), L64(0x0901010401080502), L64(0x0d4f4f214f426e9e), L64(0x9b3636d836adee6c), L64(0xffa6a6a2a6590451), L64(0x0cd2d26fd2debdb9), L64(0x0ef5f5f3f5fb06f7), @@ -172,7 +172,7 @@ static const uint64_t C1[256] = { L64(0x752828a0285d8850), L64(0x865c5c6d5cda31b8), L64(0x6bf8f8c7f8933fed), L64(0xc28686228644a411), }; -static const uint64_t C2[256] = { +const uint64_t C2[256] = { L64(0x30d818186018c078), L64(0x462623238c2305af), L64(0x91b8c6c63fc67ef9), L64(0xcdfbe8e887e8136f), L64(0x13cb878726874ca1), L64(0x6d11b8b8dab8a962), L64(0x0209010104010805), L64(0x9e0d4f4f214f426e), L64(0x6c9b3636d836adee), L64(0x51ffa6a6a2a65904), L64(0xb90cd2d26fd2debd), L64(0xf70ef5f5f3f5fb06), @@ -239,7 +239,7 @@ static const uint64_t C2[256] = { L64(0x50752828a0285d88), L64(0xb8865c5c6d5cda31), L64(0xed6bf8f8c7f8933f), L64(0x11c28686228644a4), }; -static const uint64_t C3[256] = { +const uint64_t C3[256] = { L64(0x7830d818186018c0), L64(0xaf462623238c2305), L64(0xf991b8c6c63fc67e), L64(0x6fcdfbe8e887e813), L64(0xa113cb878726874c), L64(0x626d11b8b8dab8a9), L64(0x0502090101040108), L64(0x6e9e0d4f4f214f42), L64(0xee6c9b3636d836ad), L64(0x0451ffa6a6a2a659), L64(0xbdb90cd2d26fd2de), L64(0x06f70ef5f5f3f5fb), @@ -306,7 +306,7 @@ static const uint64_t C3[256] = { L64(0x8850752828a0285d), L64(0x31b8865c5c6d5cda), L64(0x3fed6bf8f8c7f893), L64(0xa411c28686228644), }; -static const uint64_t C4[256] = { +const uint64_t C4[256] = { L64(0xc07830d818186018), L64(0x05af462623238c23), L64(0x7ef991b8c6c63fc6), L64(0x136fcdfbe8e887e8), L64(0x4ca113cb87872687), L64(0xa9626d11b8b8dab8), L64(0x0805020901010401), L64(0x426e9e0d4f4f214f), L64(0xadee6c9b3636d836), L64(0x590451ffa6a6a2a6), L64(0xdebdb90cd2d26fd2), L64(0xfb06f70ef5f5f3f5), @@ -373,7 +373,7 @@ static const uint64_t C4[256] = { L64(0x5d8850752828a028), L64(0xda31b8865c5c6d5c), L64(0x933fed6bf8f8c7f8), L64(0x44a411c286862286), }; -static const uint64_t C5[256] = { +const uint64_t C5[256] = { L64(0x18c07830d8181860), L64(0x2305af462623238c), L64(0xc67ef991b8c6c63f), L64(0xe8136fcdfbe8e887), L64(0x874ca113cb878726), L64(0xb8a9626d11b8b8da), L64(0x0108050209010104), L64(0x4f426e9e0d4f4f21), L64(0x36adee6c9b3636d8), L64(0xa6590451ffa6a6a2), L64(0xd2debdb90cd2d26f), L64(0xf5fb06f70ef5f5f3), @@ -440,7 +440,7 @@ static const uint64_t C5[256] = { L64(0x285d8850752828a0), L64(0x5cda31b8865c5c6d), L64(0xf8933fed6bf8f8c7), L64(0x8644a411c2868622), }; -static const uint64_t C6[256] = { + const uint64_t C6[256] = { L64(0x6018c07830d81818), L64(0x8c2305af46262323), L64(0x3fc67ef991b8c6c6), L64(0x87e8136fcdfbe8e8), L64(0x26874ca113cb8787), L64(0xdab8a9626d11b8b8), L64(0x0401080502090101), L64(0x214f426e9e0d4f4f), L64(0xd836adee6c9b3636), L64(0xa2a6590451ffa6a6), L64(0x6fd2debdb90cd2d2), L64(0xf3f5fb06f70ef5f5), @@ -507,7 +507,7 @@ static const uint64_t C6[256] = { L64(0xa0285d8850752828), L64(0x6d5cda31b8865c5c), L64(0xc7f8933fed6bf8f8), L64(0x228644a411c28686), }; -static const uint64_t C7[256] = { +const uint64_t C7[256] = { L64(0x186018c07830d818), L64(0x238c2305af462623), L64(0xc63fc67ef991b8c6), L64(0xe887e8136fcdfbe8), L64(0x8726874ca113cb87), L64(0xb8dab8a9626d11b8), L64(0x0104010805020901), L64(0x4f214f426e9e0d4f), L64(0x36d836adee6c9b36), L64(0xa6a2a6590451ffa6), L64(0xd26fd2debdb90cd2), L64(0xf5f3f5fb06f70ef5), diff --git a/hphp/runtime/ext/thrift/binary.cpp b/hphp/runtime/ext/thrift/binary.cpp index b67f1f2d8..eade01f44 100644 --- a/hphp/runtime/ext/thrift/binary.cpp +++ b/hphp/runtime/ext/thrift/binary.cpp @@ -28,6 +28,23 @@ #include namespace HPHP { + +StaticString PHPTransport::s_getTransport("getTransport"); +StaticString PHPTransport::s_flush("flush"); +StaticString PHPTransport::s_write("write"); +StaticString PHPTransport::s_putBack("putBack"); +StaticString PHPTransport::s_read("read"); +StaticString PHPTransport::s_class("class"); +StaticString PHPTransport::s_key("key"); +StaticString PHPTransport::s_val("val"); +StaticString PHPTransport::s_elem("elem"); +StaticString PHPTransport::s_var("var"); +StaticString PHPTransport::s_type("type"); +StaticString PHPTransport::s_ktype("ktype"); +StaticString PHPTransport::s_vtype("vtype"); +StaticString PHPTransport::s_etype("etype"); + + IMPLEMENT_DEFAULT_EXTENSION(thrift_protocol); /////////////////////////////////////////////////////////////////////////////// @@ -76,7 +93,7 @@ Variant binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, return uninit_null(); case T_STRUCT: { Variant val; - if ((val = fieldspec.rvalAt(s_class)).isNull()) { + if ((val = fieldspec.rvalAt(PHPTransport::s_class)).isNull()) { throw_tprotocolexception("no class type in spec", INVALID_DATA); skip_element(T_STRUCT, transport); return uninit_null(); @@ -154,9 +171,9 @@ Variant binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, transport.readBytes(types, 2); uint32_t size = transport.readU32(); - Array keyspec = fieldspec.rvalAt(s_key, + Array keyspec = fieldspec.rvalAt(PHPTransport::s_key, AccessFlags::Error_Key).toArray(); - Array valspec = fieldspec.rvalAt(s_val, + Array valspec = fieldspec.rvalAt(PHPTransport::s_val, AccessFlags::Error_Key).toArray(); ret = Array::Create(); @@ -170,7 +187,8 @@ Variant binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, case T_LIST: { // array with autogenerated numeric keys int8_t type = transport.readI8(); uint32_t size = transport.readU32(); - Variant elemvar = fieldspec.rvalAt(s_elem, AccessFlags::Error_Key); + Variant elemvar = fieldspec.rvalAt(PHPTransport::s_elem, + AccessFlags::Error_Key); Array elemspec = elemvar.toArray(); ret = Array::Create(); @@ -186,7 +204,8 @@ Variant binary_deserialize(int8_t thrift_typeID, PHPInputTransport& transport, transport.readBytes(&type, 1); transport.readBytes(&size, 4); size = ntohl(size); - Variant elemvar = fieldspec.rvalAt(s_elem, AccessFlags::Error_Key); + Variant elemvar = fieldspec.rvalAt(PHPTransport::s_elem, + AccessFlags::Error_Key); Array elemspec = elemvar.toArray(); ret = Array::Create(); @@ -305,10 +324,10 @@ void binary_deserialize_spec(CObjRef zthis, PHPInputTransport& transport, Array fieldspec = val.toArray(); // pull the field name // zend hash tables use the null at the end in the length... so strlen(hash key) + 1. - String varname = fieldspec.rvalAt(s_var).toString(); + String varname = fieldspec.rvalAt(PHPTransport::s_var).toString(); // and the type - int8_t expected_ttype = fieldspec.rvalAt(s_type).toInt64(); + int8_t expected_ttype = fieldspec.rvalAt(PHPTransport::s_type).toInt64(); if (ttypes_are_compatible(ttype, expected_ttype)) { Variant rv = binary_deserialize(ttype, transport, fieldspec); @@ -373,14 +392,14 @@ void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, } return; case T_MAP: { Array ht = value.toArray(); - uint8_t keytype = fieldspec.rvalAt(s_ktype, + uint8_t keytype = fieldspec.rvalAt(PHPTransport::s_ktype, AccessFlags::Error_Key).toByte(); transport.writeI8(keytype); - uint8_t valtype = fieldspec.rvalAt(s_vtype, + uint8_t valtype = fieldspec.rvalAt(PHPTransport::s_vtype, AccessFlags::Error_Key).toByte(); transport.writeI8(valtype); - Array valspec = fieldspec.rvalAt(s_val, + Array valspec = fieldspec.rvalAt(PHPTransport::s_val, AccessFlags::Error_Key).toArray(); transport.writeI32(ht.size()); @@ -393,10 +412,10 @@ void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, Array ht = value.toArray(); Variant val; - uint8_t valtype = fieldspec.rvalAt(s_etype, + uint8_t valtype = fieldspec.rvalAt(PHPTransport::s_etype, AccessFlags::Error_Key).toInt64(); transport.writeI8(valtype); - Array valspec = fieldspec.rvalAt(s_elem, + Array valspec = fieldspec.rvalAt(PHPTransport::s_elem, AccessFlags::Error_Key).toArray(); transport.writeI32(ht.size()); for (ArrayIter key_ptr = ht.begin(); !key_ptr.end(); ++key_ptr) { @@ -406,7 +425,7 @@ void binary_serialize(int8_t thrift_typeID, PHPOutputTransport& transport, case T_SET: { Array ht = value.toArray(); - uint8_t keytype = fieldspec.rvalAt(s_etype, + uint8_t keytype = fieldspec.rvalAt(PHPTransport::s_etype, AccessFlags::Error_Key).toByte(); transport.writeI8(keytype); @@ -434,11 +453,11 @@ void binary_serialize_spec(CObjRef zthis, PHPOutputTransport& transport, Array fieldspec = key_ptr.second().toArray(); // field name - String varname = fieldspec.rvalAt(s_var, + String varname = fieldspec.rvalAt(PHPTransport::s_var, AccessFlags::Error_Key).toString(); // thrift type - int8_t ttype = fieldspec.rvalAt(s_type, + int8_t ttype = fieldspec.rvalAt(PHPTransport::s_type, AccessFlags::Error_Key).toByte(); Variant prop = zthis->o_get(varname, true, zthis->o_getClassName()); diff --git a/hphp/runtime/ext/thrift/compact.cpp b/hphp/runtime/ext/thrift/compact.cpp index 27676c4e0..ffdb2224a 100644 --- a/hphp/runtime/ext/thrift/compact.cpp +++ b/hphp/runtime/ext/thrift/compact.cpp @@ -223,9 +223,9 @@ class CompactWriter { Array fieldSpec = specIter.second().toArray(); String fieldName = fieldSpec - .rvalAt(s_var, AccessFlags::Error_Key).toString(); + .rvalAt(PHPTransport::s_var, AccessFlags::Error_Key).toString(); TType fieldType = (TType)fieldSpec - .rvalAt(s_type, AccessFlags::Error_Key).toByte(); + .rvalAt(PHPTransport::s_type, AccessFlags::Error_Key).toByte(); Variant fieldVal = obj->o_get(fieldName, true, obj->o_getClassName()); @@ -362,12 +362,14 @@ class CompactWriter { void writeMap(Array arr, CArrRef spec) { TType keyType = (TType)spec - .rvalAt(s_ktype, AccessFlags::Error_Key).toByte(); + .rvalAt(PHPTransport::s_ktype, AccessFlags::Error_Key).toByte(); TType valueType = (TType)spec - .rvalAt(s_vtype, AccessFlags::Error_Key).toByte(); + .rvalAt(PHPTransport::s_vtype, AccessFlags::Error_Key).toByte(); - Array keySpec = spec.rvalAt(s_key, AccessFlags::Error_Key).toArray(); - Array valueSpec = spec.rvalAt(s_val, AccessFlags::Error_Key).toArray(); + Array keySpec = spec.rvalAt(PHPTransport::s_key, AccessFlags::Error_Key) + .toArray(); + Array valueSpec = spec.rvalAt(PHPTransport::s_val, AccessFlags::Error_Key) + .toArray(); writeMapBegin(keyType, valueType, arr.size()); @@ -381,9 +383,9 @@ class CompactWriter { void writeList(Array arr, CArrRef spec, CListType listType) { TType valueType = (TType)spec - .rvalAt(s_etype, AccessFlags::Error_Key).toByte(); + .rvalAt(PHPTransport::s_etype, AccessFlags::Error_Key).toByte(); Array valueSpec = spec - .rvalAt(s_elem, AccessFlags::Error_Key).toArray(); + .rvalAt(PHPTransport::s_elem, AccessFlags::Error_Key).toArray(); writeListBegin(valueType, arr.size()); @@ -540,8 +542,9 @@ class CompactReader { if (!fieldSpecVariant.isNull()) { Array fieldSpec = fieldSpecVariant.toArray(); - String fieldName = fieldSpec.rvalAt(s_var).toString(); - TType expectedType = (TType)fieldSpec.rvalAt(s_type).toInt64(); + String fieldName = fieldSpec.rvalAt(PHPTransport::s_var).toString(); + auto expectedType = (TType)fieldSpec.rvalAt(PHPTransport::s_type) + .toInt64(); if (typesAreCompatible(fieldType, expectedType)) { readComplete = true; @@ -614,7 +617,7 @@ class CompactReader { return uninit_null(); case T_STRUCT: { - Variant className = spec.rvalAt(s_class); + Variant className = spec.rvalAt(PHPTransport::s_class); if (className.isNull()) { thrift_error("no class type in spec", ERR_INVALID_DATA); } @@ -784,8 +787,8 @@ class CompactReader { uint32_t size; readMapBegin(keyType, valueType, size); - Array keySpec = spec.rvalAt(s_key, AccessFlags::Error); - Array valueSpec = spec.rvalAt(s_val, AccessFlags::Error); + Array keySpec = spec.rvalAt(PHPTransport::s_key, AccessFlags::Error); + Array valueSpec = spec.rvalAt(PHPTransport::s_val, AccessFlags::Error); Variant ret = Array::Create(); for (uint32_t i = 0; i < size; i++) { @@ -803,7 +806,8 @@ class CompactReader { uint32_t size; readListBegin(valueType, size); - Array valueSpec = spec.rvalAt(s_elem, AccessFlags::Error_Key); + Array valueSpec = spec.rvalAt(PHPTransport::s_elem, + AccessFlags::Error_Key); Variant ret = Array::Create(); for (uint32_t i = 0; i < size; i++) { diff --git a/hphp/runtime/ext/thrift/transport.h b/hphp/runtime/ext/thrift/transport.h index 5c95e1358..bd526c31f 100644 --- a/hphp/runtime/ext/thrift/transport.h +++ b/hphp/runtime/ext/thrift/transport.h @@ -88,22 +88,23 @@ enum TType { }; -static StaticString s_getTransport("getTransport"); -static StaticString s_flush("flush"); -static StaticString s_write("write"); -static StaticString s_putBack("putBack"); -static StaticString s_read("read"); -static StaticString s_class("class"); -static StaticString s_key("key"); -static StaticString s_val("val"); -static StaticString s_elem("elem"); -static StaticString s_var("var"); -static StaticString s_type("type"); -static StaticString s_ktype("ktype"); -static StaticString s_vtype("vtype"); -static StaticString s_etype("etype"); - class PHPTransport { +public: + static StaticString s_getTransport; + static StaticString s_flush; + static StaticString s_write; + static StaticString s_putBack; + static StaticString s_read; + static StaticString s_class; + static StaticString s_key; + static StaticString s_val; + static StaticString s_elem; + static StaticString s_var; + static StaticString s_type; + static StaticString s_ktype; + static StaticString s_vtype; + static StaticString s_etype; + public: Object protocol() { return p; } Object transport() { return t; } diff --git a/hphp/runtime/vm/bytecode.h b/hphp/runtime/vm/bytecode.h index 5f912ade7..6a22c4be7 100644 --- a/hphp/runtime/vm/bytecode.h +++ b/hphp/runtime/vm/bytecode.h @@ -59,7 +59,7 @@ namespace HPHP { class ActRec; // max number of arguments for direct call to builtin -static const int kMaxBuiltinArgs = 5; +const int kMaxBuiltinArgs = 5; struct ExtraArgs : private boost::noncopyable { diff --git a/hphp/runtime/vm/class.cpp b/hphp/runtime/vm/class.cpp index bd0bf3238..69760882b 100644 --- a/hphp/runtime/vm/class.cpp +++ b/hphp/runtime/vm/class.cpp @@ -2272,7 +2272,7 @@ void Class::setInterfaces() { for (PreClass::InterfaceVec::const_iterator it = m_preClass->interfaces().begin(); it != m_preClass->interfaces().end(); ++it) { - ClassPtr cp = Unit::loadClass(*it); + auto cp = ClassPtr(Unit::loadClass(*it)); if (cp.get() == nullptr) { raise_error("Undefined interface: %s", (*it)->data()); } @@ -2302,7 +2302,7 @@ void Class::setUsedTraits() { for (PreClass::UsedTraitVec::const_iterator it = m_preClass->usedTraits().begin(); it != m_preClass->usedTraits().end(); it++) { - ClassPtr classPtr = Unit::loadClass(*it); + auto classPtr = ClassPtr(Unit::loadClass(*it)); if (classPtr.get() == nullptr) { raise_error("Trait '%s' not found", (*it)->data()); } diff --git a/hphp/runtime/vm/core_types.h b/hphp/runtime/vm/core_types.h index e1c8322c1..930b7efdf 100644 --- a/hphp/runtime/vm/core_types.h +++ b/hphp/runtime/vm/core_types.h @@ -135,9 +135,9 @@ enum Attr { AttrSkipFrame = (1 << 22), // X // }; -static inline Attr operator|(Attr a, Attr b) { return Attr((int)a | (int)b); } +inline Attr operator|(Attr a, Attr b) { return Attr((int)a | (int)b); } -static inline const char * attrToVisibilityStr(Attr attr) { +inline const char * attrToVisibilityStr(Attr attr) { return (attr & AttrPrivate) ? "private" : (attr & AttrProtected) ? "protected" : "public"; } diff --git a/hphp/runtime/vm/debugger_hook.h b/hphp/runtime/vm/debugger_hook.h index 2255753af..6b093ab04 100644 --- a/hphp/runtime/vm/debugger_hook.h +++ b/hphp/runtime/vm/debugger_hook.h @@ -55,7 +55,7 @@ void phpAddBreakPoint(const Unit* unit, Offset offset); void phpRemoveBreakPoint(const Unit* unit, Offset offset); // Is this thread being debugged? -static inline bool isDebuggerAttached() { +inline bool isDebuggerAttached() { return ThreadInfo::s_threadInfo.getNoCheck()-> m_reqInjectionData.getDebugger(); } diff --git a/hphp/runtime/vm/func.h b/hphp/runtime/vm/func.h index e4470e754..9f6188cdf 100644 --- a/hphp/runtime/vm/func.h +++ b/hphp/runtime/vm/func.h @@ -25,7 +25,7 @@ namespace HPHP { -static const int kNumFixedPrologues = 6; +const int kNumFixedPrologues = 6; typedef TypedValue*(*BuiltinFunction)(ActRec* ar); diff --git a/hphp/runtime/vm/hhbc.cpp b/hphp/runtime/vm/hhbc.cpp index 823b248a0..3e76b55f8 100644 --- a/hphp/runtime/vm/hhbc.cpp +++ b/hphp/runtime/vm/hhbc.cpp @@ -981,6 +981,42 @@ int instrSpToArDelta(const Opcode* opcode) { return delta; } +const MInstrInfo& getMInstrInfo(Op op) { + static const MInstrInfo mInstrInfo[] = { +#define MII(instr, attrs, bS, iS, vC, fN) \ + {MI_##instr##M, \ + {MIA_none, MIA_none, MInstrAttr((attrs) & MIA_base), \ + MInstrAttr((attrs) & MIA_base), MInstrAttr((attrs) & MIA_base), \ + MInstrAttr((attrs) & MIA_base), MInstrAttr((attrs) & MIA_base), \ + MIA_none, \ + MIA_none}, \ + {MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_intermediate), \ + MInstrAttr((attrs) & MIA_final)}, \ + unsigned(vC), bool((attrs) & MIA_new), bool((attrs) & MIA_final_get), \ + #instr}, + MINSTRS +#undef MII + }; + + switch (op) { +#define MII(instr_, attrs, bS, iS, vC, fN) \ + case Op##instr_##M: { \ + const MInstrInfo& mii = mInstrInfo[MI_##instr_##M]; \ + assert(mii.instr() == MI_##instr_##M); \ + return mii; \ + } + MINSTRS +#undef MII + default: not_reached(); + } +} + /////////////////////////////////////////////////////////////////////////////// } diff --git a/hphp/runtime/vm/hhbc.h b/hphp/runtime/vm/hhbc.h index 6e400feba..5bab8ef1a 100644 --- a/hphp/runtime/vm/hhbc.h +++ b/hphp/runtime/vm/hhbc.h @@ -65,7 +65,7 @@ union ArgUnion { #undef ARGTYPEVEC }; -static const Offset InvalidAbsoluteOffset = -1; +const Offset InvalidAbsoluteOffset = -1; enum FlavorDesc { NOV = 0, // None @@ -269,27 +269,6 @@ struct MInstrInfo { } }; -static const MInstrInfo mInstrInfo[] = { -#define MII(instr, attrs, bS, iS, vC, fN) \ - {MI_##instr##M, \ - {MIA_none, MIA_none, MInstrAttr((attrs) & MIA_base), \ - MInstrAttr((attrs) & MIA_base), MInstrAttr((attrs) & MIA_base), \ - MInstrAttr((attrs) & MIA_base), MInstrAttr((attrs) & MIA_base), MIA_none, \ - MIA_none}, \ - {MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_intermediate), \ - MInstrAttr((attrs) & MIA_final)}, \ - unsigned(vC), bool((attrs) & MIA_new), bool((attrs) & MIA_final_get), \ - #instr}, - MINSTRS -#undef MII -}; - inline bool memberCodeHasImm(MemberCode mc) { return mc == MEL || mc == MPL || mc == MET || mc == MPT || mc == MEI; } @@ -592,19 +571,7 @@ enum Op { Op_count }; -inline const MInstrInfo& getMInstrInfo(Op op) { - switch (op) { -#define MII(instr_, attrs, bS, iS, vC, fN) \ - case Op##instr_##M: { \ - const MInstrInfo& mii = mInstrInfo[MI_##instr_##M]; \ - assert(mii.instr() == MI_##instr_##M); \ - return mii; \ - } - MINSTRS -#undef MII - default: not_reached(); - } -} +const MInstrInfo& getMInstrInfo(Op op); enum AstubsOp { OpAstubStart = Op_count-1, @@ -725,7 +692,7 @@ ArgType immType(Opcode opcode, int idx); int immSize(const Opcode* opcode, int idx); bool immIsVector(Opcode opcode, int idx); bool hasImmVector(Opcode opcode); -static inline bool isTypePred(const Opcode op) { +inline bool isTypePred(const Opcode op) { return op >= OpIsNullC && op <= OpIsObjectL; } int instrLen(const Opcode* opcode); diff --git a/hphp/runtime/vm/instrumentation_hook.h b/hphp/runtime/vm/instrumentation_hook.h index 0659eee02..9585a052c 100644 --- a/hphp/runtime/vm/instrumentation_hook.h +++ b/hphp/runtime/vm/instrumentation_hook.h @@ -22,21 +22,21 @@ namespace HPHP { -static inline void instHookInt64Impl(InjectionTableInt64* table, int64_t val) { +inline void instHookInt64Impl(InjectionTableInt64* table, int64_t val) { if (!table) return; InjectionTableInt64::const_iterator it = table->find(val); if (LIKELY(it == table->end())) return; it->second->execute(); } -static inline void instHookInt64(int type, int64_t val) { +inline void instHookInt64(int type, int64_t val) { assert(type < InstHookTypeInt64Count); InjectionTableInt64* injTable = g_vmContext->m_injTables ? g_vmContext->m_injTables->getInt64Table(type) : nullptr; instHookInt64Impl(injTable, val); } -static inline void instHookSD(int type, const StringData* sd) { +inline void instHookSD(int type, const StringData* sd) { assert(type < InstHookTypeSDCount); InjectionTableSD* injTable = g_vmContext->m_injTables ? g_vmContext->m_injTables->getSDTable(type) : nullptr; @@ -46,7 +46,7 @@ static inline void instHookSD(int type, const StringData* sd) { it->second->execute(); } -static inline void instHookStr(int type, const char* str) { +inline void instHookStr(int type, const char* str) { StackStringData sd(str, AttachLiteral); instHookSD(type, &sd); } diff --git a/hphp/runtime/vm/php_debug.h b/hphp/runtime/vm/php_debug.h index 231bc3513..ad3a7e86d 100644 --- a/hphp/runtime/vm/php_debug.h +++ b/hphp/runtime/vm/php_debug.h @@ -23,7 +23,7 @@ namespace HPHP { bool phpBreakpointEnabled(const char* sourceName); #else -static inline bool phpBreakpointEnabled(const char* sourceName) { +inline bool phpBreakpointEnabled(const char* sourceName) { return false; } diff --git a/hphp/runtime/vm/runtime.h b/hphp/runtime/vm/runtime.h index a1d708cff..0b6164f14 100644 --- a/hphp/runtime/vm/runtime.h +++ b/hphp/runtime/vm/runtime.h @@ -182,7 +182,7 @@ Unit* build_native_class_unit(const HhbcExtClassInfo* builtinClasses, HphpArray* pack_args_into_array(ActRec* ar, int nargs); -static inline Instance* +inline Instance* newInstance(Class* cls) { assert(cls); auto* inst = Instance::newInstance(cls); diff --git a/hphp/runtime/vm/type_profile.h b/hphp/runtime/vm/type_profile.h index 9cd80fd12..b058948d9 100644 --- a/hphp/runtime/vm/type_profile.h +++ b/hphp/runtime/vm/type_profile.h @@ -50,7 +50,7 @@ std::pair predictType(TypeProfileKey key); bool isProfileOpcode(const PC& pc); extern __thread bool profileOn; -static inline bool shouldProfile() { +inline bool shouldProfile() { return profileOn; } diff --git a/hphp/util/atomic.h b/hphp/util/atomic.h index 49f9cb2ce..f1088bb8f 100644 --- a/hphp/util/atomic.h +++ b/hphp/util/atomic.h @@ -78,13 +78,13 @@ inline void atomic_release_store(T* address, U val) { } template -static inline T atomic_inc(T &count) { +inline T atomic_inc(T &count) { assert_address_is_atomically_accessible(&count); return __sync_fetch_and_add(&count, 1) + 1; } template -static inline T atomic_dec(T &count) { +inline T atomic_dec(T &count) { assert_address_is_atomically_accessible(&count); return __sync_fetch_and_add(&count, -1) - 1; } diff --git a/hphp/util/base.h b/hphp/util/base.h index 21f4469ca..4a325adb5 100644 --- a/hphp/util/base.h +++ b/hphp/util/base.h @@ -119,7 +119,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// // debugging -static const bool debug = +const bool debug = #ifdef DEBUG true #else @@ -127,7 +127,7 @@ static const bool debug = #endif ; -static const bool use_jemalloc = +const bool use_jemalloc = #ifdef USE_JEMALLOC true #else @@ -135,7 +135,7 @@ static const bool use_jemalloc = #endif ; -static const bool packed_tv = +const bool packed_tv = #ifdef PACKED_TV true #else @@ -146,7 +146,7 @@ static const bool packed_tv = /** * Guard bug-for-bug hphpi compatibility code with this predicate. */ -static const bool hphpiCompat = true; +const bool hphpiCompat = true; /////////////////////////////////////////////////////////////////////////////// // system includes diff --git a/hphp/util/hash.h b/hphp/util/hash.h index a2a9d4b80..930ad7c2e 100644 --- a/hphp/util/hash.h +++ b/hphp/util/hash.h @@ -63,7 +63,7 @@ namespace MurmurHash3 { // It is tempting to make useHash128 depend on whether the architecture is 32- // or 64-bit, but changing which hash function is used also requires // regenerating system files, so this setting is hardcoded here. -static const bool useHash128 = true; +const bool useHash128 = true; #define ROTL32(x,y) rotl32(x,y) #define ROTL64(x,y) rotl64(x,y) diff --git a/hphp/util/json.h b/hphp/util/json.h index 6374e0e78..9bd0cac33 100644 --- a/hphp/util/json.h +++ b/hphp/util/json.h @@ -68,8 +68,9 @@ private: std::string m_name; }; -struct _Null {}; -static _Null Null; +// struct _Null {}; +// _Null Null; +enum class Null {}; template class _OutputStream { @@ -101,7 +102,7 @@ public: return *this; } - _OutputStream &operator<< (const _Null &n) { + _OutputStream &operator<< (const Null &n) { m_out << "null"; return *this; } @@ -116,7 +117,7 @@ public: if (v) { *this << *v; } else { - *this << Null; + *this << Null(); } return *this; } diff --git a/hphp/util/smalllocks.h b/hphp/util/smalllocks.h index b7c840a44..15d0d8639 100644 --- a/hphp/util/smalllocks.h +++ b/hphp/util/smalllocks.h @@ -35,12 +35,12 @@ inline int futex(int* uaddr, int op, int val, const timespec* timeout, return syscall(SYS_futex, uaddr, op, val, timeout, uaddr2, val3); } -static void futex_wait(std::atomic* value, int expected) { +inline void futex_wait(std::atomic* value, int expected) { futex(reinterpret_cast(value), FUTEX_WAIT_PRIVATE, expected, nullptr, nullptr, 0); } -static void futex_wake(std::atomic* value, int nwake) { +inline void futex_wake(std::atomic* value, int nwake) { futex(reinterpret_cast(value), FUTEX_WAKE_PRIVATE, nwake, nullptr, nullptr, 0); } diff --git a/hphp/util/thread_local.h b/hphp/util/thread_local.h index 54e369287..fc12606d8 100644 --- a/hphp/util/thread_local.h +++ b/hphp/util/thread_local.h @@ -108,7 +108,7 @@ struct ThreadLocalManager { // delete template -static void ThreadLocalOnThreadExit(void * p) { +void ThreadLocalOnThreadExit(void * p) { ThreadLocalNode * pNode = (ThreadLocalNode*)p; delete pNode->m_p; pNode->m_p = nullptr; @@ -209,7 +209,7 @@ T *ThreadLocalNoCheck::getCheck() const { // Singleton thread-local storage for T template -static void ThreadLocalSingletonOnThreadExit(void *obj) { +void ThreadLocalSingletonOnThreadExit(void *obj) { T::OnThreadExit((T*)obj); } @@ -338,7 +338,7 @@ struct ThreadLocalProxy { // ThreadLocal allocates by calling new() without parameters template -static void ThreadLocalOnThreadExit(void *p) { +void ThreadLocalOnThreadExit(void *p) { delete (T*)p; } @@ -441,7 +441,7 @@ T *ThreadLocalNoCheck::getCheck() const { // Singleton thread-local storage for T template -static void ThreadLocalSingletonOnThreadExit(void *obj) { +void ThreadLocalSingletonOnThreadExit(void *obj) { T::OnThreadExit((T*)obj); free(obj); } diff --git a/hphp/util/trace.h b/hphp/util/trace.h index d45bf289b..5f6da5506 100644 --- a/hphp/util/trace.h +++ b/hphp/util/trace.h @@ -175,7 +175,7 @@ void traceRingBufferRelease(const char* fmt, ...); extern int levels[NumModules]; const char* moduleName(Module mod); -static inline bool moduleEnabledRelease(Module tm, int level = 1) { +inline bool moduleEnabledRelease(Module tm, int level = 1) { return levels[tm] >= level; } @@ -183,15 +183,15 @@ static inline bool moduleEnabledRelease(Module tm, int level = 1) { # ifndef USE_TRACE # define USE_TRACE 1 # endif -static inline bool moduleEnabled(Module tm, int level = 1) { +inline bool moduleEnabled(Module tm, int level = 1) { return moduleEnabledRelease(tm, level); } -static inline int moduleLevel(Module tm) { return levels[tm]; } +inline int moduleLevel(Module tm) { return levels[tm]; } #define HPHP_TRACE -static const bool enabled = true; +const bool enabled = true; #define ONTRACE_MOD(module, n, x) do { \ if (HPHP::Trace::moduleEnabled(module, n)) { \ @@ -217,7 +217,7 @@ void trace(const char *, ...) void trace(const std::string&); template -static inline void trace(Pretty p) { trace(p.pretty() + std::string("\n")); } +inline void trace(Pretty p) { trace(p.pretty() + std::string("\n")); } void vtrace(const char *fmt, va_list args); void dumpRingbuffer(); @@ -234,13 +234,13 @@ void dumpRingbuffer(); #define TRACE_SET_MOD(name) \ DEBUG_ONLY static const HPHP::Trace::Module TRACEMOD = HPHP::Trace::name; -static const bool enabled = false; +const bool enabled = false; -static inline void trace(const char*, ...) { } -static inline void trace(const std::string&) { } -static inline void vtrace(const char*, va_list) { } -static inline bool moduleEnabled(Module t, int level = 1) { return false; } -static inline int moduleLevel(Module tm) { return 0; } +inline void trace(const char*, ...) { } +inline void trace(const std::string&) { } +inline void vtrace(const char*, va_list) { } +inline bool moduleEnabled(Module t, int level = 1) { return false; } +inline int moduleLevel(Module tm) { return 0; } #endif /* } (defined(DEBUG) || defined(USE_TRACE)) */ ////////////////////////////////////////////////////////////////////// diff --git a/hphp/util/util.h b/hphp/util/util.h index 5cea696f1..a40133790 100644 --- a/hphp/util/util.h +++ b/hphp/util/util.h @@ -202,7 +202,7 @@ size_t dirname_helper(char *path, int len); * Check if value is a power of two. */ template -static inline bool isPowerOfTwo(Int value) { +inline bool isPowerOfTwo(Int value) { return (value > 0 && (value & (value-1)) == 0); } @@ -210,7 +210,7 @@ static inline bool isPowerOfTwo(Int value) { * Round up value to the nearest power of two */ template -static inline Int roundUpToPowerOfTwo(Int value) { +inline Int roundUpToPowerOfTwo(Int value) { #ifdef DEBUG (void) (0 / value); // fail for 0; ASSERT is a pain. #endif @@ -226,25 +226,25 @@ static inline Int roundUpToPowerOfTwo(Int value) { /** * Return log-base-2 of the next power of 2, i.e. CLZ */ -static inline int lgNextPower2(uint64_t value) { +inline int lgNextPower2(uint64_t value) { #ifdef DEBUG (void) (0 / value); // fail for 0; ASSERT is a pain. #endif return 64 - __builtin_clzll(value - 1); } -static inline int lgNextPower2(uint32_t value) { +inline int lgNextPower2(uint32_t value) { #ifdef DEBUG (void) (0 / value); // fail for 0; ASSERT is a pain. #endif return 32 - __builtin_clz(value - 1); } -static inline uint64_t nextPower2(uint64_t value) { +inline uint64_t nextPower2(uint64_t value) { return uint64_t(1) << lgNextPower2(value); } -static inline uint32_t nextPower2(uint32_t value) { +inline uint32_t nextPower2(uint32_t value) { return uint32_t(1) << lgNextPower2(value); } @@ -293,7 +293,7 @@ void find(std::vector &out, */ std::string format_pattern(const std::string &pattern, bool prefixSlash); -static inline void compiler_membar( ) { +inline void compiler_membar( ) { asm volatile("" : : :"memory"); } @@ -363,7 +363,7 @@ constexpr void* getMethodPtr(MethodPtr meth) { * Read typed data from an offset relative to a base address */ template -static T& getDataRef(void* base, unsigned offset) { +T& getDataRef(void* base, unsigned offset) { return *(T*)((char*)base + offset); }