summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch')
-rw-r--r--meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch b/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
new file mode 100644
index 000000000..7699017f7
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
@@ -0,0 +1,49 @@
1From 89071cbc8d3ab9a15503f397580b7590338e5e91 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Jul 2017 17:23:45 -0700
4Subject: [PATCH] utils: Use c99 compiler independent types
5
6Make it portable across different platforms
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 utils.h | 13 +++++++------
11 1 file changed, 7 insertions(+), 6 deletions(-)
12
13diff --git a/utils.h b/utils.h
14index 10dce58..73bba92 100644
15--- a/utils.h
16+++ b/utils.h
17@@ -3,6 +3,7 @@
18 #include <stdio.h>
19 #include <errno.h>
20 #include <string.h>
21+#include <stdint.h>
22
23 extern long buffering_write(int outf, char *buffer, long num);
24 extern int buffering_close(int fd);
25@@ -18,15 +19,15 @@ static inline int bigendianp(void){
26 }
27
28 static inline int32_t swap32(int32_t x){
29- return((((u_int32_t)x & 0x000000ffU) << 24) |
30- (((u_int32_t)x & 0x0000ff00U) << 8) |
31- (((u_int32_t)x & 0x00ff0000U) >> 8) |
32- (((u_int32_t)x & 0xff000000U) >> 24));
33+ return((((uint32_t)x & 0x000000ffU) << 24) |
34+ (((uint32_t)x & 0x0000ff00U) << 8) |
35+ (((uint32_t)x & 0x00ff0000U) >> 8) |
36+ (((uint32_t)x & 0xff000000U) >> 24));
37 }
38
39 static inline int16_t swap16(int16_t x){
40- return((((u_int16_t)x & 0x00ffU) << 8) |
41- (((u_int16_t)x & 0xff00U) >> 8));
42+ return((((uint16_t)x & 0x00ffU) << 8) |
43+ (((uint16_t)x & 0xff00U) >> 8));
44 }
45
46 #if BYTE_ORDER == LITTLE_ENDIAN
47--
482.13.2
49