Changeset b523c0e in sasview for src/sas/sascalc/pr/c_extensions


Ignore:
Timestamp:
May 6, 2016 4:19:24 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
f567f92f
Parents:
4c29e4d
Message:

remove compiler warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/pr/c_extensions/Cinvertor.c

    rb699768 rb523c0e  
    115115 
    116116        //self->params.x = data; 
    117         self->params.npoints = ndata; 
     117        self->params.npoints = (int)ndata; 
    118118        return Py_BuildValue("i", self->params.npoints); 
    119119} 
     
    180180 
    181181        //self->params.y = data; 
    182         self->params.ny = ndata; 
     182        self->params.ny = (int)ndata; 
    183183        return Py_BuildValue("i", self->params.ny); 
    184184} 
     
    245245 
    246246        //self->params.err = data; 
    247         self->params.nerr = ndata; 
     247        self->params.nerr = (int)ndata; 
    248248        return Py_BuildValue("i", self->params.nerr); 
    249249} 
     
    523523    residuals = PyList_New(self->params.npoints); 
    524524 
    525     regterm = reg_term(pars, self->params.d_max, npars, nslice); 
     525    regterm = reg_term(pars, self->params.d_max, (int)npars, nslice); 
    526526 
    527527    for(i=0; i<self->params.npoints; i++) { 
    528         diff = self->params.y[i] - iq(pars, self->params.d_max, npars, self->params.x[i]); 
     528        diff = self->params.y[i] - iq(pars, self->params.d_max, (int)npars, self->params.x[i]); 
    529529        residual = diff*diff / (self->params.err[i]*self->params.err[i]); 
    530530 
     
    573573    residuals = PyList_New(self->params.npoints); 
    574574 
    575     regterm = reg_term(pars, self->params.d_max, npars, nslice); 
     575    regterm = reg_term(pars, self->params.d_max, (int)npars, nslice); 
    576576 
    577577 
    578578    for(i=0; i<self->params.npoints; i++) { 
    579         diff = self->params.y[i] - pr(pars, self->params.d_max, npars, self->params.x[i]); 
     579        diff = self->params.y[i] - pr(pars, self->params.d_max, (int)npars, self->params.x[i]); 
    580580        residual = diff*diff / (self->params.err[i]*self->params.err[i]); 
    581581 
     
    611611        OUTVECTOR(data_obj,pars,npars); 
    612612 
    613         iq_value = iq(pars, self->params.d_max, npars, q); 
     613        iq_value = iq(pars, self->params.d_max, (int)npars, q); 
    614614        return Py_BuildValue("f", iq_value); 
    615615} 
     
    636636        OUTVECTOR(data_obj,pars,npars); 
    637637 
    638         iq_value = iq_smeared(pars, self->params.d_max, npars, 
     638        iq_value = iq_smeared(pars, self->params.d_max, (int)npars, 
    639639                                                        self->params.slit_height, self->params.slit_width, 
    640640                                                        q, 21); 
     
    661661        OUTVECTOR(data_obj,pars,npars); 
    662662 
    663         pr_value = pr(pars, self->params.d_max, npars, r); 
     663        pr_value = pr(pars, self->params.d_max, (int)npars, r); 
    664664        return Py_BuildValue("f", pr_value); 
    665665} 
     
    689689 
    690690        if (err_obj == Py_None) { 
    691                 pr_value = pr(pars, self->params.d_max, npars, r); 
     691                pr_value = pr(pars, self->params.d_max, (int)npars, r); 
    692692                pr_err_value = 0.0; 
    693693        } else { 
    694694                OUTVECTOR(err_obj,pars_err,npars2); 
    695                 pr_err(pars, pars_err, self->params.d_max, npars, r, &pr_value, &pr_err_value); 
     695                pr_err(pars, pars_err, self->params.d_max, (int)npars, r, &pr_value, &pr_err_value); 
    696696        } 
    697697        return Py_BuildValue("ff", pr_value, pr_err_value); 
     
    728728        OUTVECTOR(data_obj,pars,npars); 
    729729 
    730         oscill = reg_term(pars, self->params.d_max, npars, 100); 
    731         norm   = int_p2(pars, self->params.d_max, npars, 100); 
     730        oscill = reg_term(pars, self->params.d_max, (int)npars, 100); 
     731        norm   = int_p2(pars, self->params.d_max, (int)npars, 100); 
    732732        return Py_BuildValue("f", sqrt(oscill/norm)/acos(-1.0)*self->params.d_max ); 
    733733 
     
    749749        OUTVECTOR(data_obj,pars,npars); 
    750750 
    751         count = npeaks(pars, self->params.d_max, npars, 100); 
     751        count = npeaks(pars, self->params.d_max, (int)npars, 100); 
    752752 
    753753        return Py_BuildValue("i", count ); 
     
    770770        OUTVECTOR(data_obj,pars,npars); 
    771771 
    772         fraction = positive_integral(pars, self->params.d_max, npars, 100); 
     772        fraction = positive_integral(pars, self->params.d_max, (int)npars, 100); 
    773773 
    774774        return Py_BuildValue("f", fraction ); 
     
    795795        OUTVECTOR(err_obj,pars_err,npars2); 
    796796 
    797         fraction = positive_errors(pars, pars_err, self->params.d_max, npars, 51); 
     797        fraction = positive_errors(pars, pars_err, self->params.d_max, (int)npars, 51); 
    798798 
    799799        return Py_BuildValue("f", fraction ); 
     
    815815        OUTVECTOR(data_obj,pars,npars); 
    816816 
    817         value = rg(pars, self->params.d_max, npars, 101); 
     817        value = rg(pars, self->params.d_max, (int)npars, 101); 
    818818 
    819819        return Py_BuildValue("f", value ); 
     
    835835        OUTVECTOR(data_obj,pars,npars); 
    836836 
    837         value = 4.0*acos(-1.0)*int_pr(pars, self->params.d_max, npars, 101); 
     837        value = 4.0*acos(-1.0)*int_pr(pars, self->params.d_max, (int)npars, 101); 
    838838 
    839839        return Py_BuildValue("f", value ); 
Note: See TracChangeset for help on using the changeset viewer.