Forráskód Böngészése

Make args in connections and term_set fn constant.

scossu 6 napja
szülő
commit
33aafde41d
2 módosított fájl, 8 hozzáadás és 8 törlés
  1. 3 3
      include/graph.h
  2. 5 5
      src/graph.c

+ 3 - 3
include/graph.h

@@ -433,7 +433,7 @@ LSUP_graph_print (const LSUP_Graph *gr);
  */
 LSUP_LinkMap *
 LSUP_graph_connections (
-        const LSUP_Graph *gr, LSUP_Term *t, LSUP_LinkType type);
+        const LSUP_Graph *gr, const LSUP_Term *t, const LSUP_LinkType type);
 
 
 /** @brief Get a list of terms related to a term pair in a graph.
@@ -452,8 +452,8 @@ LSUP_graph_connections (
  */
 LSUP_TermSet *
 LSUP_graph_term_set (
-        const LSUP_Graph *gr, LSUP_Term *t1, LSUP_TriplePos t1_pos,
-        LSUP_Term *t2, LSUP_TriplePos t2_pos);
+        const LSUP_Graph *gr, const LSUP_Term *t1, const LSUP_TriplePos t1_pos,
+        const LSUP_Term *t2, const LSUP_TriplePos t2_pos);
 
 
 /** @brief Get all unique subjcts, predicates, or objects in a graph.

+ 5 - 5
src/graph.c

@@ -680,9 +680,9 @@ LSUP_graph_print (const LSUP_Graph *gr)
 
 LSUP_LinkMap *
 LSUP_graph_connections (
-        const LSUP_Graph *gr, LSUP_Term *t, LSUP_LinkType type)
+        const LSUP_Graph *gr, const LSUP_Term *t, const LSUP_LinkType type)
 {
-    LSUP_Term
+    const LSUP_Term
         *s = NULL,
         *p = NULL,
         *o = NULL;
@@ -738,15 +738,15 @@ LSUP_graph_connections (
 
 LSUP_TermSet *
 LSUP_graph_term_set (
-        const LSUP_Graph *gr, LSUP_Term *t1, LSUP_TriplePos t1_pos,
-        LSUP_Term *t2, LSUP_TriplePos t2_pos)
+        const LSUP_Graph *gr, const LSUP_Term *t1, const LSUP_TriplePos t1_pos,
+        const LSUP_Term *t2, const LSUP_TriplePos t2_pos)
 {
     if (t1_pos == t2_pos) {
         log_error ("Term 1 and 2 positions cannot be the same!");
         return NULL;
     }
 
-    LSUP_Term *spo_l[3] = {NULL};
+    const LSUP_Term *spo_l[3] = {NULL};
     spo_l[t1_pos] = t1;
     spo_l[t2_pos] = t2;
     LSUP_TriplePos rpos = 0;  // Position of term to be added to results.