From: zooko Date: Sat, 22 Dec 2007 00:11:03 +0000 (+0530) Subject: zfec: fix breakage on VS 2003 due to recent re-arrangement of #define block, and... X-Git-Url: https://git.rkrishnan.org/%5B/frontends/%22file:/%22doc.html/$rel_link?a=commitdiff_plain;h=a2aaa6ac3153ad4db17185497262e58d1bc87b7b;p=tahoe-lafs%2Fzfec.git zfec: fix breakage on VS 2003 due to recent re-arrangement of #define block, and refactor it a bit, and remove a use of 'inline' darcs-hash:d4a0433fdd5ee2ec899c176a5ee6a67fb360cabc --- diff --git a/zfec/zfec/fec.c b/zfec/zfec/fec.c index 9b1e5fa..3f852c9 100644 --- a/zfec/zfec/fec.c +++ b/zfec/zfec/fec.c @@ -34,7 +34,7 @@ static gf inverse[256]; /* inverse of field elem. */ * modnn(x) computes x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, * without a slow divide. */ -static inline gf +static gf modnn(int x) { while (x >= 255) { x -= 255; diff --git a/zfec/zfec/fec.h b/zfec/zfec/fec.h index 4004b72..db69d5f 100644 --- a/zfec/zfec/fec.h +++ b/zfec/zfec/fec.h @@ -12,6 +12,12 @@ typedef struct { gf* enc_matrix; } fec_t; +#if defined(_MSC_VER) +// actually, some of the flavors (i.e. Enterprise) do support restrict +//#define restrict __restrict +#define restrict +#endif + /** * param k the number of blocks required to reconstruct * param m the total number of blocks created @@ -37,10 +43,6 @@ void fec_encode(const fec_t* code, const gf*restrict const*restrict const src, g void fec_decode(const fec_t* code, const gf*restrict const*restrict const inpkts, gf*restrict const*restrict const outpkts, const unsigned*restrict const index, size_t sz); #if defined(_MSC_VER) -// actually, some of the flavors (i.e. Enterprise) do support restrict -//#define restrict __restrict -#define restrict -#define inline __inline #define alloca _alloca #else #ifdef __GNUC__