Skip to content

Cleanup jeaiii-ltoa to not need pragmas #783

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

Merged
merged 1 commit into from
Apr 7, 2025
Merged
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
20 changes: 3 additions & 17 deletions ext/json/ext/vendor/jeaiii-ltoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ SOFTWARE.
typedef uint_fast32_t u32_t;
typedef uint_fast64_t u64_t;

#if defined __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#elif defined __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-braces"
#endif

#define u32(x) ((u32_t)(x))
#define u64(x) ((u64_t)(x))

Expand Down Expand Up @@ -93,7 +85,7 @@ jeaiii_ultoa(char *b, u64_t n)

if (n < u32(1e6)) {
if (n < u32(1e4)) {
u32_t f0 = u32(10 * (1 << 24) / 1e3 + 1) * n;
u32_t f0 = u32((10 * (1 << 24) / 1e3 + 1) * n);
COPY(b, digits_fd[f0 >> 24]);

b -= n < u32(1e3);
Expand Down Expand Up @@ -163,7 +155,7 @@ jeaiii_ultoa(char *b, u64_t n)
}
else if (u < u32(1e6)) {
if (u < u32(1e4)) {
u32_t f0 = u32(10 * (1 << 24) / 1e3 + 1) * u;
u32_t f0 = u32((10 * (1 << 24) / 1e3 + 1) * u);
COPY(b, digits_fd[f0 >> 24]);

b -= u < u32(1e3);
Expand Down Expand Up @@ -228,7 +220,7 @@ jeaiii_ultoa(char *b, u64_t n)
b += 2;
}
else {
u32_t f0 = u32(10 * (1 << 24) / 1e3 + 1) * u;
u32_t f0 = u32((10 * (1 << 24) / 1e3 + 1) * u);
COPY(b, digits_fd[f0 >> 24]);

b -= u < u32(1e3);
Expand Down Expand Up @@ -272,10 +264,4 @@ jeaiii_ultoa(char *b, u64_t n)
#undef u64
#undef COPY

#if defined __clang__
#pragma clang diagnostic pop
#elif defined __GNUC__
#pragma GCC diagnostic pop
#endif

#endif // JEAIII_TO_TEXT_H_