Fix libdvbv5 endianess function for embedded toolchains
PATCH 1/1 Fix libdvbv5 endianess function for embedded toolchains
Hello,
the following patch fixes compilation of libdvbv5 with the Code Sourcery ARM toolchain. It replaces the missing be16toh and be32toh with the available ntohs and ntohl.
IMHO the bswap16/32 macro names should be replaced because the current name suggests unconditional swap regardless of the host architecture.
Thanks,
Gregor
Gregor Jasny (1):
libdvbv5: Fix byte swapping for embedded toolchains
lib/include/descriptors.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 1/1 libdvbv5: Fix byte swapping for embedded toolchains
Reported-by "Lad, Prabhakar" <[email protected]>
Signed-off-by Gregor Jasny <[email protected]>
--- lib/include/descriptors.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/include/descriptors.h +3 -3
@@ -25,7 +25,7 @@#ifndef _DESCRIPTORS_H#define _DESCRIPTORS_H -#include <endian.h> +#include <arpa/inet.h> #include <unistd.h> #include <stdint.h>
@@ -46,11 +46,11 @@ extern char *default_charset;extern char *output_charset;#define bswap16 (b) do {\ - b = be16toh(b); \ + b = ntohs(b); \ } while (0)#define bswap32 (b) do {\ - b = be32toh(b); \ + b = ntohl(b); \ } while (0)struct dvb_desc {
Signature · 1 line
1.7.10.4
Re: [PATCH] libdvbv5: Fix byte swapping for embedded toolchains
Hi Gregor,
Thanks for the patch.
Quoted 2 lines · Gregor Jasny
Reported-by "Lad, Prabhakar" <[email protected]>Signed-off-by Gregor Jasny <[email protected]>
Acked-by Prabhakar Lad <[email protected]>
Thx,
--Prabhakar
Quoted 32 lines
--- lib/include/descriptors.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/include/descriptors.h +3
-3@@ -25,7 +25,7 @@#ifndef _DESCRIPTORS_H#define _DESCRIPTORS_H -#include <endian.h> +#include <arpa/inet.h> #include <unistd.h> #include <stdint.h> @@ -46,11 +46,11 @@ extern char *default_charset;extern char *output_charset;#define bswap16 (b) do {\ - b = be16toh(b); \ + b = ntohs(b); \ } while (0)#define bswap32 (b) do {\ - b = be32toh(b); \ + b = ntohl(b); \ } while (0)struct dvb_desc {