Ignore:
Timestamp:
2018-04-04T15:42:37Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/softint/multiplication.c

    r47b2d7e3 r1433ecda  
    5454 * @result
    5555 */
    56 static unsigned long long mul(unsigned int a, unsigned int b) {
     56static unsigned long long mul(unsigned int a, unsigned int b)
     57{
    5758        unsigned int a1, a2, b1, b2;
    5859        unsigned long long t1, t2, t3;
     
    6465
    6566        t1 = a1 * b1;
    66         t2 = a1*b2;
    67         t2 += a2*b1;
    68         t3 = a2*b2;
     67        t2 = a1 * b2;
     68        t2 += a2 * b1;
     69        t3 = a2 * b2;
    6970
    7071        t3 = (((t1 << 16) + t2) << 16) + t3;
     
    7980{
    8081        long long result;
    81         unsigned long long t1,t2;
     82        unsigned long long t1, t2;
    8283        unsigned long long a1, a2, b1, b2;
    8384        char neg = 0;
     
    101102        if (SOFTINT_CHECK_OF && (a1 != 0) && (b1 != 0)) {
    102103                // error, overflow
    103                 return (neg?MIN_INT64:MAX_INT64);
     104                return (neg ? MIN_INT64 : MAX_INT64);
    104105        }
    105106
    106107        // (if OF checked) a1 or b1 is zero => result fits in 64 bits, no need to another overflow check
    107         t1 = mul(a1,b2) + mul(b1,a2);
     108        t1 = mul(a1, b2) + mul(b1, a2);
    108109
    109110        if (SOFTINT_CHECK_OF && t1 > MAX_UINT32) {
    110111                // error, overflow
    111                 return (neg?MIN_INT64:MAX_INT64);
     112                return (neg ? MIN_INT64 : MAX_INT64);
    112113        }
    113114
    114115        t1 = t1 << 32;
    115         t2 = mul(a2,b2);
     116        t2 = mul(a2, b2);
    116117        t2 += t1;
    117118
     
    120121        if (SOFTINT_CHECK_OF && ((t2 < t1) || (t2 & (1ull << 63)))) {
    121122                // error, overflow
    122                 return (neg?MIN_INT64:MAX_INT64);
     123                return (neg ? MIN_INT64 : MAX_INT64);
    123124        }
    124125
Note: See TracChangeset for help on using the changeset viewer.