1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
$NetBSD: patch-ba,v 1.2 2015/12/29 23:34:52 dholland Exp $
Use intptr_t instead of int for pointer-sized ints.
--- rts/misc.c.orig 2005-03-02 13:56:52.000000000 +0000
+++ rts/misc.c
@@ -1,6 +1,7 @@
/* misc.c -- miscellaneous routines supporting the generated code */
#include <stdarg.h>
+#include <stdint.h>
#include "rts.h"
@@ -24,7 +25,7 @@ mpd_cat (String *slist, ...)
n = 0; /* total the string lengths */
va_start (ap, slist);
for (s = slist; s != NULL; s = va_arg (ap, String *))
- if ((int) s & 1)
+ if ((intptr_t) s & 1)
n++; /* char argument */
else
n += s->length; /* String argument */
@@ -37,8 +38,8 @@ mpd_cat (String *slist, ...)
p = DATA (t);
va_start (ap, slist);
for (s = slist; s != NULL; s = va_arg (ap, String *))
- if ((int) s & 1) { /* for each input string: */
- *p++ = (int) s >> 2; /* copy in char argument */
+ if ((intptr_t) s & 1) { /* for each input string: */
+ *p++ = (intptr_t) s >> 2; /* copy in char argument */
} else {
memcpy (p, DATA (s), s->length); /* copy into new string */
p += s->length; /* advance pointer*/
|