Changeset 867


Ignore:
Timestamp:
04/21/19 16:36:22 (4 weeks ago)
Author:
Maciej Komosinski
Message:

Code formatting + cosmetic fixes

Location:
cpp/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd_math.cpp

    r835 r867  
    77RandomGenerator& rndGetInstance()
    88{
    9 static RandomGenerator rnd(0);
    10 return rnd;
     9        static RandomGenerator rnd(0);
     10        return rnd;
    1111}
    1212
     
    5050void fpExceptEnable()
    5151{
    52 feclearexcept(FE_DIVBYZERO);
    53 feenableexcept(FE_DIVBYZERO);
     52        feclearexcept(FE_DIVBYZERO);
     53        feenableexcept(FE_DIVBYZERO);
    5454}
    5555
    5656void fpExceptDisable()
    5757{
    58 fedisableexcept(FE_DIVBYZERO);
     58        fedisableexcept(FE_DIVBYZERO);
    5959}
    6060
     
    8383        //unsigned int was=_clear87();
    8484        //logPrintf("","fpExceptInit",LOG_INFO,"control87 status before clear was %08x", was);
    85         fp_control_word_std=_control87(0, 0);             //4978 = 1001101110010
     85        fp_control_word_std = _control87(0, 0);             //4978 = 1001101110010
    8686        // Make the new fp env same as the old one, except for the changes we're going to make
    8787        fp_control_word_muted = fp_control_word_std | EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW | EM_UNDERFLOW | EM_INEXACT;  //4991 = 1001101111111
     
    9090void fpExceptEnable()
    9191{
    92         unsigned int was=_clear87(); //trzeba czyscic zeby nie bylo exception...
     92        unsigned int was = _clear87(); //trzeba czyscic zeby nie bylo exception...
    9393        //logPrintf("","fpExceptEnable ",LOG_INFO,"control87 status before clear was %08x", was);
    9494        _control87(fp_control_word_std, 0xffffffff);
     
    9898void fpExceptDisable()
    9999{
    100         unsigned int was=_clear87(); //trzeba czyscic zeby nie bylo exception...
     100        unsigned int was = _clear87(); //trzeba czyscic zeby nie bylo exception...
    101101        //logPrintf("","fpExceptDisable",LOG_INFO,"control87 status before clear was %08x", was);
    102102        _control87(fp_control_word_muted, 0xffffffff);
     
    116116void fpExceptDisable() {}
    117117#endif
    118 
  • cpp/common/random.h

    r843 r867  
    116116        //UniformRandomBitGenerator
    117117        typedef unsigned int result_type;
    118         static unsigned int min() {return 0;}
    119         static unsigned int max() {return MAXVALUE;}
     118        static constexpr unsigned int min() {return 0;}
     119        static constexpr unsigned int max() {return MAXVALUE;}
    120120        inline unsigned int operator()() {return getUint32();}
    121121
  • cpp/common/util-string.cpp

    r862 r867  
    4343#ifdef VSNPRINTF_RETURNS_REQUIRED_SIZE
    4444                if (n > -1)    /* glibc 2.1 */
    45                         size = n+1; /* precisely what is needed */
     45                        size = n + 1; /* precisely what is needed */
    4646                else           /* glibc 2.0 */
    4747#endif
     
    8282        size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
    8383        if (sep == string::npos) return filename;
    84         return filename.substr(sep+1);
     84        return filename.substr(sep + 1);
    8585}
    8686
Note: See TracChangeset for help on using the changeset viewer.