head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.38 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.36 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.34 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.32 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.30 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.28 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.26 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.24 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.22 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.20 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.18 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.16 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.14 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.12 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.10 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.8 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.6 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.4 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.2 pkgsrc-2021Q3-base:1.1; locks; strict; comment @// @; 1.1 date 2021.08.03.21.04.36; author markd; state Exp; branches; next ; commitid zgriEB08Qe99kz3D; desc @@ 1.1 log @qt5-qtwebengine: add version 5.15.2nb1 Chromium-based web engine for Qt5 @ text @$NetBSD$ --- src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp.orig 2020-07-15 19:01:39.000000000 +0000 +++ src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp @@@@ -87,6 +87,103 @@@@ constexpr const wchar_t* kDateFormats[] constexpr const wchar_t* kTimeFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; +#if defined(__FreeBSD__) || defined(__NetBSD__) +/* + * cvt.c - IEEE floating point formatting routines for FreeBSD + * from GNU libc-4.6.27 + */ + +/* + * ap_ecvt converts to decimal + * the number of digits is specified by ndigit + * decpt is set to the position of the decimal point + * sign is set to 0 for positive, 1 for negative + */ + +#define NDIG 80 + +static char * + ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag) +{ + register int r2; + double fi, fj; + register char *p, *p1; + static char buf[NDIG]; + + if (ndigits >= NDIG - 1) + ndigits = NDIG - 2; + r2 = 0; + *sign = 0; + p = &buf[0]; + if (arg < 0) { + *sign = 1; + arg = -arg; + } + arg = modf(arg, &fi); + p1 = &buf[NDIG]; + /* + * Do integer part + */ + if (fi != 0) { + p1 = &buf[NDIG]; + while (fi != 0) { + fj = modf(fi / 10, &fi); + *--p1 = (int) ((fj + .03) * 10) + '0'; + r2++; + } + while (p1 < &buf[NDIG]) + *p++ = *p1++; + } + else if (arg > 0) { + while ((fj = arg * 10) < 1) { + arg = fj; + r2--; + } + } + p1 = &buf[ndigits]; + if (eflag == 0) + p1 += r2; + *decpt = r2; + if (p1 < &buf[0]) { + buf[0] = '\0'; + return (buf); + } + while (p <= p1 && p < &buf[NDIG]) { + arg *= 10; + arg = modf(arg, &fj); + *p++ = (int) fj + '0'; + } + if (p1 >= &buf[NDIG]) { + buf[NDIG - 1] = '\0'; + return (buf); + } + p = p1; + *p1 += 5; + while (*p1 > '9') { + *p1 = '0'; + if (p1 > buf) + ++ * --p1; + else { + *p1 = '1'; + (*decpt)++; + if (eflag == 0) { + if (p > buf) + *p = '0'; + p++; + } + } + } + *p = '\0'; + return (buf); +} + +static char * + fcvt(double arg, int ndigits, int *decpt, int *sign) +{ + return (ap_cvt(arg, ndigits, decpt, sign, 0)); +} +#endif // defined(__FreeBSD__) + template T StrTrim(const T& str) { T result = str; @