[ktap] [PATCH 2/5] interpreter: fix const correctness warnings

  • From: Ben Noordhuis <info@xxxxxxxxxxxxx>
  • To: ktap@xxxxxxxxxxxxx
  • Date: Fri, 31 May 2013 23:02:53 +0200

Signed-off-by: Ben Noordhuis <info@xxxxxxxxxxxxx>
---
 interpreter/table.c | 2 +-
 interpreter/vm.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/interpreter/table.c b/interpreter/table.c
index 656d236..eb5b75b 100644
--- a/interpreter/table.c
+++ b/interpreter/table.c
@@ -685,7 +685,7 @@ void kp_table_histogram(ktap_State *ks, Table *t)
 
                if (ttisstring(key)) {
                        char buf[32 + 1] = {0};
-                       char *keystr;
+                       const char *keystr;
 
                        if (strlen(svalue(key)) > 32) {
                                strncpy(buf, svalue(key), 32-4);
diff --git a/interpreter/vm.c b/interpreter/vm.c
index de17955..02d1bd2 100644
--- a/interpreter/vm.c
+++ b/interpreter/vm.c
@@ -874,7 +874,7 @@ static int cfunction_cache_getindex(ktap_State *ks, Tvalue 
*fname)
 {
        const Tvalue *gt = kp_table_getint(hvalue(&G(ks)->registry),
                                KTAP_RIDX_GLOBALS);
-       Tvalue *cfunc;
+       const Tvalue *cfunc;
        int nr, i;
 
        nr = G(ks)->nr_builtin_cfunction;
-- 
1.8.1.4


Other related posts:

  • » [ktap] [PATCH 2/5] interpreter: fix const correctness warnings - Ben Noordhuis