aboutsummaryrefslogtreecommitdiff
path: root/c/pl.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-17 01:35:16 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-17 01:35:16 +0200
commit26bc41099c10b3a63fd744690df5c25cb713718b (patch)
tree4f314216ec3b6c9f75f003282ca9cb87505772ce /c/pl.cpp
parentda04598319bf3ab9d240bbec993222623a4ab85d (diff)
downloadEpisodeBrowser-26bc41099c10b3a63fd744690df5c25cb713718b.tar.gz
Add const to places.
Note that I did NOT add const to non-pointer/non-reference arguments in function declarations (without a following definition), as they do not mean anything there.
Diffstat (limited to 'c/pl.cpp')
-rw-r--r--c/pl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/c/pl.cpp b/c/pl.cpp
index 21253ba..307fc1e 100644
--- a/c/pl.cpp
+++ b/c/pl.cpp
@@ -3,7 +3,7 @@
#include "pl.h"
-Query::Query(module_t ctx, predicate_t p, term_t t0)
+Query::Query(const module_t ctx, const predicate_t p, const term_t t0)
{
m_q = PL_open_query(ctx, PL_Q_CATCH_EXCEPTION, p, t0);
}
@@ -16,25 +16,25 @@ Query::~Query()
int Query::Cut()
{
if (PL_cut_query(m_q)) return 1;
- if (term_t t = PL_exception(m_q)) throw t;
+ if (const term_t t = PL_exception(m_q)) throw t;
return 0;
}
int Query::Close()
{
if (PL_close_query(m_q)) return 1;
- if (term_t t = PL_exception(m_q)) throw t;
+ if (const term_t t = PL_exception(m_q)) throw t;
return 0;
}
int Query::NextSolution()
{
if (PL_next_solution(m_q)) return 1;
- if (term_t t = PL_exception(m_q)) throw t;
+ if (const term_t t = PL_exception(m_q)) throw t;
return 0;
}
-int PL_get_tchars(term_t t, TCHAR **lpTsz, int iFlags)
+int PL_get_tchars(const term_t t, TCHAR **lpTsz, const int iFlags)
{
#ifdef UNICODE
size_t len;
@@ -50,7 +50,7 @@ int PL_get_tchars(term_t t, TCHAR **lpTsz, int iFlags)
int Plx(const char *szMod, const char *szPred)
{
- term_t t = PL_new_term_refs(0);
+ const term_t t = PL_new_term_refs(0);
Query q(NULL, PL_predicate(szPred, 0, szMod), t);
return q.NextSolution();
}