From: Imre Kaloz <kaloz@openwrt.org>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] mtd-utils: libfec: use standard C type instead of u_long
Date: Mon, 4 May 2015 15:36:34 +0200 [thread overview]
Message-ID: <1430746594-5867-1-git-send-email-kaloz@openwrt.org> (raw)
Fixes compilation on hosts with the musl C library.
Also drops the unused u_short typedef.
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
---
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.1.0
next reply other threads:[~2015-05-04 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 13:36 Imre Kaloz [this message]
2015-05-28 23:38 ` [PATCH] mtd-utils: libfec: use standard C type instead of u_long Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430746594-5867-1-git-send-email-kaloz@openwrt.org \
--to=kaloz@openwrt.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox