Changeset 08d24b0 for core/c


Ignore:
Timestamp:
Jan 18, 2011 2:05:26 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ff520b7
Parents:
18119890
Message:

remove nativeDoubleValue(), update jbigi README

Location:
core/c/jbigi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/c/jbigi/README

    r18119890 r08d24b0  
    1010
    1111Linux-specific information:
     12===========================
    1213Some linux distributions comes bundled with GMP.
    13 There is currently no out-of-the-box support for this in the current build-scripts.
     14Try 'locate lib/libgmp.so' to see.
     15If so, install the the libgmp3-dev debian package to get the libgmp headers.
     16Then export I2P=/path/to/your/i2p/install.
     17Then do 'build.sh dynamic'. This will do a quick build using your installed libgmp library
     18and then test it and the jbigi in your I2P installation to see which is faster.
     19
     20If the new jbigi is slower, then run 'build.sh' (without the 'dynamic'), which will download
     21the 4.3.1 libgmp library, build, and test that.
     22
    1423
    1524Windows-specific information:
     25=============================
    1626The best way of building the jbigi dll's is to install Mingw {URL} and msys {URL}.
    1727The combination of these two should be able to run the included build-scripts without modifications.
  • core/c/jbigi/jbigi/src/jbigi.c

    r18119890 r08d24b0  
    5656
    5757        return jresult;
    58 }
    59 
    60 /******** nativeDoubleValue() */
    61 /*
    62  * Class:     net_i2p_util_NativeBigInteger
    63  * Method:    nativeDoubleValue
    64  * Signature: ([B)D
    65  *
    66  * From the Javadoc:
    67  *
    68  * Converts a BigInteger byte-array to a 'double'
    69  * @param ba Big endian twos complement representation of the BigInteger to convert to a double
    70  * @return The plain double-value represented by 'ba'
    71  */
    72 JNIEXPORT jdouble JNICALL Java_net_i2p_util_NativeBigInteger_nativeDoubleValue
    73 (JNIEnv * env, jclass cls, jbyteArray jba){
    74             /* 1) Convert the bytearray BigInteger value into the format libgmp understands
    75          * 2) Call libgmp's mpz_get_d.
    76          * 3) Convert libgmp's result into a big endian twos complement number.
    77          */
    78         mpz_t mval;
    79                 jdouble retval;
    80         convert_j2mp(env, jba, &mval);
    81 
    82                 retval = mpz_get_d(mval);
    83                 mpz_clear(mval);
    84                 return retval;
    8558}
    8659
Note: See TracChangeset for help on using the changeset viewer.