summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mtd/mtd-utils/0001-mtd-utils-libfec-use-standard-C-type-instead-of-u_lo.patch
blob: 46ed956d0eb217e69942d6430c28bc51a7ebffe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 26cc709291fc6c5d2e45b26c602407706d9142df Mon Sep 17 00:00:00 2001
From: Imre Kaloz <kaloz@openwrt.org>
Date: Mon, 4 May 2015 15:36:34 +0200
Subject: [PATCH] mtd-utils: libfec: use standard C type instead of u_long

Fixes compilation on hosts with the musl C library.
Also drops the unused u_short typedef.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
Upstream-Status: Backport

 lib/libfec.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/libfec.c b/lib/libfec.c
index ff5a127..bf68381 100644
--- a/lib/libfec.c
+++ b/lib/libfec.c
@@ -61,8 +61,6 @@ struct timeval {
 };
 #define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
 #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
-typedef unsigned long u_long ;
-typedef unsigned short u_short ;
 #else /* typically, unix systems */
 #include <sys/time.h>
 #define DIFF_T(a,b) \
@@ -75,12 +73,12 @@ typedef unsigned short u_short ;
 	t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \
 	}
 #define TOCK(t) \
-	{ u_long t1 ; TICK(t1) ; \
+	{ unsigned long t1 ; TICK(t1) ; \
 	  if (t1 < t) t = 256000000 + t1 - t ; \
 	  else t = t1 - t ; \
 	  if (t == 0) t = 1 ;}
 
-u_long ticks[10];	/* vars for timekeeping */
+unsigned long ticks[10];	/* vars for timekeeping */
 #else
 #define DEB(x)
 #define DDB(x)
@@ -625,7 +623,7 @@ init_fec(void)
 #define FEC_MAGIC	0xFECC0DEC
 
 struct fec_parms {
-    u_long magic ;
+    unsigned long magic ;
     int k, n ;		/* parameters of the code */
     gf *enc_matrix ;
 } ;
-- 
2.6.0