]> granicus.if.org Git - graphviz/commitdiff
mingle: cast results of 'malloc'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Dec 2021 19:33:51 +0000 (11:33 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 4 Jan 2022 15:58:22 +0000 (07:58 -0800)
This has no effect at present. However, when moving this code to C++ in an
upcoming commit, it would trigger -fpermissive problems. This change
pre-emptively prevents this issue.

cmd/mingle/minglemain.c

index 61ac6b2274625975c6743c24887a0447ebdec357..6a17d028b2183f39345eadbc94d4dd8c96b12545 100644 (file)
@@ -300,7 +300,7 @@ genBundleColors (pedge edge, agxbuf* xb, double maxwgt)
        double len, t, len_total0 = 0;
        int dim = edge->dim;
        double* x = edge->x;
-       double* lens = MALLOC(sizeof(double)*edge->npoints);
+       double* lens = (double*)MALLOC(sizeof(double) * edge->npoints);
 
        for (j = 0; j < edge->npoints - 1; j++){
                len = 0;
@@ -438,7 +438,7 @@ bundle (Agraph_t* g, opts_t* opts)
                
        ia = A->ia; ja = A->ja;
        nz = A->nz;
-       xx = MALLOC(sizeof(double)*nz*4);
+       xx = (double*)MALLOC(sizeof(double) * nz * 4);
        nz = 0;
        dim = 4;
        for (i = 0; i < A->m; i++){