Changeset 889 for cpp/frams/util


Ignore:
Timestamp:
07/22/19 01:16:11 (5 years ago)
Author:
Maciej Komosinski
Message:

Code formatting

Location:
cpp/frams/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/sstring.cpp

    r826 r889  
    5252{
    5353        size = guessMemSize(initsize);
    54         if (size > 0)   { txt = (char*)malloc(size + 1); txt[0] = 0; }
     54        if (size > 0) { txt = (char*)malloc(size + 1); txt[0] = 0; }
    5555        else    txt = (char*)"";
    5656        used = 0;
     
    368368#ifdef USE_PRINTFLOAT_DRAGON4
    369369        SString tmp;
    370         char* here=tmp.directWrite(30);
    371         tmp.endWrite(PrintFloat64(here,30,d,
    372                                   ((d<-1e17)||(d>1e17)||((d<1e-4)&&(d>-1e-4)&&(d!=0.0)))
    373                                   ? PrintFloatFormat_Scientific : PrintFloatFormat_Positional,
    374                                   -1));//http://www.ryanjuckett.com/programming/printing-floating-point-numbers/
     370        char* here = tmp.directWrite(30);
     371        tmp.endWrite(PrintFloat64(here, 30, d,
     372                ((d < -1e17) || (d > 1e17) || ((d < 1e-4) && (d > -1e-4) && (d != 0.0)))
     373                ? PrintFloatFormat_Scientific : PrintFloatFormat_Positional,
     374                -1));//http://www.ryanjuckett.com/programming/printing-floating-point-numbers/
    375375#else
    376376        SString tmp = SString::sprintf("%.17g", d); //https://stackoverflow.com/questions/16839658/printf-width-specifier-to-maintain-precision-of-floating-point-value
  • cpp/frams/util/sstring.h

    r793 r889  
    7777        void copyFrom(const char* ch, int chlen = -1); ///< copy string, length of -1 == unknown
    7878
    79         void* operator new(size_t s, void* mem){ return mem; }
     79        void* operator new(size_t s, void* mem) { return mem; }
    8080#ifdef _MSC_VER
    81                 void operator delete(void* mem, void* t) {}
     81        void operator delete(void* mem, void* t) {}
    8282#endif
    83         void* operator new(size_t s){ return malloc(sizeof(SString)); }
     83        void* operator new(size_t s) { return malloc(sizeof(SString)); }
    8484        void operator delete(void* mem) { free(mem); }
    8585
Note: See TracChangeset for help on using the changeset viewer.