From e4f356b9592599ad91aac34bf2265c9bcdfbb81f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 8 Apr 2025 15:16:21 +0200 Subject: Some minor changes to the interface. - Simplified logger to accept only a string, not a variadic list of args like printf(). This can still use some improvement, but now it is easier to use from other languages. - Fixed some misuses of the logger (wrong types etc) - Renamed some constants - Fixed some typos in comments. --- python/nissy_module.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'python/nissy_module.c') diff --git a/python/nissy_module.c b/python/nissy_module.c index db63dbb..da0b1c5 100644 --- a/python/nissy_module.c +++ b/python/nissy_module.c @@ -235,7 +235,7 @@ solverinfo(PyObject *self, PyObject *args) { long long result; const char *solver; - char buf[NISSY_DATAID_SIZE]; + char buf[NISSY_SIZE_DATAID]; PyObject *py_result, *py_buf; if (!PyArg_ParseTuple(args, "s", &solver)) @@ -263,7 +263,7 @@ gendata(PyObject *self, PyObject *args) { long long size, err; const char *solver; - char *buf, dataid[NISSY_DATAID_SIZE]; + char *buf, dataid[NISSY_SIZE_DATAID]; if (!PyArg_ParseTuple(args, "s", &solver)) return NULL; @@ -421,13 +421,9 @@ static struct PyModuleDef nissy_python_module = { }; static void -log_stdout(const char *str, ...) +log_stdout(const char *str) { - va_list args; - - va_start(args, str); - vfprintf(stderr, str, args); - va_end(args); + fprintf(stderr, "%s", str); } PyMODINIT_FUNC PyInit_nissy_python_module(void) { -- cgit v1.3