Преглед на файлове

Updated rcore.c, renamed 'time' to 'nanoSeconds' (#2816)

* Updated rcore.c, renamed 'time' to 'time_nsec'

When PLATFORM_ANDROID, PLATFORM_RPI or PLATFORM_DRM were defined, there is a compilation error to redefinition of the variable 'time', so the second instance of 'time' was changed to 'time_nsec' which both fixes the name collision and more accurately describes what that variable represents.

* Renamed 'time_nsec' to 'nanoSeconds'
pull/2820/head
jtainer преди 3 години
committed by GitHub
родител
ревизия
50a716c0d9
No known key found for this signature in database GPG ключ ID: 4AEE18F83AFDEB23
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +2
    -2
      src/rcore.c

+ 2
- 2
src/rcore.c Целия файл

@ -2763,9 +2763,9 @@ double GetTime(void)
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
struct timespec ts = { 0 }; struct timespec ts = { 0 };
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);
unsigned long long int time = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
time = (double)(time - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
#endif #endif
return time; return time;
} }

Зареждане…
Отказ
Запис