#include <fcntl.h>
#include <sys/stat.h>
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
/* declarations of non-ANSI functions */
#if defined(__MINGW32__)
# ifdef __STRICT_ANSI__
newargc=0;
for (i = 1; i < argc; i++)
{
- if (strcmp (argv[i], dumpscript_opt) == 0)
+ if (STREQ (argv[i], dumpscript_opt))
{
EOF
case "$host" in
lt_dump_script (stdout);
return 0;
}
- if (strcmp (argv[i], debug_opt) == 0)
+ if (STREQ (argv[i], debug_opt))
{
lt_debug = 1;
continue;
}
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ if (STREQ (argv[i], ltwrapper_option_prefix))
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
if (patlen <= len)
{
str += len - patlen;
- if (strcmp (str, pat) == 0)
+ if (STREQ (str, pat))
*str = '\0';
}
return str;
local-checks-to-fix = \
sc_prohibit_always-defined_macros \
sc_prohibit_always_true_header_tests \
- sc_prohibit_strcmp \
sc_prohibit_test_minus_ao \
sc_prohibit_undesirable_word_seq \
sc_require_config_h \
# List syntax-check exempted files.
exclude_file_name_regexp--sc_error_message_uppercase = \
^$(_build-aux)/cvsu$$
+exclude_file_name_regexp--sc_prohibit_strcmp = \
+ ^(doc/libtool.texi|tests/.*demo/.*\.c)$$
+++ /dev/null
-/Makefile.am
-/dummy.c
/* 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)
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.
while (symbol->name)
{
- if (streq (symbol->name, name))
+ if (STREQ (symbol->name, name))
{
return symbol->address;
}
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;
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)
assert (vtable);
- return streq (vtable->name, name) ? (void *) item : NULL;
+ return STREQ (vtable->name, name) ? (void *) item : NULL;
}
{
if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */
|| (handle->info.filename && filename
- && streq (handle->info.filename, filename)))
+ && STREQ (handle->info.filename, filename)))
{
break;
}
{
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;
}
}
/* 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;
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
))
{
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;
}
#include <stdio.h>
#include "slist.h"
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
void *find_string (SList *item, void *data)
{
- if (data != NULL && !strcmp ((const char *) item->userdata, (const char *)data))
+ if (data != NULL && STREQ ((const char *) item->userdata, (const char *)data))
return item;
else
return NULL;
assert (slist_find (list, find_string, (void *) "foo10") == NULL);
item = (SList *) slist_find (list, find_string, (void *) "foo1");
assert (item != NULL);
- assert (!strcmp ((const char *) item->userdata, "foo1"));
+ assert (STREQ ((const char *) item->userdata, "foo1"));
item = slist_nth (list, 10);
- assert (item != NULL && !strcmp ((const char *) item->userdata, "foo0"));
+ assert (item != NULL && STREQ ((const char *) item->userdata, "foo0"));
puts ("list as inserted:");
slist_foreach (list, print_item, NULL);
slist_foreach (list, print_item, NULL);
item = slist_nth (list, 1);
- assert (item != NULL && !strcmp ((const char *) item->userdata, "foo0"));
+ assert (item != NULL && STREQ ((const char *) item->userdata, "foo0"));
assert (10 == slist_length (list));
/* slist_tail is the second item, not the last one */
item = slist_tail (list);
- assert (item != NULL && !strcmp ((const char *) item->userdata, "foo1"));
+ assert (item != NULL && STREQ ((const char *) item->userdata, "foo1"));
assert (slist_tail (slist_nth (list, 10)) == NULL);
list_save = list;
item = slist_remove (&list, find_string, (void *) "foo5");
assert (list_save == list);
- assert (item != NULL && !strcmp (data = (char *) slist_unbox (item), "foo5"));
+ assert (item != NULL && STREQ (data = (char *) slist_unbox (item), "foo5"));
free (data);
list_save = list;
item = slist_remove (&list, find_string, (void *) "foo9");
assert (list_save == list);
- assert (item != NULL && !strcmp (data = (char *) slist_unbox (item), "foo9"));
+ assert (item != NULL && STREQ (data = (char *) slist_unbox (item), "foo9"));
free (data);
list_save = list;
item = slist_remove (&list, find_string, (void *) "foo0");
assert (list_save != list);
- assert (item != NULL && !strcmp (data = (char *) slist_unbox (item), "foo0"));
+ assert (item != NULL && STREQ (data = (char *) slist_unbox (item), "foo0"));
free (data);
list_save = list;