Ignore:
Timestamp:
07/14/20 15:54:43 (4 years ago)
Author:
Maciej Komosinski
Message:

Higher conformance with C++17, but gave up after missing M_PI, M_PI_2, strdup() and more; other cosmetic improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/Convert.cpp

    r400 r1005  
    44
    55#include "Convert.h"
    6 
    76#include <sstream>
    87
     
    9190        struct tm ret;
    9291#if defined LINUX // || android?
    93         return *::localtime_r(&timep,&ret);
     92        return *::localtime_r(&timep, &ret);
    9493#elif defined _WIN32 && !defined __BORLANDC__
    9594        ::localtime_s(&ret, &timep);
     
    9796#else //borland?
    9897        pthread_mutex_lock(&fix_unsafe_mutex);
    99         ret=*::localtime(&timep);
     98        ret = *::localtime(&timep);
    10099        pthread_mutex_unlock(&fix_unsafe_mutex);
    101100        return ret;
     
    110109#ifndef MULTITHREADED
    111110
    112         ret=::asctime(&tm);
     111        ret = ::asctime(&tm);
    113112
    114113#else //MULTITHREADED
     
    116115        char buf[26];
    117116#if defined LINUX // || android?
    118         ret=::asctime_r(&tm,buf);
     117        ret = ::asctime_r(&tm, buf);
    119118#elif defined _WIN32 && !defined __BORLANDC__
    120119        asctime_s(buf, sizeof(buf), &tm);
     
    122121#else //borland?
    123122        pthread_mutex_lock(&fix_unsafe_mutex);
    124         strcpy(buf,::asctime(&tm));
    125         ret=buf;
     123        strcpy(buf, ::asctime(&tm));
     124        ret = buf;
    126125        pthread_mutex_unlock(&fix_unsafe_mutex);
    127126#endif
Note: See TracChangeset for help on using the changeset viewer.