Changeset 1b758b3 in sasview


Ignore:
Timestamp:
Jan 6, 2012 12:15:18 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:
ee0f3fc
Parents:
886dde6b
Message:

clean up warnings

Location:
sansmodels/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/c_models/librefl.c

    r101065a r1b758b3  
    151151// ind = x position: 0 to max 
    152152// nu = max x to integration 
    153 double err_mod_func(n_sub, ind, nu) 
    154         double n_sub,nu, ind; 
     153double err_mod_func(double n_sub, double ind, double nu) 
    155154{ 
    156155  double center, func; 
     
    177176        return func; 
    178177} 
    179 double linearfunc(n_sub, ind, nu) 
    180         double n_sub,nu, ind; 
     178double linearfunc(double n_sub, double ind, double nu) 
    181179{ 
    182180  double bin_size, func; 
     
    192190} 
    193191// use the right hand side from the center of power func 
    194 double power_r(n_sub, ind, nu) 
    195         double n_sub, nu, ind; 
     192double power_r(double n_sub, double ind, double nu) 
    196193{ 
    197194  double bin_size,func; 
     
    209206} 
    210207// use the left hand side from the center of power func 
    211 double power_l(n_sub, ind, nu) 
    212         double n_sub, nu, ind; 
     208double power_l(double n_sub, double ind, double nu) 
    213209{ 
    214210  double bin_size, func; 
     
    226222} 
    227223// use 1-exp func from x=0 to x=1 
    228 double exp_r(n_sub, ind, nu) 
    229         double n_sub, nu, ind; 
     224double exp_r(double n_sub, double ind, double nu) 
    230225{ 
    231226  double bin_size, func; 
     
    247242 
    248243// use the left hand side mirror image of exp func 
    249 double exp_l(n_sub, ind, nu) 
    250         double n_sub, nu, ind; 
     244double exp_l(double n_sub, double ind, double nu) 
    251245{ 
    252246  double bin_size, func; 
     
    269263// To select function called 
    270264// At nu = 0 (singular point), call line function 
    271 double intersldfunc(fun_type, n_sub, i, nu, sld_l, sld_r) 
    272         double n_sub, nu, sld_l, sld_r,i; 
    273         int fun_type; 
     265double intersldfunc(int fun_type, double n_sub, double i, double nu, double sld_l, double sld_r) 
    274266{ 
    275267        double sld_i, func; 
     
    315307 
    316308// used by refl.c 
    317 double interfunc(fun_type, n_sub, i, sld_l, sld_r) 
    318         double n_sub, sld_l, sld_r, i; 
    319         int fun_type; 
     309double interfunc(int fun_type, double n_sub, double i, double sld_l, double sld_r) 
    320310{ 
    321311        double sld_i, func; 
  • sansmodels/src/python_wrapper/WrapperGenerator.py

    r101065a r1b758b3  
    323323                    (par, self.params[par]) 
    324324 
    325             param_str += "        // Initialize dispersion / averaging parameter dict\n" 
    326             param_str += "        DispersionVisitor* visitor = new DispersionVisitor();\n" 
    327             param_str += "        PyObject * disp_dict;\n" 
    328             for par in self.disp_params: 
    329                 par = par.strip() 
    330                 param_str += "        disp_dict = PyDict_New();\n" 
    331                 param_str += "        self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 
    332                 param_str += "        PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 
     325            if len(self.disp_params)>0: 
     326                param_str += "        // Initialize dispersion / averaging parameter dict\n" 
     327                param_str += "        DispersionVisitor* visitor = new DispersionVisitor();\n" 
     328                param_str += "        PyObject * disp_dict;\n" 
     329                for par in self.disp_params: 
     330                    par = par.strip() 
     331                    param_str += "        disp_dict = PyDict_New();\n" 
     332                    param_str += "        self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 
     333                    param_str += "        PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par 
    333334                 
    334335            # Initialize dispersion object dictionnary 
     
    345346                    (par, par) 
    346347                     
    347             param_str += "    // Read in dispersion parameters\n" 
    348             param_str += "    PyObject* disp_dict;\n" 
    349             param_str += "    DispersionVisitor* visitor = new DispersionVisitor();\n" 
    350             for par in self.disp_params: 
    351                 par = par.strip() 
    352                 param_str += "    disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 
    353                 param_str += "    self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 
     348            if len(self.disp_params)>0: 
     349                param_str += "    // Read in dispersion parameters\n" 
     350                param_str += "    PyObject* disp_dict;\n" 
     351                param_str += "    DispersionVisitor* visitor = new DispersionVisitor();\n" 
     352                for par in self.disp_params: 
     353                    par = par.strip() 
     354                    param_str += "    disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par 
     355                    param_str += "    self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par) 
    354356                 
    355357            newline = self.replaceToken(newline, "[READDICTIONARY]", param_str) 
Note: See TracChangeset for help on using the changeset viewer.