Changeset 7693 for trunk/projects


Ignore:
Timestamp:
04/12/11 15:16:15 (9 years ago)
Author:
aivar
Message:

Include file method signatures weren't up to date. The c file needed to declare all variables at the top of the function (seems msvc is stricter/older standard regarding this isssue).

Location:
trunk/projects/slim-curve/src/main/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-curve/src/main/c/loci_curvefitter_SLIMCurveFitter.c

    r7691 r7693  
    1313        jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 
    1414 
     15    jdouble *y_array; 
     16    jdouble *instr_array; 
     17    jdouble *sig_array; 
     18    jdouble *fitted_array; 
     19    jdouble *z_ref; 
     20    jdouble *a_ref; 
     21    jdouble *tau_ref; 
     22    jdouble *chi_square_ref; 
     23    int return_value; 
     24 
    1525    // convert the arrays 
    16     jdouble *y_array = (*env)->GetDoubleArrayElements(env, y, 0); 
    17     jdouble *instr_array = NULL; 
     26    y_array = (*env)->GetDoubleArrayElements(env, y, 0); 
     27    instr_array = NULL; 
    1828    if (NULL != instr) { 
    1929        instr_array  = (*env)->GetDoubleArrayElements(env, instr, 0); 
    2030    } 
    21     jdouble *sig_array = NULL; 
     31    sig_array = NULL; 
    2232    if (NULL != sig) { 
    2333        sig_array    = (*env)->GetDoubleArrayElements(env, sig, 0); 
    2434    } 
    25     jdouble *fitted_array = (*env)->GetDoubleArrayElements(env, fitted, 0); 
     35    fitted_array = (*env)->GetDoubleArrayElements(env, fitted, 0); 
    2636 
    2737    // also handle double by reference as arrays 
    28     jdouble *z_ref = (*env)->GetDoubleArrayElements(env, z, 0); 
    29     jdouble *a_ref = (*env)->GetDoubleArrayElements(env, z, 0); 
    30     jdouble *tau_ref = (*env)->GetDoubleArrayElements(env, tau, 0); 
    31     jdouble *chi_square_ref = (*env)->GetDoubleArrayElements(env, chi_square, 0); 
     38    z_ref = (*env)->GetDoubleArrayElements(env, z, 0); 
     39    a_ref = (*env)->GetDoubleArrayElements(env, z, 0); 
     40    tau_ref = (*env)->GetDoubleArrayElements(env, tau, 0); 
     41    chi_square_ref = (*env)->GetDoubleArrayElements(env, chi_square, 0); 
    3242 
    33     int return_value = RLD_fit(x_inc, y_array, fit_start, fit_end, 
     43    return_value = RLD_fit(x_inc, y_array, fit_start, fit_end, 
    3444            instr_array, n_instr, sig_array, z_ref, a_ref, tau_ref, 
    3545            fitted_array, chi_square_ref, chi_square_target); 
     
    6575        jdoubleArray fitted, jdoubleArray chi_square, jdouble chi_square_target) { 
    6676 
     77    jdouble *y_array; 
     78    jdouble *instr_array; 
     79    jdouble *sig_array; 
     80    jdouble *param_array; 
     81    jint *param_free_array; 
     82    jdouble *fitted_array; 
     83    jdouble *chi_square_ref; 
     84    int return_value; 
     85 
    6786    // convert the arrays 
    68     jdouble *y_array = (*env)->GetDoubleArrayElements(env, y, 0); 
    69     jdouble *instr_array = NULL; 
     87    y_array = (*env)->GetDoubleArrayElements(env, y, 0); 
     88    instr_array = NULL; 
    7089    if (NULL != instr) { 
    7190        instr_array  = (*env)->GetDoubleArrayElements(env, instr, 0); 
    7291    } 
    73     jdouble *sig_array = NULL; 
     92    sig_array = NULL; 
    7493    if (NULL != sig) { 
    7594        sig_array    = (*env)->GetDoubleArrayElements(env, sig, 0); 
    7695    } 
    77     jdouble *param_array = (*env)->GetDoubleArrayElements(env, param, 0); 
    78     jint *param_free_array = (*env)->GetIntArrayElements(env, param_free, 0); 
    79     jdouble *fitted_array = (*env)->GetDoubleArrayElements(env, fitted, 0); 
     96    param_array = (*env)->GetDoubleArrayElements(env, param, 0); 
     97    param_free_array = (*env)->GetIntArrayElements(env, param_free, 0); 
     98    fitted_array = (*env)->GetDoubleArrayElements(env, fitted, 0); 
    8099 
    81100    // also handle double by reference as array 
    82     jdouble *chi_square_ref = (*env)->GetDoubleArrayElements(env, chi_square, 0); 
     101    chi_square_ref = (*env)->GetDoubleArrayElements(env, chi_square, 0); 
    83102 
    84     int return_value = LMA_fit(x_inc, y_array, fit_start, fit_end, 
     103    return_value = LMA_fit(x_inc, y_array, fit_start, fit_end, 
    85104            instr_array, n_instr, sig_array, param_array, param_free_array, n_param, 
    86105            fitted_array, chi_square_ref, chi_square_target); 
  • trunk/projects/slim-curve/src/main/c/loci_curvefitter_SLIMCurveFitter.h

    r7691 r7693  
    1212 * Class:     loci_curvefitter_SLIMCurveFitter 
    1313 * Method:    RLD_fit 
    14  * Signature: (D[DII[DI[DLjava/lang/Double;Ljava/lang/Double;Ljava/lang/Double;[DLjava/lang/Double;D)I 
     14 * Signature: (D[DII[DI[D[D[D[D[D[DD)I 
    1515 */ 
    1616JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_RLD_1fit 
    17   (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jobject, jobject, jobject, jdoubleArray, jobject, jdouble); 
     17  (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdoubleArray, jdouble); 
    1818 
    1919/* 
    2020 * Class:     loci_curvefitter_SLIMCurveFitter 
    2121 * Method:    LMA_fit 
    22  * Signature: (D[DII[DI[D[D[II[DLjava/lang/Double;D)I 
     22 * Signature: (D[DII[DI[D[D[II[D[DD)I 
    2323 */ 
    2424JNIEXPORT jint JNICALL Java_loci_curvefitter_SLIMCurveFitter_LMA_1fit 
    25   (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, jobject, jdouble); 
     25  (JNIEnv *, jobject, jdouble, jdoubleArray, jint, jint, jdoubleArray, jint, jdoubleArray, jdoubleArray, jintArray, jint, jdoubleArray, jdoubleArray, jdouble); 
    2626 
    2727#ifdef __cplusplus 
Note: See TracChangeset for help on using the changeset viewer.