Author: j16sdiz
Date: 2009-04-17 18:20:06 +0000 (Fri, 17 Apr 2009)
New Revision: 26950

Modified:
   trunk/contrib/fec/src/csrc/Makefile
   trunk/contrib/fec/src/csrc/fec.c
   trunk/contrib/fec/src/csrc/fec.h
   trunk/contrib/fec/src/csrc/fec16-jinterf.c
   trunk/contrib/fec/src/csrc/fec8-jinterf.c
Log:
Make all prototype agree

Modified: trunk/contrib/fec/src/csrc/Makefile
===================================================================
--- trunk/contrib/fec/src/csrc/Makefile 2009-04-17 18:19:52 UTC (rev 26949)
+++ trunk/contrib/fec/src/csrc/Makefile 2009-04-17 18:20:06 UTC (rev 26950)
@@ -17,8 +17,8 @@
 ALLSRCS= $(SRCS) $(DOCS) fec.h
 LDFLAGS?= --add-stdcall-alias #-melf_i386
 
-fec: libfec8.so libfec16.so test.o
-       $(CC) $(CFLAGS) -o fec fec8.o test.o
+fec: libfec8.so libfec16.so test.c
+       $(CC) $(CFLAGS) -DGF_BITS=8 -o fec fec8.o test.c
 
 libfec8.so: fec8.o fec8-jinterf.o
        $(CC) $(LDFLAGS) -shared fec8-jinterf.o fec8.o -o libfec8.so

Modified: trunk/contrib/fec/src/csrc/fec.c
===================================================================
--- trunk/contrib/fec/src/csrc/fec.c    2009-04-17 18:19:52 UTC (rev 26949)
+++ trunk/contrib/fec/src/csrc/fec.c    2009-04-17 18:20:06 UTC (rev 26950)
@@ -47,10 +47,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if defined(__GNUC__) || !defined(_WIN32)
-#include <stdint.h>
-#endif
 
+#include "fec.h"
+
 /*
  * compatibility stuff
  */
@@ -114,11 +113,6 @@
 #if (GF_BITS < 2  && GF_BITS >16)
 #error "GF_BITS must be 2 .. 16"
 #endif
-#if (GF_BITS <= 8)
-typedef uint8_t gf;
-#else
-typedef uint16_t gf;
-#endif
 
 #define        GF_SIZE ((1 << GF_BITS) - 1)    /* powers of \alpha */
 
@@ -589,7 +583,7 @@
 
 static int fec_initialized = 0 ;
 
-static void init_fec()
+void init_fec()
 {
     TICK(ticks[0]);
     generate_gf();
@@ -610,12 +604,6 @@
 
 #define FEC_MAGIC      0xFECC0DEC
 
-struct fec_parms {
-    unsigned long magic ;
-    int k, n ;         /* parameters of the code */
-    gf *enc_matrix ;
-} ;
-
 void
 fec_free(struct fec_parms *p)
 {

Modified: trunk/contrib/fec/src/csrc/fec.h
===================================================================
--- trunk/contrib/fec/src/csrc/fec.h    2009-04-17 18:19:52 UTC (rev 26949)
+++ trunk/contrib/fec/src/csrc/fec.h    2009-04-17 18:20:06 UTC (rev 26950)
@@ -39,14 +39,30 @@
  * This is the only parameter you may want to change.
  */
 #ifndef GF_BITS
-#define GF_BITS  8     /* code over GF(2**GF_BITS) - change to suit */
+#error GF_BITS NOT DEFINED!
 #endif
 
+#if defined(__GNUC__) || !defined(_WIN32)
+#include <stdint.h>
+#endif
+
+#if (GF_BITS <= 8)
+typedef uint8_t gf;
+#else
+typedef uint16_t gf;
+#endif
+
+struct fec_parms {
+    unsigned long magic ;
+    int k, n ;         /* parameters of the code */
+    gf *enc_matrix ;
+} ;
+
 #define        GF_SIZE ((1 << GF_BITS) - 1)    /* powers of \alpha */
-void fec_free(void *p) ;
-void * fec_new(int k, int n) ;
-void init_fec() ;
-void fec_encode(void *code, void *src[], void *dst, int index, int sz) ;
-int fec_decode(void *code, void *pkt[], int index[], int sz) ;
+void fec_free(struct fec_parms *p);
+struct fec_parms * fec_new(int k, int n);
+void init_fec();
+void fec_encode(struct fec_parms *code, gf *src[], gf *fec, int index, int sz);
+int fec_decode(struct fec_parms *code, gf *pkt[], int index[], int sz);
 
 /* end of file */

Modified: trunk/contrib/fec/src/csrc/fec16-jinterf.c
===================================================================
--- trunk/contrib/fec/src/csrc/fec16-jinterf.c  2009-04-17 18:19:52 UTC (rev 
26949)
+++ trunk/contrib/fec/src/csrc/fec16-jinterf.c  2009-04-17 18:20:06 UTC (rev 
26950)
@@ -85,7 +85,7 @@
     }
 
     for (i=0;i<numRet;i++) {
-        fec_encode((void *)(uintptr_t)code, (void **)(uintptr_t)inarr, (void 
*)(uintptr_t)retarr[i], 
+        fec_encode((void *)(uintptr_t)code, (gf **)(uintptr_t)inarr, (void 
*)(uintptr_t)retarr[i], 
                    (int)localIndex[i], (int)packetLength); 
     }
 
@@ -164,7 +164,7 @@
         inarr[i] += localDataOff[i];
     }
 
-    fec_decode((void *)(uintptr_t)code, (void **)(uintptr_t)inarr, (int 
*)(uintptr_t)localWhich, (int)packetLength);
+       fec_decode((struct fec_parms *)(intptr_t)code, (gf **)(intptr_t)inarr, 
(int *)(intptr_t)localWhich, (int)packetLength);
 
     for (i = 0; i < k; i++) {
         inarr[i] -= localDataOff[i];

Modified: trunk/contrib/fec/src/csrc/fec8-jinterf.c
===================================================================
--- trunk/contrib/fec/src/csrc/fec8-jinterf.c   2009-04-17 18:19:52 UTC (rev 
26949)
+++ trunk/contrib/fec/src/csrc/fec8-jinterf.c   2009-04-17 18:20:06 UTC (rev 
26950)
@@ -85,7 +85,7 @@
     }
 
     for (i=0;i<numRet;i++) {
-        fec_encode((void *)(uintptr_t)code, (void **)(uintptr_t)inarr, (void 
*)(uintptr_t)retarr[i], 
+        fec_encode((void *)(uintptr_t)code, (gf **)(uintptr_t)inarr, (void 
*)(uintptr_t)retarr[i], 
                    (int)localIndex[i], (int)packetLength); 
     }
 
@@ -164,7 +164,7 @@
         inarr[i] += localDataOff[i];
     }
 
-    fec_decode((void *)(intptr_t)code, (void **)(intptr_t)inarr, (int 
*)(intptr_t)localWhich, (int)packetLength);
+       fec_decode((struct fec_parms *)(intptr_t)code, (gf **)(intptr_t)inarr, 
(int *)(intptr_t)localWhich, (int)packetLength);
 
     for (i = 0; i < k; i++) {
         inarr[i] -= localDataOff[i];

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to