Author: nextgens
Date: 2006-12-16 22:13:18 +0000 (Sat, 16 Dec 2006)
New Revision: 11455

Modified:
   branches/native_fec/com_onionnetworks_fec_Native8Code.h
   branches/native_fec/fec.c
   branches/native_fec/fec8-jinterf.c
Log:
First working version of the FEC code on x86_64, thanks to JFlesch for helping

Modified: branches/native_fec/com_onionnetworks_fec_Native8Code.h
===================================================================
--- branches/native_fec/com_onionnetworks_fec_Native8Code.h     2006-12-16 
20:36:23 UTC (rev 11454)
+++ branches/native_fec/com_onionnetworks_fec_Native8Code.h     2006-12-16 
22:13:18 UTC (rev 11455)
@@ -7,38 +7,37 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-/* Inaccessible static: initialized */
 /*
  * Class:     com_onionnetworks_fec_Native8Code
  * Method:    nativeEncode
- * Signature: (I[[B[I[I[[B[III)V
+ * Signature: (J[[B[I[I[[B[III)V
  */
 JNIEXPORT void JNICALL Java_com_onionnetworks_fec_Native8Code_nativeEncode
-  (JNIEnv *, jobject, jint, jobjectArray, jintArray, jintArray, jobjectArray, 
jintArray, jint, jint);
+  (JNIEnv *, jobject, jlong, jobjectArray, jintArray, jintArray, jobjectArray, 
jintArray, jint, jint);

 /*
  * Class:     com_onionnetworks_fec_Native8Code
  * Method:    nativeDecode
- * Signature: (I[[B[I[III)V
+ * Signature: (J[[B[I[III)V
  */
 JNIEXPORT void JNICALL Java_com_onionnetworks_fec_Native8Code_nativeDecode
-  (JNIEnv *, jobject, jint, jobjectArray, jintArray, jintArray, jint, jint);
+  (JNIEnv *, jobject, jlong, jobjectArray, jintArray, jintArray, jint, jint);

 /*
  * Class:     com_onionnetworks_fec_Native8Code
  * Method:    nativeNewFEC
- * Signature: (II)I
+ * Signature: (II)J
  */
-JNIEXPORT jint JNICALL Java_com_onionnetworks_fec_Native8Code_nativeNewFEC
+JNIEXPORT jlong JNICALL Java_com_onionnetworks_fec_Native8Code_nativeNewFEC
   (JNIEnv *, jobject, jint, jint);

 /*
  * Class:     com_onionnetworks_fec_Native8Code
  * Method:    nativeFreeFEC
- * Signature: (I)V
+ * Signature: (J)V
  */
 JNIEXPORT void JNICALL Java_com_onionnetworks_fec_Native8Code_nativeFreeFEC
-  (JNIEnv *, jobject, jint);
+  (JNIEnv *, jobject, jlong);

 #ifdef __cplusplus
 }

Modified: branches/native_fec/fec.c
===================================================================
--- branches/native_fec/fec.c   2006-12-16 20:36:23 UTC (rev 11454)
+++ branches/native_fec/fec.c   2006-12-16 22:13:18 UTC (rev 11455)
@@ -647,7 +647,7 @@
 fec_free(struct fec_parms *p)
 {
     if (p==NULL ||
-       p->magic != ( ( (FEC_MAGIC ^ p->k) ^ p->n) ^ (int)(p->enc_matrix)) ) {
+       p->magic != ( ( (FEC_MAGIC ^ p->k) ^ p->n) ^ (long)(p->enc_matrix)) ) {
        fprintf(stderr, "bad parameters to fec_free\n");
        return ;
     }
@@ -679,7 +679,7 @@
     retval->k = k ;
     retval->n = n ;
     retval->enc_matrix = NEW_GF_MATRIX(n, k);
-    retval->magic = ( ( FEC_MAGIC ^ k) ^ n) ^ (int)(retval->enc_matrix) ;
+    retval->magic = ( ( FEC_MAGIC ^ k) ^ n) ^ (long)(retval->enc_matrix) ;
     tmp_m = NEW_GF_MATRIX(n, k);
     /*
      * fill the matrix with powers of field elements, starting from 0.

Modified: branches/native_fec/fec8-jinterf.c
===================================================================
--- branches/native_fec/fec8-jinterf.c  2006-12-16 20:36:23 UTC (rev 11454)
+++ branches/native_fec/fec8-jinterf.c  2006-12-16 22:13:18 UTC (rev 11455)
@@ -15,7 +15,7 @@
  */
 JNIEXPORT void JNICALL
     Java_com_onionnetworks_fec_Native8Code_nativeEncode
-    (JNIEnv *env, jobject obj, jint code, jobjectArray src, jintArray srcOff,
+    (JNIEnv *env, jobject obj, jlong code, jobjectArray src, jintArray srcOff,
      jintArray index, jobjectArray ret, jintArray retOff, jint k, 
      jint packetLength) {

@@ -120,7 +120,7 @@
  */
 JNIEXPORT void JNICALL
     Java_com_onionnetworks_fec_Native8Code_nativeDecode
-    (JNIEnv *env, jobject obj, jint code, jobjectArray data, jintArray dataOff,
+    (JNIEnv *env, jobject obj, jlong code, jobjectArray data, jintArray 
dataOff,
      jintArray whichdata, jint k, jint packetLength) {

     jint *localWhich, *localDataOff;
@@ -184,17 +184,17 @@

 }

-JNIEXPORT jint JNICALL
+JNIEXPORT jlong JNICALL
     Java_com_onionnetworks_fec_Native8Code_nativeNewFEC
     (JNIEnv * env, jobject obj, jint k, jint n) {

-    return (int)fec_new(k,n); 
+    return (long)fec_new(k,n); 

 }

 JNIEXPORT void JNICALL
     Java_com_onionnetworks_fec_Native8Code_nativeFreeFEC
-    (JNIEnv * env, jobject obj, jint code) {
+    (JNIEnv * env, jobject obj, jlong code) {

     fec_free((void *)code); 



Reply via email to