]> granicus.if.org Git - graphviz/commitdiff
lefty: remove unnecessary casts of char* members
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Sep 2021 02:14:20 +0000 (19:14 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 27 Sep 2021 14:45:28 +0000 (07:45 -0700)
cmd/lefty/aix_mods/tbl.c
cmd/lefty/code.c
cmd/lefty/code.h
cmd/lefty/tbl.c

index 5b99e0a82025a35b2465892e3b8bfd5fe45c5e40..7713088b923a66d637e8eff83a0afa6adb2437f9 100644 (file)
@@ -175,7 +175,7 @@ Tobj Tcode(Code_t * cp, int ci, int cl)
            cp2[i] = cp[i];
            if (cp2[i].next != C_NULL)
                cp2[i].next -= ci;
-           s = (char *) &cp[i].u.s;
+           s = &cp[i].u.s;
            while (*s)
                s++;
            cn = (long) (s - (char *) &cp[i]) / sizeof(Code_t);
index d8d576b3d41f91dd28950987c4188f1fe309458d..234b2f16aaaa52f0daefd79611d282b888be461c 100644 (file)
@@ -27,7 +27,7 @@ void Cinit (void) {
     cbufp = Marrayalloc(CBUFINCR * CBUFSIZE);
     cbufn = CBUFINCR;
     cbufi = 0;
-    Cstringoffset = (char *) &c.u.s[0] - (char *) &c + 1;
+    Cstringoffset = &c.u.s[0] - (char *)&c + 1;
     /* the + 1 above accounts for the null character */
 }
 
@@ -93,7 +93,7 @@ int Cstring (char *s) {
     }
     i = cbufi, cbufi += size;
     cbufp[i].ctype = C_STRING;
-    strcpy ((char *) &cbufp[i].u.s[0], s);
+    strcpy(&cbufp[i].u.s[0], s);
     cbufp[i].next = C_NULL;
     return i;
 }
index f09861edb4dbd4120e1188a2897263be91e9b4fc..0ea6fe65854f27203219e13d48505b6be7ccf90a 100644 (file)
@@ -70,7 +70,7 @@ typedef struct Code_t {
 } Code_t;
 #define C_CODESIZE sizeof (Code_t)
 
-#define Cgetstring(i) (char *) &cbufp[i].u.s[0]
+#define Cgetstring(i) &cbufp[i].u.s[0]
 #define Cgetindex() cbufi
 
 #define Csettype(a, b) cbufp[a].ctype = b
index 87def11722c60293fe9f6b1d64d749beb5bec534..54ac4ed08c2cf6f95b3e355f51d8c321cbb635a7 100644 (file)
@@ -170,7 +170,7 @@ Tobj Tcode (Code_t *cp, int ci, int cl) {
             cp2[i] = cp[i];
             if (cp2[i].next != C_NULL)
                 cp2[i].next -= ci;
-            s = (char *) &cp[i].u.s;
+            s = &cp[i].u.s;
             while (*s)
                 s++;
             cn = (long) (s - (char *) &cp[i]) / sizeof (Code_t);