Changeset a35b458 in mainline for uspace/lib/softrend/transform.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/softrend/transform.c

    r3061bc1 ra35b458  
    4343                for (unsigned int j = 0; j < TRANSFORM_MATRIX_DIM; j++) {
    4444                        double comb = 0;
    45                        
     45
    4646                        for (unsigned int k = 0; k < TRANSFORM_MATRIX_DIM; k++)
    4747                                comb += a->matrix[i][k] * b->matrix[k][j];
    48                        
     48
    4949                        res->matrix[i][j] = comb;
    5050                }
     
    7272        double k = trans->matrix[0][0] * trans->matrix[1][1] -
    7373            trans->matrix[0][1] * trans->matrix[1][0];
    74        
     74
    7575        double det = 1 / (a * trans->matrix[0][0] + b * trans->matrix[0][1] +
    7676            c * trans->matrix[0][2]);
    77        
     77
    7878        trans->matrix[0][0] = a * det;
    7979        trans->matrix[1][0] = b * det;
    8080        trans->matrix[2][0] = c * det;
    81        
     81
    8282        trans->matrix[0][1] = d * det;
    8383        trans->matrix[1][1] = e * det;
    8484        trans->matrix[2][1] = f * det;
    85        
     85
    8686        trans->matrix[0][2] = g * det;
    8787        trans->matrix[1][2] = h * det;
     
    9494        trans->matrix[1][0] = 0;
    9595        trans->matrix[2][0] = 0;
    96        
     96
    9797        trans->matrix[0][1] = 0;
    9898        trans->matrix[1][1] = 1;
    9999        trans->matrix[2][1] = 0;
    100        
     100
    101101        trans->matrix[0][2] = 0;
    102102        trans->matrix[1][2] = 0;
     
    107107{
    108108        transform_t a;
    109        
     109
    110110        a.matrix[0][0] = 1;
    111111        a.matrix[1][0] = 0;
    112112        a.matrix[2][0] = 0;
    113        
     113
    114114        a.matrix[0][1] = 0;
    115115        a.matrix[1][1] = 1;
    116116        a.matrix[2][1] = 0;
    117        
     117
    118118        a.matrix[0][2] = dx;
    119119        a.matrix[1][2] = dy;
    120120        a.matrix[2][2] = 1;
    121        
     121
    122122        transform_t b = *trans;
    123        
     123
    124124        transform_product(trans, &a, &b);
    125125}
     
    128128{
    129129        transform_t a;
    130        
     130
    131131        a.matrix[0][0] = qx;
    132132        a.matrix[1][0] = 0;
    133133        a.matrix[2][0] = 0;
    134        
     134
    135135        a.matrix[0][1] = 0;
    136136        a.matrix[1][1] = qy;
    137137        a.matrix[2][1] = 0;
    138        
     138
    139139        a.matrix[0][2] = 0;
    140140        a.matrix[1][2] = 0;
    141141        a.matrix[2][2] = 1;
    142        
     142
    143143        transform_t b = *trans;
    144        
     144
    145145        transform_product(trans, &a, &b);
    146146}
     
    149149{
    150150        transform_t a;
    151        
     151
    152152        a.matrix[0][0] = cos(angle);
    153153        a.matrix[1][0] = sin(angle);
    154154        a.matrix[2][0] = 0;
    155        
     155
    156156        a.matrix[0][1] = -sin(angle);
    157157        a.matrix[1][1] = cos(angle);
    158158        a.matrix[2][1] = 0;
    159        
     159
    160160        a.matrix[0][2] = 0;
    161161        a.matrix[1][2] = 0;
    162162        a.matrix[2][2] = 1;
    163        
     163
    164164        transform_t b = *trans;
    165        
     165
    166166        transform_product(trans, &a, &b);
    167167}
     
    179179        double old_x = *x;
    180180        double old_y = *y;
    181        
     181
    182182        *x = old_x * trans->matrix[0][0] + old_y * trans->matrix[0][1];
    183183        *y = old_x * trans->matrix[1][0] + old_y * trans->matrix[1][1];
     
    188188        double old_x = *x;
    189189        double old_y = *y;
    190        
     190
    191191        *x = old_x * trans->matrix[0][0] + old_y * trans->matrix[0][1] +
    192192            trans->matrix[0][2];
Note: See TracChangeset for help on using the changeset viewer.