diff options
author | John Ankarström <john@ankarstrom.se> | 2022-02-16 18:09:04 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-02-16 18:25:50 +0100 |
commit | 2a726875d7ab370966bbb4b6ebb41756fc17f729 (patch) | |
tree | 1cc9da9c70a994aa43287088cdfbc2a5d38606b9 /c/common.c | |
parent | 7086bfe3e7bf04dd61f16216c659fc5534c2796a (diff) | |
download | EpisodeBrowser-2a726875d7ab370966bbb4b6ebb41756fc17f729.tar.gz |
Clean up.
Diffstat (limited to 'c/common.c')
-rw-r--r-- | c/common.c | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -2,6 +2,7 @@ #include <SWI-Prolog.h> #include "resource.h" +#include "defs.h" /* Convert zero-terminated non-wide (multi-byte) string to * zero-terminated wide/non-wide string depending on UNICODE. */ @@ -16,14 +17,12 @@ TSZFromSZ(const char *sz, int iCp) cbMultiByte = strlen(sz)+1; cchWideChar = MultiByteToWideChar(iCp, 0, sz, cbMultiByte, NULL, 0); tsz = malloc(cchWideChar*sizeof(WCHAR)); - if (!tsz) - return NULL; + if (!tsz) return NULL; if (!MultiByteToWideChar(iCp, 0, sz, cbMultiByte, tsz, cchWideChar)) return NULL; #else tsz = malloc(strlen(sz)+1); - if (!tsz) - return NULL; + if (!tsz) return NULL; strcpy(tsz, sz); #endif @@ -34,12 +33,8 @@ int Watched(int iEpisode) { term_t t; - - t = PL_new_term_refs(1); - if (!PL_put_integer(t+0, iEpisode)) - return 0; - - return PL_call_predicate(NULL, PL_Q_NORMAL, - PL_predicate("watched", 1, "track_episodes"), - t); + t = T(1); + PI(t,iEpisode) return 0; + P("track_episodes","watched",1,t) return 0; + return 1; } |