From 739d0dba3c72243eb84bcc4ce65fd388599d4b92 Mon Sep 17 00:00:00 2001 From: Pablo Oliveira Date: Thu, 15 Oct 2020 09:22:24 +0200 Subject: [PATCH] Add const qualifier since context is immutable --- src/qmckl_context.org | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qmckl_context.org b/src/qmckl_context.org index 2a4844b..5d1f510 100644 --- a/src/qmckl_context.org +++ b/src/qmckl_context.org @@ -66,11 +66,11 @@ qmckl_context qmckl_context_create() { ** =qmckl_context_copy= #+BEGIN_SRC C :tangle qmckl_context.h -qmckl_context qmckl_context_copy(qmckl_context context); +qmckl_context qmckl_context_copy(const qmckl_context context); #+END_SRC #+BEGIN_SRC C :tangle qmckl_context.c -qmckl_context qmckl_context_copy(qmckl_context context) { +qmckl_context qmckl_context_copy(const qmckl_context context) { qmckl_context_struct* old_context; qmckl_context_struct* new_context; @@ -102,11 +102,11 @@ qmckl_context qmckl_context_copy(qmckl_context context) { ** =qmckl_context_set_precision= #+BEGIN_SRC C :tangle qmckl_context.h -qmckl_context qmckl_context_set_precision(qmckl_context context, int precision); +qmckl_context qmckl_context_set_precision(const qmckl_context context, int precision); #+END_SRC #+BEGIN_SRC C :tangle qmckl_context.c -qmckl_context qmckl_context_set_precision(qmckl_context context, int precision) { +qmckl_context qmckl_context_set_precision(const qmckl_context context, int precision) { qmckl_context_struct* ctx; if (precision < 2) return (qmckl_context) 0; @@ -120,11 +120,11 @@ qmckl_context qmckl_context_set_precision(qmckl_context context, int precision) ** =qmckl_context_set_range= #+BEGIN_SRC C :tangle qmckl_context.h -qmckl_context qmckl_context_set_range(qmckl_context context, int range); +qmckl_context qmckl_context_set_range(const qmckl_context context, int range); #+END_SRC #+BEGIN_SRC C :tangle qmckl_context.c -qmckl_context qmckl_context_set_range(qmckl_context context, int range) { +qmckl_context qmckl_context_set_range(const qmckl_context context, int range) { qmckl_context_struct* ctx; if (range < 2) return (qmckl_context) 0; @@ -141,11 +141,11 @@ qmckl_context qmckl_context_set_range(qmckl_context context, int range) { ** =qmckl_context_get_precision= #+BEGIN_SRC C :tangle qmckl_context.h -int qmckl_context_get_precision(qmckl_context context); +int qmckl_context_get_precision(const qmckl_context context); #+END_SRC #+BEGIN_SRC C :tangle qmckl_context.c -int qmckl_context_get_precision(qmckl_context context) { +int qmckl_context_get_precision(const qmckl_context context) { qmckl_context_struct* ctx; ctx = (qmckl_context_struct*) context; return ctx->precision; @@ -155,11 +155,11 @@ int qmckl_context_get_precision(qmckl_context context) { ** =qmckl_context_get_range= #+BEGIN_SRC C :tangle qmckl_context.h -int qmckl_context_get_range(qmckl_context context); +int qmckl_context_get_range(const qmckl_context context); #+END_SRC #+BEGIN_SRC C :tangle qmckl_context.c -int qmckl_context_get_range(qmckl_context context) { +int qmckl_context_get_range(const qmckl_context context) { qmckl_context_struct* ctx; ctx = (qmckl_context_struct*) context; return ctx->range;