A few notes on programming style |
Home |
Here I’ve separated the variables that are initialized to parameter values to two separate lines, but put the zpos and factor variables on a line by themselves. It just didn’t seem worth spending another line on factor, though I realize that the combination of the initialization of zpos (created simply to simplify the logic of the following code) with the non-initialized value of factor could be confusing. Coding standards in a formal programming environment will often dictate how such declarations should be handled.miScalar near = *mi_eval_scalar(¶ms->near); miScalar far = *mi_eval_scalar(¶ms->far); miScalar zpos = state->point.z, factor;