mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Update flatbuffers to v22.9.29 (#26)
* update flatbuffers files How: - Copied files in from the latest release (v22.9.29) of flatbuffers Why: - The files in place blocked compilation within Alpine Linux Links: - https://github.com/felt/tippecanoe/issues/24 - https://github.com/google/flatbuffers/releases/tag/v22.9.29 * update flatgeobuf generate files How - Created `feature_generated.h` & `header_generated.h` using the `src/fbs` files from the latest release (3.23.1) of flatgeobuf - Downloaded the `flatc` binary from the v22.9.29 release of flatbuffers - Copied `flatc` into the flatgeobuf repository - Created a new directory named `out` to collect the generated files - `./flatc --cpp -o out -I include src/fbs/feature.fbs` - `./flatc --cpp -o out -I include src/fbs/header.fbs` - Moved the generate files from `out` into this repository's `flatgeobuf` directory Why - This is a required step in the process of updating flatbuffers files Links - https://github.com/flatgeobuf/flatgeobuf/releases/tag/3.23.1 - https://github.com/google/flatbuffers/releases/tag/v22.9.29 - https://github.com/felt/tippecanoe/issues/24#issuecomment-1286476550
This commit is contained in:
+32
-5
@@ -17,19 +17,20 @@
|
||||
#ifndef FLATBUFFERS_UTIL_H_
|
||||
#define FLATBUFFERS_UTIL_H_
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/stl_emulation.h"
|
||||
|
||||
#ifndef FLATBUFFERS_PREFER_PRINTF
|
||||
# include <iomanip>
|
||||
# include <sstream>
|
||||
#else // FLATBUFFERS_PREFER_PRINTF
|
||||
# include <float.h>
|
||||
# include <stdio.h>
|
||||
#endif // FLATBUFFERS_PREFER_PRINTF
|
||||
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
|
||||
namespace flatbuffers {
|
||||
@@ -94,7 +95,7 @@ template<typename T> size_t IntToDigitCount(T t) {
|
||||
// Count a single 0 left of the dot for fractional numbers
|
||||
if (-1 < t && t < 1) digit_count++;
|
||||
// Count digits until fractional part
|
||||
T eps = std::numeric_limits<float>::epsilon();
|
||||
T eps = std::numeric_limits<T>::epsilon();
|
||||
while (t <= (-1 + eps) || (1 - eps) <= t) {
|
||||
t /= 10;
|
||||
digit_count++;
|
||||
@@ -254,7 +255,7 @@ inline void strtoval_impl(double *val, const char *str, char **endptr) {
|
||||
}
|
||||
|
||||
// UBSAN: double to float is safe if numeric_limits<float>::is_iec559 is true.
|
||||
__supress_ubsan__("float-cast-overflow")
|
||||
__suppress_ubsan__("float-cast-overflow")
|
||||
inline void strtoval_impl(float *val, const char *str, char **endptr) {
|
||||
*val = __strtof_impl(str, endptr);
|
||||
}
|
||||
@@ -447,6 +448,9 @@ std::string StripPath(const std::string &filepath);
|
||||
// Strip the last component of the path + separator.
|
||||
std::string StripFileName(const std::string &filepath);
|
||||
|
||||
std::string StripPrefix(const std::string &filepath,
|
||||
const std::string &prefix_to_remove);
|
||||
|
||||
// Concatenates a path with a filename, regardless of whether the path
|
||||
// ends in a separator or not.
|
||||
std::string ConCatPathFileName(const std::string &path,
|
||||
@@ -681,8 +685,31 @@ bool SetGlobalTestLocale(const char *locale_name,
|
||||
bool ReadEnvironmentVariable(const char *var_name,
|
||||
std::string *_value = nullptr);
|
||||
|
||||
// MSVC specific: Send all assert reports to STDOUT to prevent CI hangs.
|
||||
void SetupDefaultCRTReportMode();
|
||||
enum class Case {
|
||||
kUnknown = 0,
|
||||
// TheQuickBrownFox
|
||||
kUpperCamel = 1,
|
||||
// theQuickBrownFox
|
||||
kLowerCamel = 2,
|
||||
// the_quick_brown_fox
|
||||
kSnake = 3,
|
||||
// THE_QUICK_BROWN_FOX
|
||||
kScreamingSnake = 4,
|
||||
// THEQUICKBROWNFOX
|
||||
kAllUpper = 5,
|
||||
// thequickbrownfox
|
||||
kAllLower = 6,
|
||||
// the-quick-brown-fox
|
||||
kDasher = 7,
|
||||
// THEQuiCKBr_ownFox (or whatever you want, we won't change it)
|
||||
kKeep = 8,
|
||||
// the_quick_brown_fox123 (as opposed to the_quick_brown_fox_123)
|
||||
kSnake2 = 9,
|
||||
};
|
||||
|
||||
// Convert the `input` string of case `input_case` to the specified `output_case`.
|
||||
std::string ConvertCase(const std::string &input, Case output_case,
|
||||
Case input_case = Case::kSnake);
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user