Skip to content

Commit

Permalink
Core: assume modern Unix has tm_gmtoff
Browse files Browse the repository at this point in the history
Core/HLE/sceRtc.cpp:471:14: error: invalid argument type 'char *(*)(int, int)' to
      unary expression
                srcTick -= -timezone * 1000000ULL;
                           ^~~~~~~~~
Core/HLE/sceRtc.cpp:498:14: error: invalid argument type 'char *(*)(int, int)' to
      unary expression
                srcTick += -timezone * 1000000ULL;
                           ^~~~~~~~~
Core/HLE/sceRtc.cpp:1035:16: error: invalid argument type 'char *(*)(int, int)' to
      unary expression
                tz_seconds = -timezone;
                             ^~~~~~~~~
Core/HLE/sceRtc.cpp:1074:16: error: invalid argument type 'char *(*)(int, int)' to
      unary expression
                tz_seconds = -timezone;
                             ^~~~~~~~~
4 errors generated.
  • Loading branch information
jbeich committed May 26, 2015
1 parent 57c5e7d commit 803e02e
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions Core/HLE/sceRtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,14 @@ static int sceRtcConvertLocalTimeToUTC(u32 tickLocalPtr,u32 tickUTCPtr)
{
u64 srcTick = Memory::Read_U64(tickLocalPtr);
// TODO : Let the user select his timezone / daylight saving instead of taking system param ?
#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick -= time->tm_gmtoff*1000000ULL;
#elif defined(_MSC_VER)
#ifdef _MSC_VER
long timezone_val;
_get_timezone(&timezone_val);
srcTick -= -timezone_val * 1000000ULL;
#else
srcTick -= -timezone * 1000000ULL;
#elif !defined(_AIX) && !defined(__sgi) && !defined(__hpux)
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick -= time->tm_gmtoff*1000000ULL;
#endif
Memory::Write_U64(srcTick, tickUTCPtr);
}
Expand All @@ -486,16 +484,14 @@ static int sceRtcConvertUtcToLocalTime(u32 tickUTCPtr,u32 tickLocalPtr)
{
u64 srcTick = Memory::Read_U64(tickUTCPtr);
// TODO : Let the user select his timezone / daylight saving instead of taking system param ?
#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick += time->tm_gmtoff*1000000ULL;
#elif defined(_MSC_VER)
#ifdef _MSC_VER
long timezone_val;
_get_timezone(&timezone_val);
srcTick += -timezone_val * 1000000ULL;
#else
srcTick += -timezone * 1000000ULL;
#elif !defined(_AIX) && !defined(__sgi) && !defined(__hpux)
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick += time->tm_gmtoff*1000000ULL;
#endif
Memory::Write_U64(srcTick, tickLocalPtr);
}
Expand Down Expand Up @@ -1023,16 +1019,14 @@ static int sceRtcFormatRFC2822LocalTime(u32 outPtr, u32 srcTickPtr)
}

int tz_seconds;
#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
#elif defined(_MSC_VER)
#ifdef _MSC_VER
long timezone_val;
_get_timezone(&timezone_val);
tz_seconds = -timezone_val;
#else
tz_seconds = -timezone;
#elif !defined(_AIX) && !defined(__sgi) && !defined(__hpux)
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
#endif

DEBUG_LOG(SCERTC, "sceRtcFormatRFC2822LocalTime(%08x, %08x)", outPtr, srcTickPtr);
Expand Down Expand Up @@ -1062,16 +1056,14 @@ static int sceRtcFormatRFC3339LocalTime(u32 outPtr, u32 srcTickPtr)
}

int tz_seconds;
#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
#elif defined(_MSC_VER)
#ifdef _MSC_VER
long timezone_val;
_get_timezone(&timezone_val);
tz_seconds = -timezone_val;
#else
tz_seconds = -timezone;
#elif !defined(_AIX) && !defined(__sgi) && !defined(__hpux)
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
#endif

DEBUG_LOG(SCERTC, "sceRtcFormatRFC3339LocalTime(%08x, %08x)", outPtr, srcTickPtr);
Expand Down

0 comments on commit 803e02e

Please sign in to comment.