Ignore:
Timestamp:
Nov 30, 2011 3:10:45 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
72da06f
Parents:
c25f1fa
Message:

Re #5 fixing reflc compilation on MSVC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/refl.c

    r890ac7f1 r533e745  
    1515double re_kernel(double dp[], double q) { 
    1616        int n = dp[0]; 
    17         int i,j,fun_type[n+2]; 
     17        int i,j; 
    1818 
    1919        double scale = dp[1]; 
     
    2323        double background = dp[6]; 
    2424 
    25         double sld[n+2],thick_inter[n+2],thick[n+2],total_thick; 
     25  double total_thick; 
    2626  double nsl=21.0; //nsl = Num_sub_layer: 
    2727  int n_s; 
     
    2929  double sign,erfunc, fun; 
    3030  double pi; 
     31 
     32  double* sld; 
     33  double* thick_inter; 
     34  double* thick; 
     35  int*fun_type; 
     36 
     37  sld = (double*)malloc(n+2); 
     38  thick_inter = (double*)malloc(n+2); 
     39  thick = (double*)malloc(n+2); 
     40  fun_type = (int*)malloc(n+2); 
    3141 
    3242  fun_type[0] = dp[3]; 
     
    119129    R += background; 
    120130 
     131    free(sld); 
     132    free(thick_inter); 
     133    free(thick); 
     134    free(fun_type); 
     135 
    121136    return R; 
    122137 
Note: See TracChangeset for help on using the changeset viewer.