summaryrefslogtreecommitdiff
path: root/util/hex.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/hex.h')
-rw-r--r--util/hex.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/hex.h b/util/hex.h
index 45a08f4..8cf30f2 100644
--- a/util/hex.h
+++ b/util/hex.h
@@ -30,15 +30,15 @@ namespace mongo {
return 0xff;
}
inline char fromHex( const char *c ) {
- return ( fromHex( c[ 0 ] ) << 4 ) | fromHex( c[ 1 ] );
+ return (char)(( fromHex( c[ 0 ] ) << 4 ) | fromHex( c[ 1 ] ));
}
- inline string toHex(const void* inRaw, int len){
+ inline string toHex(const void* inRaw, int len) {
static const char hexchars[] = "0123456789ABCDEF";
StringBuilder out;
const char* in = reinterpret_cast<const char*>(inRaw);
- for (int i=0; i<len; ++i){
+ for (int i=0; i<len; ++i) {
char c = in[i];
char hi = hexchars[(c & 0xF0) >> 4];
char lo = hexchars[(c & 0x0F)];
@@ -48,13 +48,13 @@ namespace mongo {
return out.str();
}
-
- inline string toHexLower(const void* inRaw, int len){
+
+ inline string toHexLower(const void* inRaw, int len) {
static const char hexchars[] = "0123456789abcdef";
StringBuilder out;
const char* in = reinterpret_cast<const char*>(inRaw);
- for (int i=0; i<len; ++i){
+ for (int i=0; i<len; ++i) {
char c = in[i];
char hi = hexchars[(c & 0xF0) >> 4];
char lo = hexchars[(c & 0x0F)];