]> granicus.if.org Git - graphviz/commitdiff
Change cast of strcmp in bsearch.
authorErwin Janssen <erwinjanssen@outlook.com>
Fri, 9 Sep 2016 22:02:58 +0000 (00:02 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Fri, 9 Sep 2016 22:02:58 +0000 (00:02 +0200)
Casting `strcmp` to `__compar_fn_t` doesn't work on Windows, the build
fails. Instead, cast `strcmp` to the required function type:
`(int(*)(const void*, const void*)`

lib/gvc/gvrender.c

index a41f9528af7f051e573ca6f376fdb65d9f7bdcab..a1e5c42065a72928538d59048df1917012e3aa97 100644 (file)
@@ -198,7 +198,7 @@ static void gvrender_resolve_color(gvrender_features_t * features,
        ||
        (bsearch
         (tok, features->knowncolors, features->sz_knowncolors,
-         sizeof(char *), (__compar_fn_t) strcmp)) == NULL) {
+         sizeof(char *), (int(*)(const void*, const void*)) strcmp)) == NULL) {
        /* if tok was not found in known_colors */
        rc = colorxlate(name, color, features->color_type);
        if (rc != COLOR_OK) {