]> granicus.if.org Git - graphviz/commitdiff
cgraph: take initial agxbuf backing memory as a char buffer
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 21 May 2022 02:33:02 +0000 (19:33 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 23 May 2022 05:00:30 +0000 (22:00 -0700)
Removes some cast noise.

15 files changed:
cmd/smyrna/gui/menucallbacks.c
cmd/tools/gmlparse.y
cmd/tools/mm2gv.c
lib/cgraph/agxbuf.h
lib/cgraph/scan.l
lib/common/emit.c
lib/common/htmlparse.y
lib/common/htmltable.c
lib/common/input.c
lib/common/output.c
lib/common/utils.c
lib/xdot/xdot.c
plugin/core/gvrender_core_dot.c
plugin/pango/gvgetfontlist_pango.c
plugin/pango/gvtextlayout_pango.c

index 4081994925419892ba6c51a0ba8e0ab4594087a8..1191312f4a3a3b36f7dde67559d005648644f718 100644 (file)
@@ -336,7 +336,7 @@ void on_gvprbuttonload_clicked(GtkWidget * widget, gpointer user_data)
     GtkTextBuffer *gtkbuf;     /*GTK buffer from glade GUI */
 
     char buf[BUFSIZ];
-    unsigned char xbuffer[BUFSIZ];
+    char xbuffer[BUFSIZ];
 
     agxbinit(&xbuf, SMALLBUF, xbuffer);
 
index dc2acc38bad8ced862b70b8567ff5681c040dc31..77cc819db39330aa39df298d5a4d22a04dc4b073 100644 (file)
@@ -752,9 +752,9 @@ gml_to_gv (char* name, FILE* fp, int cnt, int* errors)
 {
     Agraph_t* g;
     agxbuf xb;
-    unsigned char buf[BUFSIZ];
+    char buf[BUFSIZ];
     agxbuf unk;
-    unsigned char unknownb[BUFSIZ];
+    char unknownb[BUFSIZ];
     int error;
 
     if (cnt == 0)
index 7b496b8ef07b1a15880e10e8a688c25f621b9ae6..5c8c50ef2e039400a37c3530de09a37d18718b4a 100644 (file)
@@ -80,7 +80,7 @@ static Agraph_t *makeDotGraph(SparseMatrix A, char *name, int dim,
     int i, j;
     agxbuf xb;
     char buf[BUFS];
-    unsigned char string[BUFS];
+    char string[BUFS];
     Agsym_t *sym = NULL, *sym2 = NULL, *sym3 = NULL;
     int *ia = A->ia;
     int *ja = A->ja;
index a83088da7a6eb625971a822052603b11a211017e..0f1c1b2944a6503b00e2cca39709208c46dba50b 100644 (file)
  * Initializes new agxbuf; caller provides memory.
  * Assume if init is non-null, hint = sizeof(init[])
  */
-static inline void agxbinit(agxbuf *xb, unsigned int hint,
-                            unsigned char *init) {
+static inline void agxbinit(agxbuf *xb, unsigned int hint, char *init) {
   if (init != NULL) {
-    xb->buf = (char *)init;
+    xb->buf = init;
     xb->dyna = 0;
   } else {
     if (hint == 0) {
index 6296e49ce273f93d5353fc56ffded175306568cc..a668cf75a0067a830f84b4a04e3974e270eed712 100644 (file)
@@ -233,7 +233,7 @@ ID          ({NAME}|{NUMBER})
 
 void aagerror(const char *str)
 {
-       unsigned char   xbuf[BUFSIZ];
+       char    xbuf[BUFSIZ];
        agxbuf  xb;
 
        agxbinit(&xb, BUFSIZ, xbuf);
index 1826e82a9914c0822030369133a987493e220da6..8a9e6c61974cbee441e894e6620ba5622599bb27 100644 (file)
@@ -312,7 +312,7 @@ initObjMapData (GVJ_t* job, textlabel_t *lab, void* gobj)
     char* tooltip = agget(gobj, "tooltip");
     char* target = agget(gobj, "target");
     char* id;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
     agxbuf xb;
 
     agxbinit(&xb, SMALLBUF, buf);
@@ -1036,7 +1036,7 @@ static int layer_index(GVC_t *gvc, char *str, int all)
 static bool selectedLayer(GVC_t *gvc, int layerNum, int numLayers, char *spec)
 {
     int n0, n1;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
     char *w0, *w1;
     char *buf_part_p = NULL, *buf_p = NULL, *cur, *part_in_p;
     agxbuf xb;
@@ -2536,7 +2536,7 @@ static void emit_begin_edge(GVJ_t * job, edge_t * e, char** styles)
 
     if (flags & GVRENDER_DOES_MAPS) {
        agxbuf xb;
-       unsigned char xbuf[SMALLBUF];
+       char xbuf[SMALLBUF];
 
        agxbinit(&xb, SMALLBUF, xbuf);
        s = getObjId (job, e, &xb);
@@ -3395,7 +3395,7 @@ static void emit_page(GVJ_t * job, graph_t * g)
     textlabel_t *lab;
     pointf *p = NULL;
     char* saveid;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
     agxbuf xb;
 
     /* For the first page, we can use the values generated in emit_begin_graph. 
@@ -3782,7 +3782,7 @@ static int style_token(char **s, agxbuf * xb)
 }
 
 #define FUNLIMIT 64
-static unsigned char outbuf[SMALLBUF];
+static char outbuf[SMALLBUF];
 static agxbuf ps_xb;
 
 /* parse_style:
@@ -3799,7 +3799,7 @@ char **parse_style(char *s)
     static bool is_first = true;
     int fun = 0;
     bool in_parens = false;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
     char *p;
     int c;
     agxbuf xb;
index a3393a7b6bed4a7458e289577bd07d39575b1511..4304979a1b0a2589e628a23031b1a48001f0d7e4 100644 (file)
@@ -590,7 +590,7 @@ VR  : T_vr T_end_vr
 htmllabel_t*
 parseHTML (char* txt, int* warn, htmlenv_t *env)
 {
-  unsigned char buf[SMALLBUF];
+  char buf[SMALLBUF];
   agxbuf        str;
   htmllabel_t*  l;
   sfont_t       dfltf;
index a8655b5c13e65ce62c2d2e666be5a2c5ebbc24a7..fcf8fc0456776f9398eab3e1d70f7b5dca7f3bab 100644 (file)
@@ -380,7 +380,7 @@ initAnchor(GVJ_t * job, htmlenv_t * env, htmldata_t * data, boxf b,
     static int anchorId;
     int internalId = 0;
     agxbuf xb;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
 
     save->url = obj->url;
     save->tooltip = obj->tooltip;
@@ -2012,7 +2012,7 @@ int make_html_label(void *obj, textlabel_t * lp)
     if (!lbl) {
        /* Parse of label failed; revert to simple text label */
        agxbuf xb;
-       unsigned char buf[SMALLBUF];
+       char buf[SMALLBUF];
        agxbinit(&xb, SMALLBUF, buf);
        lp->html = false;
        lp->text = strdup(nameOf(obj, &xb));
index dd0e04baa9028daeb1d294acbb61b2b2592bf66c..13c074227246a014e9342d0a527950f853da58e2 100644 (file)
@@ -227,7 +227,7 @@ int dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
     char c, *rest, *layout;
     const char *val;
     int i, v, nfiles;
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
     agxbuf xb;
     int Kflag = 0;
 
index 36f8f6ce80efa660371341013bbf6615f22b522a..82e42b20bfd76ec3d89d6d769c6e897c866cbb24 100644 (file)
@@ -188,7 +188,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
     int s_arrows;              /* graph has edges with start arrows */
     int i, j, sides;
     char buf[BUFSIZ];          /* Used only for small strings */
-    unsigned char xbuffer[BUFSIZ];     /* Initial buffer for xb */
+    char xbuffer[BUFSIZ];      /* Initial buffer for xb */
     agxbuf xb;
     node_t *n;
     edge_t *e;
index 5544260c23dcbd7da0b8faa3f5d90a0dbf441209..de3a604dcb446809b37e262ef7399c8da5afa1b0 100644 (file)
@@ -1160,7 +1160,7 @@ void processClusterEdges(graph_t * g)
     agxbuf xb;
     Dt_t *map;
     Dt_t *cmap = mkClustMap (g);
-    unsigned char buf[SMALLBUF];
+    char buf[SMALLBUF];
 
     map = dtopen(&mapDisc, Dtoset);
     clg = agsubg(g, "__clusternodes",1);
index a2c965ec4c4d9fdac536586b88676c80dca28435..ac2ba196c9e8cf598a1d657e2e3f399b71a5be38 100644 (file)
@@ -543,7 +543,7 @@ typedef void (*print_op)(xdot_op * op, pf print, void *info, int more);
 static void printXDot_Op(xdot_op * op, pf print, void *info, int more)
 {
     agxbuf xb;
-    unsigned char buf[BUFSIZ];
+    char buf[BUFSIZ];
 
     agxbinit (&xb, BUFSIZ, buf);
     switch (op->kind) {
@@ -667,7 +667,7 @@ static void jsonString(char *p, pf print, void *info)
 static void jsonXDot_Op(xdot_op * op, pf print, void *info, int more)
 {
     agxbuf xb;
-    unsigned char buf[BUFSIZ];
+    char buf[BUFSIZ];
 
     agxbinit (&xb, BUFSIZ, buf);
     switch (op->kind) {
@@ -781,7 +781,7 @@ static void agxbput_(char *s, void *xb) {
 char *sprintXDot(xdot * x)
 {
     char *s;
-    unsigned char buf[BUFSIZ];
+    char buf[BUFSIZ];
     agxbuf xb;
     agxbinit(&xb, BUFSIZ, buf);
     _printXDot(x, agxbput_, &xb, printXDot_Op);
index e47828b246f667eb42053ef39389f490f8e0ad40..c45563460272803e51192ccb38b0024db2f03984 100644 (file)
@@ -78,7 +78,7 @@ typedef struct {
     attrsym_t *e_l_draw;
     attrsym_t *hl_draw;
     attrsym_t *tl_draw;
-    unsigned char buf[NUMXBUFS][BUFSIZ];
+    char buf[NUMXBUFS][BUFSIZ];
     unsigned short version;
     char* version_s;
 } xdot_state_t;
@@ -190,7 +190,7 @@ static void xdot_fillcolor (GVJ_t *job)
 
 static void xdot_style (GVJ_t *job)
 {
-    unsigned char buf0[BUFSIZ];
+    char buf0[BUFSIZ];
     char buf [128]; /* enough to hold a double */
     agxbuf xb;
     char* p, **s;
@@ -612,7 +612,7 @@ static void xdot_color_stop (agxbuf* xb, float v, gvcolor_t* clr)
 
 static void xdot_gradient_fillcolor (GVJ_t* job, int filled, pointf* A, int n)
 {
-    unsigned char buf0[BUFSIZ];
+    char buf0[BUFSIZ];
     agxbuf xb;
     obj_state_t* obj = job->obj;
     double angle = obj->gradient_angle * M_PI / 180;
index dcf4f3a3b16b6ac4b2f8ac521599104ee7a7f72a..d91d60d163902b91b5ee7302af3df0ee4dfe982b 100644 (file)
@@ -500,8 +500,8 @@ gv_font_map* get_font_mapping(PangoFontMap * fontmap)
     gv_font_map* gv_fmap = N_NEW(ps_fontnames_sz, gv_font_map);
     agxbuf xb;
     agxbuf xb2;
-    unsigned char buf[BUFSIZ];
-    unsigned char buf2[BUFSIZ];
+    char buf[BUFSIZ];
+    char buf2[BUFSIZ];
 
     agxbinit(&xb, BUFSIZ, buf);
     agxbinit(&xb2, BUFSIZ, buf2);
index 39e03cb3ee8cde900bf5332d0e75a089a5fec977..f1c303380cacb721505772f7ea49067ec20b8ece 100644 (file)
@@ -200,7 +200,7 @@ static bool pango_textlayout(textspan_t * span, char **fontpath)
 
 #ifdef ENABLE_PANGO_MARKUP
     if ((span->font) && (flags = span->font->flags)) {
-       unsigned char buf[BUFSIZ];
+       char buf[BUFSIZ];
        agxbuf xb;
 
        agxbinit(&xb, BUFSIZ, buf);