Changeset 867 for cpp/common
- Timestamp:
- 04/21/19 16:36:22 (6 years ago)
- Location:
- cpp/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_math.cpp
r835 r867 7 7 RandomGenerator& rndGetInstance() 8 8 { 9 static RandomGenerator rnd(0);10 return rnd;9 static RandomGenerator rnd(0); 10 return rnd; 11 11 } 12 12 … … 50 50 void fpExceptEnable() 51 51 { 52 feclearexcept(FE_DIVBYZERO);53 feenableexcept(FE_DIVBYZERO);52 feclearexcept(FE_DIVBYZERO); 53 feenableexcept(FE_DIVBYZERO); 54 54 } 55 55 56 56 void fpExceptDisable() 57 57 { 58 fedisableexcept(FE_DIVBYZERO);58 fedisableexcept(FE_DIVBYZERO); 59 59 } 60 60 … … 83 83 //unsigned int was=_clear87(); 84 84 //logPrintf("","fpExceptInit",LOG_INFO,"control87 status before clear was %08x", was); 85 fp_control_word_std =_control87(0, 0); //4978 = 100110111001085 fp_control_word_std = _control87(0, 0); //4978 = 1001101110010 86 86 // Make the new fp env same as the old one, except for the changes we're going to make 87 87 fp_control_word_muted = fp_control_word_std | EM_INVALID | EM_DENORMAL | EM_ZERODIVIDE | EM_OVERFLOW | EM_UNDERFLOW | EM_INEXACT; //4991 = 1001101111111 … … 90 90 void fpExceptEnable() 91 91 { 92 unsigned int was =_clear87(); //trzeba czyscic zeby nie bylo exception...92 unsigned int was = _clear87(); //trzeba czyscic zeby nie bylo exception... 93 93 //logPrintf("","fpExceptEnable ",LOG_INFO,"control87 status before clear was %08x", was); 94 94 _control87(fp_control_word_std, 0xffffffff); … … 98 98 void fpExceptDisable() 99 99 { 100 unsigned int was =_clear87(); //trzeba czyscic zeby nie bylo exception...100 unsigned int was = _clear87(); //trzeba czyscic zeby nie bylo exception... 101 101 //logPrintf("","fpExceptDisable",LOG_INFO,"control87 status before clear was %08x", was); 102 102 _control87(fp_control_word_muted, 0xffffffff); … … 116 116 void fpExceptDisable() {} 117 117 #endif 118 -
cpp/common/random.h
r843 r867 116 116 //UniformRandomBitGenerator 117 117 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;} 120 120 inline unsigned int operator()() {return getUint32();} 121 121 -
cpp/common/util-string.cpp
r862 r867 43 43 #ifdef VSNPRINTF_RETURNS_REQUIRED_SIZE 44 44 if (n > -1) /* glibc 2.1 */ 45 size = n +1; /* precisely what is needed */45 size = n + 1; /* precisely what is needed */ 46 46 else /* glibc 2.0 */ 47 47 #endif … … 82 82 size_t sep = filename.rfind(PATH_SEPARATOR_CHAR); 83 83 if (sep == string::npos) return filename; 84 return filename.substr(sep +1);84 return filename.substr(sep + 1); 85 85 } 86 86
Note: See TracChangeset
for help on using the changeset viewer.