const up dtoa

Change-Id: I514daf4449a3052f7d469dbfaceb95ea3207af8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187787
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2025-07-13 11:28:49 +02:00
parent c64c74b287
commit 3b810d4aa9
2 changed files with 57 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,dtoa, \
external/dtoa/coverity.patch \
external/dtoa/ubsan.patch.0 \
external/dtoa/C6011.patch.0 \
external/dtoa/const.patch \
))
# vim: set noet sw=4 ts=4:
+56
View File
@@ -0,0 +1,56 @@
--- dtoa/src/dtoa.c.const
+++ dtoa/src/dtoa.c
@@ -371,7 +371,7 @@
#ifdef SET_INEXACT
#define dtoa_divmax 27
#else
-int dtoa_divmax = 2; /* Permit experimenting: on some systems, 64-bit integer */
+const int dtoa_divmax = 2; /* Permit experimenting: on some systems, 64-bit integer */
/* division is slow enough that we may sometimes want to */
/* avoid using it. We assume (but do not check) that */
/* dtoa_divmax <= 27.*/
@@ -382,7 +382,7 @@
int e; /* number represented = b * 2^e, with .5 <= b < 1 */
} BF96;
- static BF96 pten[667] = {
+ static const BF96 pten[667] = {
{ 0xeef453d6, 0x923bd65a, 0x113faa29, -1136 },
{ 0x9558b466, 0x1b6565f8, 0x4ac7ca59, -1132 },
{ 0xbaaee17f, 0xa23ebf76, 0x5d79bcf0, -1129 },
@@ -1262,7 +1262,7 @@
641, 642, 642, 642, 643, 643, 643, 644, 644, 644,
644, 645, 645, 645, 646, 646, 646, 647, 647, 647,
647, 648, 648, 648, 649, 649, 649, 650, 650 };
- static ULLong pfive[27] = {
+ static const ULLong pfive[27] = {
5ll,
25ll,
125ll,
@@ -1928,7 +1928,7 @@
ThInfo *TI;
#endif
int i;
- static int p05[3] = { 5, 25, 125 };
+ static const int p05[3] = { 5, 25, 125 };
if ((i = k & 3))
b = multadd(b, p05[i-1], 0 MTa);
@@ -2500,7 +2500,7 @@
htinit(hexdig, USC "ABCDEF", 0x10 + 10);
}
#else
-static unsigned char hexdig[256] = {
+static const unsigned char hexdig[256] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -5013,7 +5013,7 @@
int inexact, oldinexact;
#endif
#ifdef USE_BF96 /*{{*/
- BF96 *p10;
+ const BF96 *p10;
ULLong dbhi, dbits, dblo, den, hb, rb, rblo, res, res0, res3, reslo, sres,
sulp, tv0, tv1, tv2, tv3, ulp, ulplo, ulpmask, ures, ureslo, zb;
int eulp, k1, n2, ulpadj, ulpshift;