update cybozulib

update-fork
MITSUNARI Shigeo 4 years ago
parent eca0e51959
commit d0e2d6ce15
  1. 5
      include/cybozu/atoi.hpp
  2. 1
      include/cybozu/exception.hpp
  3. 7
      include/cybozu/inttype.hpp
  4. 3
      include/cybozu/itoa.hpp

@ -7,7 +7,6 @@
*/
#include <memory.h>
#include <limits.h>
#include <limits>
#include <cybozu/exception.hpp>
@ -173,7 +172,7 @@ public:
}
inline operator int() const
{
return atoi_local::convertToInt<int>(b_, p_, size_, "2147483648", INT_MIN, 214748364, '8');
return atoi_local::convertToInt<int>(b_, p_, size_, "2147483648", /*INT_MIN*/-2147483648, 214748364, '8');
}
inline operator unsigned int() const
{
@ -181,7 +180,7 @@ public:
}
inline operator long long() const
{
return atoi_local::convertToInt<long long>(b_, p_, size_, "9223372036854775808", LLONG_MIN, 922337203685477580LL, '8');
return atoi_local::convertToInt<long long>(b_, p_, size_, "9223372036854775808", CYBOZU_LLONG_MIN, 922337203685477580LL, '8');
}
inline operator unsigned long long() const
{

@ -203,7 +203,6 @@ public:
}
/**
convert NativeErrNo to string(maybe UTF8)
@param err [in] errno
@note Linux : same as ConvertErrorNoToString
Windows : for Win32 API(use en-us)
*/

@ -72,6 +72,9 @@
#endif
#endif
// LLONG_MIN in limits.h is not defined in some env.
#define CYBOZU_LLONG_MIN (-9223372036854775807ll-1)
#define CYBOZU_CPP_VERSION_CPP03 0
#define CYBOZU_CPP_VERSION_TR1 1
#define CYBOZU_CPP_VERSION_CPP11 2
@ -88,7 +91,7 @@
#define CYBOZU_CPP_VERSION CYBOZU_CPP_VERSION_CPP17
#elif (__cplusplus >= 201402)
#define CYBOZU_CPP_VERSION CYBOZU_CPP_VERSION_CPP14
#elif (__cplusplus >= 201103) || (_MSC_VER >= 1500) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#elif (__cplusplus >= 201103) || (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if defined(_MSC_VER) && (_MSC_VER <= 1600)
#define CYBOZU_CPP_VERSION CYBOZU_CPP_VERSION_TR1
#else
@ -150,8 +153,10 @@
#if CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11
#define CYBOZU_NOEXCEPT noexcept
#define CYBOZU_NULLPTR nullptr
#else
#define CYBOZU_NOEXCEPT throw()
#define CYBOZU_NULLPTR 0
#endif
namespace cybozu {
template<class T>

@ -5,7 +5,6 @@
@author MITSUNARI Shigeo(@herumi)
*/
#include <limits.h>
#ifndef CYBOZU_DONT_USE_STRING
#include <string>
#endif
@ -122,7 +121,7 @@ size_t uintToBin(char *buf, size_t bufSize, UT x)
template<class T>
size_t intToDec(char *buf, size_t bufSize, T x)
{
if (x == LLONG_MIN) {
if (x == CYBOZU_LLONG_MIN) {
const char minStr[] = "-9223372036854775808";
const size_t minStrLen = sizeof(minStr) - 1;
if (bufSize < minStrLen) {

Loading…
Cancel
Save