From 2c0e68f058ebc36df0f581ab1232ac702f7e5a7a Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 24 Oct 2011 21:36:27 +0700 Subject: syntax-check: fix violations and re-enable sc_prohibit_strcmp. * cfg.mk (local-checks-to-fix): Remove sc_prohibit_strcmp from list of disabled checks. (exclude_file_name_regexp--sc_prohibit_strcmp): Ignore violations in libtool.texi and any demo C files. * libltdl/libltdl/lt__private.h (strneq, streq): Renamed from this... (STRNEQ, STREQ): ..to this. Adjust all callers. * tests/slist.at: Add STREQ definition. Change all !strcmp calls to STREQ. * build-aux/ltmain.m4sh (func_emit_cwrapperexe_src): Add and use STREQ definition. Signed-off-by: Gary V. Vaughan --- libltdl/libgnu/.gitignore | 2 -- libltdl/libltdl/lt__private.h | 4 ++-- libltdl/loaders/preopen.c | 10 +++++----- libltdl/lt_dlloader.c | 2 +- libltdl/ltdl.c | 16 ++++++++-------- 5 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 libltdl/libgnu/.gitignore (limited to 'libltdl') diff --git a/libltdl/libgnu/.gitignore b/libltdl/libgnu/.gitignore deleted file mode 100644 index d9f53942..00000000 --- a/libltdl/libgnu/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile.am -/dummy.c diff --git a/libltdl/libltdl/lt__private.h b/libltdl/libltdl/lt__private.h index f4c4a3d7..3b2609bc 100644 --- a/libltdl/libltdl/lt__private.h +++ b/libltdl/libltdl/lt__private.h @@ -94,8 +94,8 @@ LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ -#define strneq(s1, s2) (strcmp((s1), (s2)) != 0) -#define streq(s1, s2) (!strcmp((s1), (s2))) +#define STRNEQ(s1, s2) (strcmp((s1), (s2)) != 0) +#define STREQ(s1, s2) (strcmp((s1), (s2)) == 0) diff --git a/libltdl/loaders/preopen.c b/libltdl/loaders/preopen.c index 7149287d..1fe41271 100644 --- a/libltdl/loaders/preopen.c +++ b/libltdl/loaders/preopen.c @@ -168,7 +168,7 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { - if (!symbol->address && streq (symbol->name, filename)) + if (!symbol->address && STREQ (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. @@ -214,7 +214,7 @@ vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) while (symbol->name) { - if (streq (symbol->name, name)) + if (STREQ (symbol->name, name)) { return symbol->address; } @@ -336,8 +336,8 @@ lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ - if ((originator && streq (list->symlist->name, originator)) - || (!originator && streq (list->symlist->name, "@PROGRAM@"))) + if ((originator && STREQ (list->symlist->name, originator)) + || (!originator && STREQ (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; @@ -349,7 +349,7 @@ lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) - && (strneq (symbol->name, "@PROGRAM@"))) + && (STRNEQ (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) diff --git a/libltdl/lt_dlloader.c b/libltdl/lt_dlloader.c index 2c99a22d..699a5042 100644 --- a/libltdl/lt_dlloader.c +++ b/libltdl/lt_dlloader.c @@ -52,7 +52,7 @@ loader_callback (SList *item, void *userdata) assert (vtable); - return streq (vtable->name, name) ? (void *) item : NULL; + return STREQ (vtable->name, name) ? (void *) item : NULL; } diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 06f0f5ae..0887734a 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -385,7 +385,7 @@ tryall_dlopen (lt_dlhandle *phandle, const char *filename, { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename - && streq (handle->info.filename, filename))) + && STREQ (handle->info.filename, filename))) { break; } @@ -1108,11 +1108,11 @@ parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } - else if (streq (line, "installed=yes\n")) + else if (STREQ (line, "installed=yes\n")) { *installed = 1; } - else if (streq (line, "installed=no\n")) + else if (STREQ (line, "installed=no\n")) { *installed = 0; } @@ -1324,7 +1324,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, } /* Check whether we are opening a libtool module (.la extension). */ - if (ext && streq (ext, archive_ext)) + if (ext && STREQ (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; @@ -1538,12 +1538,12 @@ has_library_ext (const char *filename) ext = strrchr (filename, '.'); - if (ext && ((streq (ext, archive_ext)) + if (ext && ((STREQ (ext, archive_ext)) #if defined(LT_MODULE_EXT) - || (streq (ext, shlib_ext)) + || (STREQ (ext, shlib_ext)) #endif #if defined(LT_SHARED_EXT) - || (streq (ext, shared_ext)) + || (STREQ (ext, shared_ext)) #endif )) { @@ -2428,7 +2428,7 @@ lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; - if (cur && cur->info.name && streq (cur->info.name, module_name)) + if (cur && cur->info.name && STREQ (cur->info.name, module_name)) break; } -- cgit v1.2.1