Changeset 886 for cpp/common
- Timestamp:
- 07/22/19 01:13:09 (5 years ago)
- Location:
- cpp/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd.h
r842 r886 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2019 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 21 21 22 22 23 /////////////////////////////////////////////////////// 64-bit int typeand other macros23 /////////////////////////////////////////////////////// path separators and other macros 24 24 #ifdef _WIN32 25 typedef __int64 LONGLONG;26 25 #define PATH_SEPARATOR_CHAR '\\' 27 26 #define PATH_SEPARATOR_STRING "\\" 28 27 #define FPU_THROWS_EXCEPTIONS 29 28 #else 30 #define LONGLONG long long int31 29 #define PATH_SEPARATOR_CHAR '/' 32 30 #define PATH_SEPARATOR_STRING "/" … … 75 73 76 74 #endif 77 -
cpp/common/random.h
r867 r886 9 9 #endif 10 10 11 #include "nonstd.h" //LONGLONG12 11 #include <time.h> //time() 13 12 #include <stdint.h> //uintptr_t … … 83 82 { 84 83 counter++; 85 seed = time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h84 seed = (unsigned int)time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h 86 85 seed ^= counter; //incremented value, possibly randomly initialized 87 86 seed ^= (unsigned int)(uintptr_t)&counter; //memory address … … 122 121 inline double getDouble() // [0,1) 123 122 { 124 return double(getUint32()) / (( LONGLONG)(MAXVALUE)+1);123 return double(getUint32()) / ((int64_t)(MAXVALUE)+1); 125 124 } 126 125
Note: See TracChangeset
for help on using the changeset viewer.