]> granicus.if.org Git - graphviz/commitdiff
htmlparse.y: consistently treat 'kind' as a 'char'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Mar 2022 20:59:50 +0000 (13:59 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 05:28:30 +0000 (22:28 -0700)
The `kind` field in `htmllabel_t` is a `char`, so this code was causing
conversion compiler warnings when trying to assign an `int` to it. We can avoid
this ambiguity by consistently using the same type everywhere.

lib/common/htmlparse.y

index 055f09aff61314adf4e99b21f4f765bd866cb089..82a5c835528d153bf56df3984f2c7b07f343c216 100644 (file)
@@ -269,8 +269,7 @@ static pitem* addRow (void)
 /* setCell:
  * Set cell body and type and attach to row
  */
-static void setCell (htmlcell_t* cp, void* obj, int kind)
-{
+static void setCell(htmlcell_t *cp, void *obj, char kind) {
   pitem*     sp = NEW(pitem);
   htmltbl_t* tbl = HTMLstate.tblstack;
   pitem*     rp = dtlast (tbl->u.p.rows);
@@ -292,8 +291,7 @@ static void setCell (htmlcell_t* cp, void* obj, int kind)
 /* mkLabel:
  * Create label, given body and type.
  */
-static htmllabel_t* mkLabel (void* obj, int kind)
-{
+static htmllabel_t *mkLabel(void *obj, char kind) {
   htmllabel_t* lp = NEW(htmllabel_t);
 
   lp->kind = kind;