From 635146f2ab95f1e594d36540c1f5105257414ba3 Mon Sep 17 00:00:00 2001 From: Suleyman Poyraz Date: Sat, 6 Apr 2024 11:21:59 +0300 Subject: [PATCH] Meson warnings fixed --- .gitignore | 5 +++++ include/common.h | 2 +- include/iksemel.h | 2 +- meson.build | 2 +- src/iks.c | 4 ++-- src/meson.build | 2 +- src/sax.c | 2 +- src/utility.c | 4 ++-- test/tst-sax.c | 4 ++-- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index ae9b8b7..79f211a 100755 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,8 @@ src/iksemel.egg-info/dependency_links.txt src/iksemel.egg-info/SOURCES.txt src/iksemel.egg-info/PKG-INFO src/iksemel.egg-info/top_level.txt + +*.patch + +# VSCode +.vscode/ diff --git a/include/common.h b/include/common.h index ee3c9c0..3aa88ca 100644 --- a/include/common.h +++ b/include/common.h @@ -38,4 +38,4 @@ extern int errno; #include "finetune.h" -#endif // __COMMON_H \ No newline at end of file +#endif // __COMMON_H diff --git a/include/iksemel.h b/include/iksemel.h index abec9ff..d9b1f55 100644 --- a/include/iksemel.h +++ b/include/iksemel.h @@ -102,7 +102,7 @@ enum ikserror { }; enum ikstagtype { - IKS_OPEN, + IKS_OPEN = 0, IKS_CLOSE, IKS_SINGLE }; diff --git a/meson.build b/meson.build index c721691..512e7d3 100644 --- a/meson.build +++ b/meson.build @@ -70,7 +70,7 @@ pkgconf.set('VERSION', version) pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) -configure_file(input : 'iksemel.pc.in'.format(version), +configure_file(input : 'iksemel.pc.in', output : 'iksemel-@0@.pc'.format(version), configuration : pkgconf, install_dir : pkg_install_dir) diff --git a/src/iks.c b/src/iks.c index e3f321e..ed254b2 100644 --- a/src/iks.c +++ b/src/iks.c @@ -597,8 +597,8 @@ static char * escape (char *dest, char *src, size_t len) { char c; - int i; - int j = 0; + size_t i; + size_t j = 0; for (i = 0; i < len; i++) { c = src[i]; diff --git a/src/meson.build b/src/meson.build index 3143bfd..88335a4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -83,7 +83,7 @@ if backends.length() != 0 pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir')) - configure_file(input : 'jabber.pc.in'.format(version), + configure_file(input : 'jabber.pc.in', output : 'jabber-@0@.pc'.format(version), configuration : jabber_pkgconf, install_dir : pkg_install_dir) diff --git a/src/sax.c b/src/sax.c index 56ec5b8..a6c0ba3 100644 --- a/src/sax.c +++ b/src/sax.c @@ -162,7 +162,7 @@ stack_expand (iksparser *prs, int len) prs->stack_max = need; prs->tag_name += diff; if (prs->attflag != 0) { - int i = 0; + unsigned int i = 0; while (i < (prs->attmax * 2)) { if (prs->atts[i]) prs->atts[i] += diff; i++; diff --git a/src/utility.c b/src/utility.c index eb571cd..85ae76c 100644 --- a/src/utility.c +++ b/src/utility.c @@ -100,7 +100,7 @@ char * iks_escape (ikstack *s, char *src, size_t len) { char *ret; - int i, j, nlen; + size_t i, j, nlen; if (!src || !s) return NULL; if (len == -1) len = strlen (src); @@ -138,7 +138,7 @@ iks_escape (ikstack *s, char *src, size_t len) char * iks_unescape (ikstack *s, char *src, size_t len) { - int i,j; + size_t i,j; char *ret; if (!s || !src) return NULL; diff --git a/test/tst-sax.c b/test/tst-sax.c index 401e13d..0c0fbba 100644 --- a/test/tst-sax.c +++ b/test/tst-sax.c @@ -152,7 +152,7 @@ tagHook (void *udata, char *name, char **atts, int type) if (!tester.cur) TAG_FAIL; if (tester.cur->type != IKS_TAG) TAG_FAIL; - if (tester.cur->tag != type) TAG_FAIL; + if ((int)tester.cur->tag != type) TAG_FAIL; if (iks_strcmp (tester.cur->name, name) != 0) TAG_FAIL; if (!atts && tester.cur->nr_atts > 0) TAG_FAIL; if (atts && tester.cur->nr_atts == 0) TAG_FAIL; @@ -177,7 +177,7 @@ tagHook (void *udata, char *name, char **atts, int type) void debug_cdata (char *data, size_t len, int pos) { - int i; + size_t i; PRINT_TEST; if (tester.cur && tester.cur->type == IKS_CDATA)