[vlc-commits] Remove untested strncasecmp replacement

Rafaël Carré git at videolan.org
Tue Jan 15 09:37:00 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 15 09:29:33 2013 +0100| [f5e991c74856965a224982aa7eb594b980e71c73] | committer: Rafaël Carré

Remove untested strncasecmp replacement

Since it never built, it was never needed on any platform

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5e991c74856965a224982aa7eb594b980e71c73
---

 compat/strncasecmp.c                    |   44 -------------------------------
 configure.ac                            |    2 +-
 extras/buildsystem/cmake/config.h.cmake |    1 -
 include/vlc_fixups.h                    |    4 ---
 4 files changed, 1 insertion(+), 50 deletions(-)

diff --git a/compat/strncasecmp.c b/compat/strncasecmp.c
deleted file mode 100644
index c968a7c..0000000
--- a/compat/strncasecmp.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * strncasecmp.c: POSIX strncasecmp() replacement
- *****************************************************************************
- * Copyright © 1998-2009 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-int strncasecmp (const char *s1, const char *s2)
-{
-#ifdef HAVE_STRNICMP
-    return strnicmp (s1, s2);
-#else
-    for (size_t i = 0; i < n; i++)
-    {
-        unsigned char c1 = s1[i], c2 = s2[i];
-        int d = tolower (c1) - tolower (c2);
-        if (d || !c1)
-            return d;
-        assert (c2);
-    }
-    return 0;
-#endif
-}
diff --git a/configure.ac b/configure.ac
index 566a9f1..b0639e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -492,7 +492,7 @@ need_libc=false
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
-AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r inet_pton lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
diff --git a/extras/buildsystem/cmake/config.h.cmake b/extras/buildsystem/cmake/config.h.cmake
index 224adc3..f337e8a 100644
--- a/extras/buildsystem/cmake/config.h.cmake
+++ b/extras/buildsystem/cmake/config.h.cmake
@@ -242,7 +242,6 @@
 #cmakedefine HAVE_STRING_H
 #cmakedefine HAVE_STRISTR
 #cmakedefine HAVE_STRLCPY
-#cmakedefine HAVE_STRNCASECMP
 #cmakedefine HAVE_STRNDUP
 #cmakedefine HAVE_STRNICMP
 #cmakedefine HAVE_STRNLEN
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 9d20a2d..4340583 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -118,10 +118,6 @@ char *strcasestr (const char *, const char *);
 char *strdup (const char *);
 #endif
 
-#ifndef HAVE_STRNCASECMP
-int strncasecmp (const char *, const char *, size_t);
-#endif
-
 #ifndef HAVE_STRVERSCMP
 int strverscmp (const char *, const char *);
 #endif



More information about the vlc-commits mailing list