tools/mtd-utils: avoid linking libm statically
[openwrt.git] / tools / mtd-utils / patches / 300-libfec_use_standard_unsigned_long.patch
1 --- a/lib/libfec.c
2 +++ b/lib/libfec.c
3 @@ -61,8 +61,6 @@ struct timeval {
4  };
5  #define gettimeofday(x, dummy) { (x)->ticks = clock() ; }
6  #define DIFF_T(a,b) (1+ 1000000*(a.ticks - b.ticks) / CLOCKS_PER_SEC )
7 -typedef unsigned long u_long ;
8 -typedef unsigned short u_short ;
9  #else /* typically, unix systems */
10  #include <sys/time.h>
11  #define DIFF_T(a,b) \
12 @@ -75,12 +73,12 @@ typedef unsigned short u_short ;
13         t = x.tv_usec + 1000000* (x.tv_sec & 0xff ) ; \
14         }
15  #define TOCK(t) \
16 -       { u_long t1 ; TICK(t1) ; \
17 +       { unsigned long t1 ; TICK(t1) ; \
18           if (t1 < t) t = 256000000 + t1 - t ; \
19           else t = t1 - t ; \
20           if (t == 0) t = 1 ;}
21  
22 -u_long ticks[10];      /* vars for timekeeping */
23 +unsigned long ticks[10];       /* vars for timekeeping */
24  #else
25  #define DEB(x)
26  #define DDB(x)
27 @@ -625,7 +623,7 @@ init_fec(void)
28  #define FEC_MAGIC      0xFECC0DEC
29  
30  struct fec_parms {
31 -    u_long magic ;
32 +    unsigned long magic ;
33      int k, n ;         /* parameters of the code */
34      gf *enc_matrix ;
35  } ;