[vlc-commits] compat: remove no longer used ffsll()
Rémi Denis-Courmont
git at videolan.org
Sun Feb 25 20:40:06 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 25 21:39:23 2018 +0200| [833d3e8f91b5b7964a16fcd8ee0191e2cbebd31d] | committer: Rémi Denis-Courmont
compat: remove no longer used ffsll()
We don't need two ways to count trailing zeroes.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=833d3e8f91b5b7964a16fcd8ee0191e2cbebd31d
---
compat/ffsll.c | 33 ---------------------------------
configure.ac | 2 +-
include/vlc_fixups.h | 4 ----
3 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/compat/ffsll.c b/compat/ffsll.c
deleted file mode 100644
index 428eaccd76..0000000000
--- a/compat/ffsll.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************************
- * ffsll.c: GNU ffsll() replacement
- *****************************************************************************
- * Copyright © 2015 Rémi Denis-Courmont
- *
- * 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 <limits.h>
-
-int ffsll(long long x)
-{
- for (unsigned i = 0; i < sizeof (x) * CHAR_BIT; i++)
- if ((x >> i) & 1)
- return i + 1;
- return 0;
-}
diff --git a/configure.ac b/configure.ac
index 6573e9b99a..62af699452 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,7 +585,7 @@ need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale])
-AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
+AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 7f819bbb27..0bd844231d 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -164,10 +164,6 @@ int vasprintf (char **, const char *, va_list);
#endif
/* string.h */
-#ifndef HAVE_FFSLL
-int ffsll(long long);
-#endif
-
#ifndef HAVE_MEMRCHR
void *memrchr(const void *, int, size_t);
#endif
More information about the vlc-commits
mailing list