summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2022-08-12 10:54:43 +0200
committerkrangelov <kr.angelov@gmail.com>2022-08-12 10:54:43 +0200
commit3acb7d2da481350a7be328d6f7c0b095661d05ec (patch)
tree8cda3023f6c89a1ee2837dd52e0000f9217e137e /src
parent08fb29e6b846e24f9f1e4de21e05d220bdf54624 (diff)
silence harmless warnings
Diffstat (limited to 'src')
-rw-r--r--src/runtime/python/pypgf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index e6df2632b..bca151ba7 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -385,7 +385,7 @@ Expr_call(ExprObject* self, PyObject* args, PyObject* kw)
pyexpr->pool = gu_new_pool();
pyexpr->expr = self->expr;
- for (Py_ssize_t i = 0; i < n_args; i++) {
+ for (size_t i = 0; i < n_args; i++) {
PyObject* obj = PyTuple_GetItem(args, i);
if (obj->ob_type != &pgf_ExprType) {
PyErr_SetString(PyExc_TypeError, "the arguments must be expressions");
@@ -549,7 +549,7 @@ Expr_visit(ExprObject* self, PyObject *args)
return NULL;
}
- for (size_t i = 0; i < app->n_args; i++) {
+ for (size_t i = 0; i < (size_t) app->n_args; i++) {
ExprObject* pyarg = (ExprObject*) pgf_ExprType.tp_alloc(&pgf_ExprType, 0);
if (pyarg == NULL) {
Py_DECREF(args);
@@ -856,7 +856,7 @@ Type_init(TypeObject *self, PyObject *args, PyObject *kwds)
self->type->cid = gu_string_copy(catname_s, self->pool);
self->type->n_exprs = n_exprs;
- for (Py_ssize_t i = 0; i < n_exprs; i++) {
+ for (size_t i = 0; i < n_exprs; i++) {
PyObject* obj = PyList_GetItem(py_exprs, i);
if (Py_TYPE(obj) != &pgf_ExprType) {
PyErr_SetString(PyExc_TypeError, "the arguments in the second list must be expressions");
@@ -1680,7 +1680,7 @@ Concr_complete(ConcrObject* self, PyObject *args, PyObject *keywds)
static char *kwlist[] = {"sentence", "cat", "prefix", "n", NULL};
PyObject* sentence0 = NULL;
- char* sentence = NULL;
+ const char* sentence = NULL;
PyObject* start = NULL;
GuString prefix = "";
bool prefix_bind = false;
@@ -1690,10 +1690,10 @@ Concr_complete(ConcrObject* self, PyObject *args, PyObject *keywds)
&prefix, &max_count))
return NULL;
- IterObject* pyres = (IterObject*)
- pgf_IterType.tp_alloc(&pgf_IterType, 0);
- if (pyres == NULL) {
- return NULL;
+ IterObject* pyres = (IterObject*)
+ pgf_IterType.tp_alloc(&pgf_IterType, 0);
+ if (pyres == NULL) {
+ return NULL;
}
pyres->source = (PyObject*) self->grammar;