]> granicus.if.org Git - graphviz/commitdiff
Janitor: api_t is unsigned and can't be -ve
authorJohn Ellson <ellson@research.att.com>
Thu, 14 Nov 2013 17:19:02 +0000 (12:19 -0500)
committerJohn Ellson <ellson@research.att.com>
Thu, 14 Nov 2013 17:19:02 +0000 (12:19 -0500)
lib/gvc/gvconfig.c
lib/gvc/gvplugin.c

index 82182597755957b35f33e5111f822b33f246e459..681fc5da221ef236deaca965e8983eb7f3cde7f5 100644 (file)
@@ -187,10 +187,6 @@ static int gvconfig_plugin_install_from_config(GVC_t * gvc, char *s)
        do {
            api = token(&nest, &s);
            gv_api = gvplugin_api(api);
-           if (gv_api == -1) {
-               agerr(AGERR, "invalid api in config: %s %s\n", path, api);
-               return 0;
-           }
            do {
                if (nest == 2) {
                    type = token(&nest, &s);
index 51e7a8c4e583f92fbf382606b4f054534ae80f2a..5b7ef1ba563fe660d6a90b9eae7c07c69714cdfb 100644 (file)
@@ -64,7 +64,7 @@ api_t gvplugin_api(char *str)
 /* translate api_t into string name, or NULL */
 char *gvplugin_api_name(api_t api)
 {
-    if (api < 0 || api >= ARRAY_SIZE(api_names))
+    if (api >= ARRAY_SIZE(api_names))
         return NULL;
     return api_names[api];
 }
@@ -81,9 +81,6 @@ boolean gvplugin_install(GVC_t * gvc, api_t api, const char *typestr,
 #define TYPSIZ 63
     char *p, pins[TYPSIZ + 1], pnxt[TYPSIZ + 1];
 
-    if (api < 0)
-        return FALSE;
-
     strncpy(pins, typestr, TYPSIZ);
     if ((p = strchr(pins, ':')))
         *p = '\0';
@@ -136,10 +133,6 @@ static boolean gvplugin_activate(GVC_t * gvc, api_t api,
 {
     gvplugin_available_t **pnext;
 
-
-    if (api < 0)
-        return FALSE;
-
     /* point to the beginning of the linked list of plugins for this api */
     pnext = &(gvc->apis[api]);
 
@@ -266,10 +259,6 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, const char *str)
     int i;
     api_t apidep;
 
-    /* check for valid apis[] index */
-    if (api < 0)
-        return NULL;
-
     if (api == API_device || api == API_loadimage)
         /* api dependencies - FIXME - find better way to code these *s */
         apidep = API_render;
@@ -347,10 +336,6 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str)
     boolean new = TRUE;
     static agxbuf xb;
 
-    /* check for valid apis[] index */
-    if (api < 0)
-        return NULL;
-
     /* check for valid str */
     if (!str)
         return NULL;