]> granicus.if.org Git - graphviz/commitdiff
janitor - fix some consts for c++ and -Wwrite-strings
authorJohn Ellson <john.ellson@comcast.net>
Sat, 9 Jan 2016 21:34:08 +0000 (16:34 -0500)
committerJohn Ellson <john.ellson@comcast.net>
Sat, 9 Jan 2016 21:34:08 +0000 (16:34 -0500)
cmd/gvedit/mainwindow.cpp
lib/gvc/gvc.h
lib/gvc/gvplugin.c

index 4f9ed3392018aa85ebc3190fee8d205eafdaa3bd..8e3dd68f5c45bb56a06da8d9b860482d50957572 100644 (file)
@@ -37,8 +37,8 @@ static void freeList(char **lp, int count)
     free(lp);
 }
 
-static int LoadPlugins(QComboBox * cb, GVC_t * gvc, char *kind,
-                      char *more[], char *prefer)
+static int LoadPlugins(QComboBox * cb, GVC_t * gvc, const char *kind,
+                      const char *more[], const char *prefer)
 {
     int count;
     char **lp = gvPluginList(gvc, kind, &count, NULL);
@@ -55,7 +55,7 @@ static int LoadPlugins(QComboBox * cb, GVC_t * gvc, char *kind,
     /* Add additional items if supplied */
     if (more) {
        int i = 0;
-       char *s;
+       const char *s;
        while ((s = more[i++])) {
            cb->addItem(QString(s));
        }
@@ -117,9 +117,9 @@ void CMainWindow::createConsole()
 
 }
 
-static char *xtra[] = {
+static const char *xtra[] = {
     "NONE",
-    (char *) 0
+    (const char *) NULL
 };
 
 CMainWindow::CMainWindow(char*** Files)
@@ -171,7 +171,7 @@ CMainWindow::CMainWindow(char*** Files)
 //    (QComboBox*)frmSettings->findChild<QComboBox*>("cbLayout")
     QComboBox *cb =
        (QComboBox *) frmSettings->findChild < QComboBox * >("cbLayout");
-    dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", 0, "dot");
+    dfltLayoutIdx = LoadPlugins(cb, frmSettings->gvc, "layout", NULL, "dot");
     cb = (QComboBox *) frmSettings->findChild <
        QComboBox * >("cbExtension");
     dfltRenderIdx =
index a955c425c3bb785ae2aea45af5f471b9bccfa335..5e08e96e1c4033e1b93e4c2758ae3430c35b6c18 100644 (file)
@@ -104,7 +104,7 @@ extern int gvFreeContext(GVC_t *gvc);
  * At present, the str argument is unused, but may be used to modify
  * the search as in gvplugin_list above.
  */
-extern char** gvPluginList (GVC_t *gvc, char* kind, int* sz, char*);
+extern char** gvPluginList (GVC_t *gvc, const char* kind, int* sz, char*);
 
 /** Add a library from your user application
  * @param gvc Graphviz context to add library to
index 5b7ef1ba563fe660d6a90b9eae7c07c69714cdfb..a2e09c4219f9bab8329b1fe7a3de88d0cb571559 100644 (file)
@@ -412,7 +412,7 @@ char *gvplugin_list(GVC_t * gvc, api_t api, const char *str)
  * At present, the str argument is unused, but may be used to modify
  * the search as in gvplugin_list above.
  */
-char **gvPluginList(GVC_t * gvc, char *kind, int *sz, const char *str)
+char **gvPluginList(GVC_t * gvc, const char *kind, int *sz, const char *str)
 {
     int api;
     gvplugin_available_t **pnext, **plugin;