cast to intptr_t not size_t

This commit is contained in:
Christoph Reiter
2023-02-11 11:19:08 +01:00
parent 22eddbd3e0
commit 0936dbd270
2 changed files with 4 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ sha256sums=('8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313'
'SKIP'
'2f08ca8681e4c85cdb2e6835921a502fd623dee4bf8ca10aa3c66747ede58a47'
'89d5c0f666e50a0186cfb142ba7b77e8fe1ac4d65bdfd9ae14ae8d2f0045a87c'
'd722fd6851466ed9b81880c1a2cf9b0eaeec34b16dbd8463ff49cd0588ca7fab'
'6b6e2393840f4dc6067587165777b1a07978f4c05247d7c1010a45ad251bbeeb'
'56e7ec406bf42eb66b1d972f20d229f7a76ba00c38c7b4403bf348875704baae')
validpgpkeys=('9001B85AF9E1B83DF1BDA942F5BE8B267C6A406D') # "Bruno Haible (Open Source Development) <bruno@clisp.org>"
options=('!libtool' 'staticlibs')

View File

@@ -7,7 +7,7 @@
#define stringpool2 ((const char *) &stringpool2_contents)
static const struct alias sysdep_aliases[] = {
-#define S(tag,name,encoding_index) { (int)(long)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
+#define S(tag,name,encoding_index) { (intptr_t)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
+#define S(tag,name,encoding_index) { (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
#include "aliases2.h"
#undef S
};
@@ -21,7 +21,7 @@
}
}
- fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(long)\\&((struct stringpool_t *)0)->\\1,|'\n");
+ fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(size_t)\\&((struct stringpool_t *)0)->\\1,|'\n");
+ fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(intptr_t)\\&((struct stringpool_t *)0)->\\1,|'\n");
for (; n > 0; names++, n--)
emit_alias(out1, *names, c_name);
}
@@ -31,7 +31,7 @@
static void emit_encoding (FILE* out1, FILE* out2, const char* tag, const char* const* names, size_t n, const char* c_name)
{
- fprintf(out2," (int)(long)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter);
+ fprintf(out2," (int)(size_t)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter);
+ fprintf(out2," (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter);
for (; n > 0; names++, n--)
emit_alias(out1, tag, *names, c_name);
}