Created
January 8, 2016 07:44
-
-
Save Timer/84cf3798b568136a4745 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
template<typename T> | |
inline uint32_t pack_big_uint32(T a, T b, T c, T d) { | |
return static_cast<uint32_t>( | |
static_cast<uint8_t>(d) | static_cast<uint8_t>(c) << 8 | | |
static_cast<uint8_t>(b) << 16 | static_cast<uint8_t>(a) << 24 | |
); | |
} | |
template<typename T> | |
inline int32_t pack_big_int32(T a, T b, T c, T d) { | |
return static_cast<int32_t>(pack_big_uint32(a, b, c, d)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment