From d9e1caa37e53c7dbc42b1fc652efc23a40c47c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 31 Jul 2022 19:56:53 +0200 Subject: Limit use of Hungarian notation. I don't hate Hungarian notation. It has some very nice qualities. But it also adds a lot of typing. That said, not using it feels a bit... unsafe. I might go back on this decision. We'll see. --- c/pl.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'c/pl.h') diff --git a/c/pl.h b/c/pl.h index c7fcfc8..0a65c96 100644 --- a/c/pl.h +++ b/c/pl.h @@ -7,7 +7,7 @@ #include "common.h" -wstring_owner PlString(const term_t t, const int iFlags = CVT_WRITE); +wstring_owner PlString(const term_t t, const int flags = CVT_WRITE); struct Frame { @@ -69,9 +69,9 @@ inline int PlGet(term_t t, atom_t* x) { return PL_get_atom(t, x); } inline int PlGet(term_t t, char** x) { return PL_get_atom_chars(t, x); } inline int PlGet(term_t t, wstring_owner* x) { Mark m; - char* sz; - if (!PlGet(t, &sz)) return 0; - *x = WsoFromSz(sz); + char* s; + if (!PlGet(t, &s)) return 0; + *x = WsoFromSz(s); return 1; /* or catch potential exception from BstrFromSz? */ } @@ -89,13 +89,13 @@ inline bool PlGetN(term_t t, T x, U... xs) { return PlGet(t, x) && PlGetN(t+1, x /* Call Prolog predicate. */ template -int Pl(const char* const szMod, const char* const szPred, T... xs) +int Pl(const char* const mod, const char* const pred, T... xs) { Frame f; const term_t t = PL_new_term_refs(sizeof...(T)); if (!PlPutN(t, xs...)) return 0; - Query q(NULL, PL_predicate(szPred, sizeof...(T), szMod), t); + Query q(NULL, PL_predicate(pred, sizeof...(T), mod), t); if constexpr (Except) { if (!q.NextSolution()) return 0; @@ -109,9 +109,9 @@ int Pl(const char* const szMod, const char* const szPred, T... xs) /* Call Prolog predicate, propagating Prolog exceptions. */ template -int Plx(const char* const szMod, const char* const szPred, T... xs) +int Plx(const char* const mod, const char* const pred, T... xs) { - return Pl(szMod, szPred, xs...); + return Pl(mod, pred, xs...); } #endif -- cgit v1.2.3