]> granicus.if.org Git - graphviz/commitdiff
add some explicit casts
authorellson <devnull@localhost>
Tue, 1 Feb 2011 20:30:32 +0000 (20:30 +0000)
committerellson <devnull@localhost>
Tue, 1 Feb 2011 20:30:32 +0000 (20:30 +0000)
lib/cgraph/agerror.c
lib/graph/agxbuf.c
lib/graph/graph.c
lib/graph/graphio.c
lib/graph/lexer.c

index 35841de5ca45ecc960df49877eb89bfd6b7cb22e..12236e7b5103e73e863797f1105b723d6de3dc15 100644 (file)
@@ -37,7 +37,7 @@ char *aglasterr()
     fflush(agerrout);
     endpos = ftell(agerrout);
     len = endpos - aglast;
-    buf = malloc(len + 1);
+    buf = (char*)malloc(len + 1);
     fseek(agerrout, aglast, SEEK_SET);
     fread(buf, sizeof(char), len, agerrout);
     buf[len] = '\0';
index ae625671a7cda76436d78a3527f18976e2e1f7b0..db983fdd4ac2b4822783b841a58871130e34e250 100644 (file)
@@ -54,7 +54,7 @@ int agxbmore(agxbuf * xb, unsigned int ssz)
        nsize = size + ssz;
     cnt = xb->ptr - xb->buf;
     if (xb->dyna) {
-       nbuf = realloc(xb->buf, nsize);
+       nbuf = (unsigned char*)realloc(xb->buf, nsize);
     } else {
        nbuf = N_GNEW(nsize, unsigned char);
        memcpy(nbuf, xb->buf, cnt);
index f842b899c5baf90b9d4458ae02b609560a5ba192..861512a1f72ae1ec30b8043a2bacc8c422bf8212 100644 (file)
@@ -412,13 +412,13 @@ void aginsert(Agraph_t * g, void *obj)
 {
     switch (TAG_OF(obj)) {
     case TAG_NODE:
-       agINSnode(g, obj);
+       agINSnode(g, (Agnode_t*)obj);
        break;
     case TAG_EDGE:
-       agINSedge(g, obj);
+       agINSedge(g, (Agedge_t*)obj);
        break;
     case TAG_GRAPH:
-       agINSgraph(g, obj);
+       agINSgraph(g, (Agraph_t*)obj);
        break;
     }
 }
@@ -427,13 +427,13 @@ void agdelete(Agraph_t * g, void *obj)
 {
     switch (TAG_OF(obj)) {
     case TAG_NODE:
-       agDELnode(g, obj);
+       agDELnode(g, (Agnode_t*)obj);
        break;
     case TAG_EDGE:
-       agDELedge(g, obj);
+       agDELedge(g, (Agedge_t*)obj);
        break;
     case TAG_GRAPH:
-       agclose(obj);
+       agclose((Agraph_t*)obj);
        break;
     }
 }
index 34f8e262ed77a1192cbe98bf290aafc16b37be99..9fdfc2cc732957153ab9a3c8d3ab5d0babd3ff20 100644 (file)
@@ -226,9 +226,9 @@ static char *getoutputbuffer(char *str)
     req = MAX(2 * strlen(str) + 2, BUFSIZ);
     if (req > len) {
        if (rv)
-           rv = realloc(rv, req);
+           rv = (char*)realloc(rv, req);
        else
-           rv = malloc(req);
+           rv = (char*)malloc(req);
        len = req;
     }
     return rv;
index 7a83a334818ca439a188c3524b53708fa7144aed..94206526b9e3d853bf9901829a76e9b54003aca1 100644 (file)
@@ -247,8 +247,8 @@ static char *lex_gets(void)
        /* make sure there is room for at least another SMALLBUF worth */
        if (curlen + SMALLBUF >= LineBufSize) {
            LineBufSize += BUFSIZ;
-           AG.linebuf = realloc(AG.linebuf, LineBufSize);
-           TokenBuf = realloc(TokenBuf, LineBufSize);
+           AG.linebuf = (char*)realloc(AG.linebuf, LineBufSize);
+           TokenBuf = (char*)realloc(TokenBuf, LineBufSize);
        }
 
        /* off by one so we can back up in LineBuf */
@@ -505,7 +505,7 @@ char *aglasterr()
     fflush(agerrout);
     endpos = ftell(agerrout);
     len = endpos - aglast;
-    buf = malloc(len + 1);
+    buf = (char*)malloc(len + 1);
     fseek(agerrout, aglast, SEEK_SET);
     fread(buf, sizeof(char), len, agerrout);
     buf[len] = '\0';