From 1f786424c1b990e4fafac390de3243f33a4ed46d Mon Sep 17 00:00:00 2001 From: Simon Rose <simon.rose@ess.eu> Date: Thu, 17 Nov 2022 17:26:10 +0100 Subject: [PATCH] Remove unneeded comparison results EXACT and TESTVERS --- require-ess/src/require.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/require-ess/src/require.c b/require-ess/src/require.c index af42436a..e099845a 100644 --- a/require-ess/src/require.c +++ b/require-ess/src/require.c @@ -594,9 +594,7 @@ int libversionShow(const char *outfile) { } #define MISMATCH -1 -#define EXACT 0 #define MATCH 1 -#define TESTVERS 2 #define HIGHER 3 #define debug(...) \ @@ -958,13 +956,6 @@ static int require_priv( if (loaded) { /* Library already loaded. Check Version. */ switch (compareVersions(loaded, version, FALSE)) { - case TESTVERS: - if (version) - printf( - "Warning: Module %s test version %s already loaded where %s was " - "requested\n", - module, loaded, version); - case EXACT: case MATCH: printf("Module %s version %s already loaded\n", module, loaded); break; @@ -1030,9 +1021,7 @@ static int require_priv( currentFilename, version); switch ((status = compareVersions(currentFilename, version, FALSE))) { - case TESTVERS: /* test version found */ - case EXACT: /* exact match found */ - case MATCH: /* all given numbers match. */ + case MATCH: /* all given numbers match. */ { someArchFound = 1; @@ -1059,15 +1048,6 @@ static int require_priv( continue; } - if (status == EXACT) { - if (requireDebug) - printf("require: %s %s matches %s exactly\n", module, - currentFilename, version); - /* We are done. */ - end = NULL; - break; - } - /* Is it higher than the one we found before? */ if (found && requireDebug) printf( @@ -1093,7 +1073,7 @@ static int require_priv( continue; } } - /* we have found something (EXACT or MATCH) */ + /* we have found something */ free(founddir); /* filename = "<dirname>/[dirlen]<module>/[modulediroffs]..." */ if (asprintf(&founddir, "%.*s%s", modulediroffs, filename, @@ -1101,7 +1081,6 @@ static int require_priv( return errno; /* founddir = "<dirname>/[dirlen]<module>/[modulediroffs]<version>" */ found = founddir + modulediroffs; /* version part in the path */ - if (status == EXACT) break; } END_DIR_LOOP } -- GitLab