add makeint64 high32 low32 function

This commit is contained in:
aozhiwei 2018-11-19 14:59:44 +08:00
parent e62be6c99f
commit ce7b882956
2 changed files with 20 additions and 0 deletions

View File

@ -163,4 +163,20 @@ namespace a8
strftime(buff, a8::ArraySize(buff), "%F %T", &tm_time);
return std::string(buff);
}
long long MakeInt64(int low32, int high32)
{
return low32 + ((long long)high32 >> 32);
}
int Low32(long long int64_val)
{
return (int)int64_val;
}
int High32(long long int64_val)
{
return (int)(int64_val << 32);
}
}

View File

@ -65,6 +65,10 @@ namespace a8
std::string GetIpAddress(unsigned long ip_saddr);
std::string FormatDateTime(time_t time_val);
long long MakeInt64(int low32, int high32);
int Low32(long long int64_val);
int High32(long long int64_val);
}
#endif