300-libfec_use_standard_unsigned_long.patch 987 B

1234567891011121314151617181920212223242526272829303132333435
  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. -u_long ticks[10]; /* vars for timekeeping */
  22. +unsigned long ticks[10]; /* vars for timekeeping */
  23. #else
  24. #define DEB(x)
  25. #define DDB(x)
  26. @@ -625,7 +623,7 @@ init_fec(void)
  27. #define FEC_MAGIC 0xFECC0DEC
  28. struct fec_parms {
  29. - u_long magic ;
  30. + unsigned long magic ;
  31. int k, n ; /* parameters of the code */
  32. gf *enc_matrix ;
  33. } ;