summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/bswap.h28
-rw-r--r--utils/chroot_realpath.c19
-rw-r--r--utils/ldd.c2
3 files changed, 24 insertions, 25 deletions
diff --git a/utils/bswap.h b/utils/bswap.h
index 7ca267bdd..6e7f7d336 100644
--- a/utils/bswap.h
+++ b/utils/bswap.h
@@ -32,23 +32,19 @@
#ifdef __linux__
#include <byteswap.h>
#else
-#include <string.h>
-static __inline__ uint32_t bswap_32(uint32_t x)
- {
- uint32_t res;
- swab((void*)&x, (void*)&res, sizeof(uint32_t));
-
- return res;
- }
-
-static __inline__ uint16_t bswap_16(uint16_t x)
- {
- uint16_t res;
-
- swab((void*)&x, (void*)&res, sizeof(uint16_t));
- return res;
- }
+static inline uint32_t bswap_32(uint32_t x)
+{
+ return ((((x) & 0xff00) >> 8) | \
+ (((x) & 0x00ff) << 8));
+}
+static inline uint16_t bswap_16(uint16_t x)
+{
+ return ((((x) & 0xff000000) >> 24) | \
+ (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | \
+ (((x) & 0x000000ff) << 24));
+}
#endif
#endif
diff --git a/utils/chroot_realpath.c b/utils/chroot_realpath.c
index 43ce9a528..dd33c3fc0 100644
--- a/utils/chroot_realpath.c
+++ b/utils/chroot_realpath.c
@@ -2,15 +2,20 @@
* chroot_realpath.c -- reslove pathname as if inside chroot
* Based on realpath.c Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
+ * 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,
+ * This library 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 Library Public License for more details.
+ * 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 library; see the file COPYING.LIB. If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
*
* 2005/09/12: Dan Howell (modified from realpath.c to emulate chroot)
*/
diff --git a/utils/ldd.c b/utils/ldd.c
index a857127a8..319f0bfdc 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -26,8 +26,6 @@
*
*/
-
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>