Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced ssize_t occurrences with auto (addresses #204) #205

Merged
merged 2 commits into from
Feb 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -7983,9 +7970,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 auto offset_start = m_start - m_content;
const auto offset_marker = m_marker - m_start;
const auto offset_cursor = m_cursor - m_start;

m_buffer.erase(0, static_cast<size_t>(offset_start));
std::string line;
Expand Down
19 changes: 3 additions & 16 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 auto offset_start = m_start - m_content;
const auto offset_marker = m_marker - m_start;
const auto offset_cursor = m_cursor - m_start;

m_buffer.erase(0, static_cast<size_t>(offset_start));
std::string line;
Expand Down