Ignore:
Timestamp:
May 11, 2016 3:39:08 PM (7 years ago)
Author:
srkline
Message:

Updates for Xcode 7, Toolkit 7, and 64-bit version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/XOP_Dev/MonteCarlo/MonteCarlo.c

    r834 r997  
    3232        double retVal;                          //return value 
    3333 
    34         long imon; 
     34        SInt64 imon; 
    3535        double r1,r2,xCtr,yCtr,sdd,pixSize,thick,wavelength,sig_incoh,sig_sas; 
    36         long ind,index,n_index; 
     36        IndexInt ind,index,n_index; 
    3737        double qmax,theta_max,q0,zpow; 
    38         long n1,n2,n3; 
     38        CountInt n1,n2,n3; 
    3939        double dth,zz,xx,yy,phi; 
    4040        double theta,ran,ll,rr; 
    41         long done,find_theta,err;               //used as logicals 
    42         long xPixel,yPixel; 
     41        int done,find_theta,err;                //used as logicals 
     42        int xPixel,yPixel; 
    4343        double vx,vy,vz,theta_z; 
    4444        double sig_abs,ratio,sig_total; 
    4545        double testQ,testPhi,left,delta,dummy,pi; 
    4646        double sigabs_0,num_bins; 
    47         long NSingleIncoherent,NSingleCoherent,NScatterEvents,incoherentEvent,coherentEvent; 
    48         long NDoubleCoherent,NMultipleScatter,isOn,xCtr_long,yCtr_long; 
    49         long NMultipleCoherent,NCoherentEvents; 
     47        CountInt NSingleIncoherent,NSingleCoherent,NScatterEvents,incoherentEvent,coherentEvent; 
     48        CountInt NDoubleCoherent,NMultipleScatter,isOn,xCtr_long,yCtr_long; 
     49        CountInt NMultipleCoherent,NCoherentEvents; 
    5050        double deltaLam,v1,v2,currWavelength,rsq,fac;           //for simulating wavelength distribution 
    5151        double ssd, sourAp, souXX, souYY, magn;         //source-to-sample, and source Ap radius for initlal trajectory 
     
    6363//      long dataOffset; 
    6464//      long numRows, numColumns; 
    65         long numRows_ran_dev; 
     65        CountInt numRows_ran_dev; 
    6666//      double *dp0, *dp;  
    6767        double value[2];                                // Pointers used for double data. 
    68         long seed; 
    69         long indices[MAX_DIMENSIONS]; 
     68        SInt32 seed; 
     69        IndexInt indices[MAX_DIMENSIONS]; 
    7070         
    7171//      char buf[256]; 
     
    120120        results = (double*)WaveData(p->resultsH); 
    121121         
    122         seed = (long)results[0]; 
     122        seed = (SInt32)results[0]; 
    123123         
    124124        //      sprintf(buf, "input seed = %ld\r", seed); 
     
    132132        seed = 12348765;                //non-negative after that does nothing 
    133133 
    134         imon = (int)inputWave[0]; 
     134        imon = (SInt64)inputWave[0]; 
    135135        r1 = inputWave[1]; 
    136136        r2 = inputWave[2]; 
     
    147147        sourAp = inputWave[13];         // radius, in cm, like r1 and r2         
    148148         
    149         xCtr_long = (long)(xCtr+0.5);   //round() not defined in VC8 
    150         yCtr_long = (long)(yCtr+0.5);   // and is probably wrong to use anyways (returns double!) 
     149        xCtr_long = (CountInt)(xCtr+0.5);       //round() not defined in VC8 
     150        yCtr_long = (CountInt)(yCtr+0.5);       // and is probably wrong to use anyways (returns double!) 
    151151         
    152152        dummy = MDGetWaveScaling(p->ran_devH, 0, &delta, &left);                //0 is the rows 
     
    378378                                                //Choose index for scattering angle array. 
    379379                                                //IND = NINT(THETA_z/DTH + 0.4999999) 
    380                                                 ind = (long)(theta_z/dth + 0.4999999);          //round is eqivalent to nint() 
     380                                                ind = (IndexInt)(theta_z/dth + 0.4999999);              //round is eqivalent to nint() 
    381381                                                nt[ind] += 1;                   //Increment bin for angle. 
    382382                                                //Increment angle array for single scattering events. 
Note: See TracChangeset for help on using the changeset viewer.