]> granicus.if.org Git - graphviz/commitdiff
sfoutput: squash a -Wpointer-to-int-cast warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 20 Nov 2021 06:21:45 +0000 (22:21 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Nov 2021 15:47:40 +0000 (07:47 -0800)
lib/sfio/sfwr.c

index ea91860daec71c6a8dc400057adeca0ce44c6b8c..368309180b001d8afb4ffed1dd84925ddb371ba4 100644 (file)
@@ -10,6 +10,7 @@
 
 #include       <sfio/sfhdr.h>
 #include       <stddef.h>
+#include       <stdint.h>
 
 /*     Write with discipline.
 **
@@ -33,7 +34,7 @@ static ssize_t sfoutput(Sfio_t * f, char *buf, size_t n)
            while ((ssize_t) n >= _Sfpage) {    /* see if a hole of 0's starts here */
                sp = buf + 1;
                if (buf[0] == 0 && buf[_Sfpage - 1] == 0) {     /* check byte at a time until int-aligned */
-                   while (((ulong) sp) % sizeof(int)) {
+                   while ((uintptr_t)sp % sizeof(int)) {
                        if (*sp != 0)
                            goto chk_hole;
                        sp += 1;