try to replace ssize_t occurrences with std::ptrdiff_t (for #204)
This commit is contained in:
parent
1cc4717582
commit
4cc4b26dd2
2 changed files with 6 additions and 32 deletions
19
src/json.hpp
19
src/json.hpp
|
@ -34,25 +34,12 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// enable ssize_t on MinGW
|
||||
#ifdef __GNUC__
|
||||
#ifdef __MINGW32__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// disable float-equal warnings on GCC/clang
|
||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#endif
|
||||
|
||||
// enable ssize_t for MSVC
|
||||
#ifdef _MSC_VER
|
||||
#include <basetsd.h>
|
||||
using ssize_t = SSIZE_T;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
|
@ -7983,9 +7970,9 @@ basic_json_parser_63:
|
|||
return;
|
||||
}
|
||||
|
||||
const ssize_t offset_start = m_start - m_content;
|
||||
const ssize_t offset_marker = m_marker - m_start;
|
||||
const ssize_t offset_cursor = m_cursor - m_start;
|
||||
const std::ptrdiff_t offset_start = m_start - m_content;
|
||||
const std::ptrdiff_t offset_marker = m_marker - m_start;
|
||||
const std::ptrdiff_t offset_cursor = m_cursor - m_start;
|
||||
|
||||
m_buffer.erase(0, static_cast<size_t>(offset_start));
|
||||
std::string line;
|
||||
|
|
|
@ -34,25 +34,12 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// enable ssize_t on MinGW
|
||||
#ifdef __GNUC__
|
||||
#ifdef __MINGW32__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// disable float-equal warnings on GCC/clang
|
||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#endif
|
||||
|
||||
// enable ssize_t for MSVC
|
||||
#ifdef _MSC_VER
|
||||
#include <basetsd.h>
|
||||
using ssize_t = SSIZE_T;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@brief namespace for Niels Lohmann
|
||||
@see https://github.com/nlohmann
|
||||
|
@ -7293,9 +7280,9 @@ class basic_json
|
|||
return;
|
||||
}
|
||||
|
||||
const ssize_t offset_start = m_start - m_content;
|
||||
const ssize_t offset_marker = m_marker - m_start;
|
||||
const ssize_t offset_cursor = m_cursor - m_start;
|
||||
const std::ptrdiff_t offset_start = m_start - m_content;
|
||||
const std::ptrdiff_t offset_marker = m_marker - m_start;
|
||||
const std::ptrdiff_t offset_cursor = m_cursor - m_start;
|
||||
|
||||
m_buffer.erase(0, static_cast<size_t>(offset_start));
|
||||
std::string line;
|
||||
|
|
Loading…
Reference in a new issue