Ignore:
Timestamp:
Nov 13, 2017 11:51:56 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
95d7c4f
Parents:
f926abb
Message:

declare all variables at the start of the block so C89 compilers don't complain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/c_extensions/sld2i.c

    r54b0650 r7e82256  
    6565 
    6666        double count = 0.0; 
    67         //check if this computation is for averaging 
     67        int i, j; 
    6868 
    6969        //Assume that pixel volumes are given in vol_pix in A^3 unit 
     
    7575 
    7676        //printf("npoints: %d, npix: %d\n", npoints, this->n_pix); 
    77         for(int i=0; i<npoints; i++){ 
     77        for(i=0; i<npoints; i++){ 
    7878                //I_out[i] = 0.0; 
    7979                sumj_uu = cassign(0.0, 0.0); 
     
    8484                //q = sqrt(qx[i]*qx[i] + qy[i]*qy[i]); // + qz[i]*qz[i]); 
    8585 
    86                 for(int j=0; j<this->n_pix; j++){ 
     86                for(j=0; j<this->n_pix; j++){ 
    8787                        if (this->sldn_val[j]!=0.0 
    8888                                ||this->mx_val[j]!=0.0 
     
    156156        double sld_j = 0.0; 
    157157        double count = 0.0; 
     158        int i, j, k; 
     159 
    158160        //Assume that pixel volumes are given in vol_pix in A^3 unit 
    159161        // Loop over q-values and multiply apply matrix 
    160         for(int i=0; i<npoints; i++){ 
     162        for(i=0; i<npoints; i++){ 
    161163                sumj =0.0; 
    162                 for(int j=0; j<this->n_pix; j++){ 
     164                for(j=0; j<this->n_pix; j++){ 
    163165                        //Isotropic: Assumes all slds are real (no magnetic) 
    164166                        //Also assumes there is no polarization: No dependency on spin 
     
    177179                                //full calculation 
    178180                                //pragma omp parallel for 
    179                                 for(int k=0; k<this->n_pix; k++){ 
     181                                for(k=0; k<this->n_pix; k++){ 
    180182                                        sld_j =  this->sldn_val[j] * this->sldn_val[k] * this->vol_pix[j] * this->vol_pix[k]; 
    181183                                        qr = (this->x_val[j]-this->x_val[k])*(this->x_val[j]-this->x_val[k])+ 
Note: See TracChangeset for help on using the changeset viewer.