Changeset 886 for cpp/common


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

LONGLONG no longer needed as long as int64_t became standard

Location:
cpp/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd.h

    r842 r886  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    2121
    2222
    23 /////////////////////////////////////////////////////// 64-bit int type and other macros
     23/////////////////////////////////////////////////////// path separators and other macros
    2424#ifdef _WIN32
    25         typedef __int64 LONGLONG;
    2625        #define PATH_SEPARATOR_CHAR '\\'
    2726        #define PATH_SEPARATOR_STRING "\\"
    2827        #define FPU_THROWS_EXCEPTIONS
    2928#else
    30         #define LONGLONG long long int
    3129        #define PATH_SEPARATOR_CHAR '/'
    3230        #define PATH_SEPARATOR_STRING "/"
     
    7573
    7674#endif
    77 
  • cpp/common/random.h

    r867 r886  
    99#endif
    1010
    11 #include "nonstd.h" //LONGLONG
    1211#include <time.h> //time()
    1312#include <stdint.h> //uintptr_t
     
    8382                {
    8483                        counter++;
    85                         seed = time(NULL);                         //time (seconds); could use hi-res timer but then we would depend on common/timer.h
     84                        seed = (unsigned int)time(NULL);                         //time (seconds); could use hi-res timer but then we would depend on common/timer.h
    8685                        seed ^= counter;                           //incremented value, possibly randomly initialized
    8786                        seed ^= (unsigned int)(uintptr_t)&counter; //memory address
     
    122121        inline double getDouble() // [0,1)
    123122        {
    124                 return double(getUint32()) / ((LONGLONG)(MAXVALUE)+1);
     123                return double(getUint32()) / ((int64_t)(MAXVALUE)+1);
    125124        }
    126125
Note: See TracChangeset for help on using the changeset viewer.