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/softint/generic/multiplication.c

    r3061bc1 ra35b458  
    5353        unsigned int b1 = b >> 16;
    5454        unsigned int b2 = b & UINT16_MAX;
    55        
     55
    5656        unsigned long long t1 = a1 * b1;
    5757        unsigned long long t2 = a1 * b2;
    5858        t2 += a2 * b1;
    5959        unsigned long long t3 = a2 * b2;
    60        
     60
    6161        t3 = (((t1 << 16) + t2) << 16) + t3;
    62        
     62
    6363        return t3;
    6464}
     
    7070{
    7171        char neg = 0;
    72        
     72
    7373        if (a < 0) {
    7474                neg = !neg;
    7575                a = -a;
    7676        }
    77        
     77
    7878        if (b < 0) {
    7979                neg = !neg;
    8080                b = -b;
    8181        }
    82        
     82
    8383        unsigned long long a1 = a >> 32;
    8484        unsigned long long b1 = b >> 32;
    85        
     85
    8686        unsigned long long a2 = a & (UINT32_MAX);
    8787        unsigned long long b2 = b & (UINT32_MAX);
    88        
     88
    8989        if (SOFTINT_CHECK_OF && (a1 != 0) && (b1 != 0)) {
    9090                /* Error (overflow) */
    9191                return (neg ? INT64_MIN : INT64_MAX);
    9292        }
    93        
     93
    9494        /* (if OF checked) a1 or b1 is zero => result fits in 64 bits,
    9595         * no need to another overflow check
    9696         */
    9797        unsigned long long t1 = mul(a1, b2) + mul(b1, a2);
    98        
     98
    9999        if ((SOFTINT_CHECK_OF) && (t1 > UINT32_MAX)) {
    100100                /* Error (overflow) */
    101101                return (neg ? INT64_MIN : INT64_MAX);
    102102        }
    103        
     103
    104104        t1 = t1 << 32;
    105105        unsigned long long t2 = mul(a2, b2);
    106106        t2 += t1;
    107        
     107
    108108        /* t2 & (1ull << 63) - if this bit is set in unsigned long long,
    109109         * result does not fit in signed one */
     
    112112                return (neg ? INT64_MIN : INT64_MAX);
    113113        }
    114        
     114
    115115        long long result = t2;
    116116        if (neg)
    117117                result = -result;
    118        
     118
    119119        return result;
    120120}
Note: See TracChangeset for help on using the changeset viewer.