Changeset 511


Ignore:
Timestamp:
Aug 25, 2018, 6:30:55 PM (2 years ago)
Author:
viala@…
Message:

[libmath] Add braces arround a misleading indent for loop.

Sometimes braces could save your mind.

k_rem_pio2.c: In function 'kernel_rem_pio2':
k_rem_pio2.c:174:6: warning: this 'for' clause does not guard... [-Wmisleading-indentation]

for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;

k_rem_pio2.c:174:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'

for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/libmath/k_rem_pio2.c

    r469 r511  
    168168    /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
    169169        j = jv-jx; m = jx+jk;
    170         for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
     170        for (i=0;i<=m;i++,j++) { f[i] = (j<0)? zero : (double) ipio2[j]; }
    171171
    172172    /* compute q[0],q[1],...q[jk] */
    173         for (i=0;i<=jk;i++) {
    174             for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
     173        for ( i = 0; i <= jk; i++ ) {
     174                for ( j = 0, fw = 0.0; j <= jx; j++) {
     175                        fw += x[j] * f[jx + i - j];
     176                }
     177                q[i] = fw;
    175178        }
    176179
Note: See TracChangeset for help on using the changeset viewer.