Browse Source

const'ify string literals

(librdf_query_virtuoso_init): const'ify seps

redland-virtuoso-test (main): const'ify query_cmd
Sebastian Freundt 4 years ago
parent
commit
5e6d0fa2fe
2 changed files with 5 additions and 5 deletions
  1. 1 1
      src/rdf_query_virtuoso.c
  2. 4 4
      utils/redland-virtuoso-test.c

+ 1 - 1
src/rdf_query_virtuoso.c

@@ -169,7 +169,7 @@ librdf_query_virtuoso_init(librdf_query* query, const char *name,
   librdf_query_virtuoso_context *context;
   size_t len;
   unsigned char *query_string_copy;
-  char *seps={(char *)" \t\n\r\f"};
+  const char *const seps={(const char *)" \t\n\r\f"};
   char *token;
 
   context = (librdf_query_virtuoso_context*)query->context;

+ 4 - 4
utils/redland-virtuoso-test.c

@@ -368,7 +368,7 @@ main(int argc, char *argv[])
   const char* identifier;
   const char* results_format;
   librdf_statement* statement=NULL;
-  char* query_cmd=NULL;
+  const char* query_cmd=NULL;
   char* s;
 
 
@@ -783,7 +783,7 @@ main(int argc, char *argv[])
 
 
   /***** Test 18 *****/
-  query_cmd=(char *)"CONSTRUCT {?s ?p ?o} FROM <http://red> WHERE {?s ?p ?o}";
+  query_cmd=(const char *)"CONSTRUCT {?s ?p ?o} FROM <http://red> WHERE {?s ?p ?o}";
   startTest(18, " Exec:  QUERY \"%s\" \n", query_cmd);
   {
     query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL);
@@ -830,7 +830,7 @@ main(int argc, char *argv[])
 
 
   /***** Test 19 *****/
-  query_cmd=(char *)"SELECT * WHERE {graph <http://red> { ?s ?p ?o }}";
+  query_cmd=(const char *)"SELECT * WHERE {graph <http://red> { ?s ?p ?o }}";
   startTest(19, " Exec1:  QUERY_AS_BINDINGS \"%s\" \n", query_cmd);
   {
     query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL);
@@ -866,7 +866,7 @@ main(int argc, char *argv[])
 
 
   /***** Test 20 *****/
-  query_cmd=(char *)"SELECT * WHERE {graph <http://red> { ?s ?p ?o }}";
+  query_cmd=(const char *)"SELECT * WHERE {graph <http://red> { ?s ?p ?o }}";
   startTest(20, " Exec2:  QUERY_AS_BINDINGS \"%s\" \n", query_cmd);
   {
     query=librdf_new_query(world, (char *)"vsparql", NULL, (const unsigned char *)query_cmd, NULL);