Skip to content

Commit

Permalink
types.h: time_t as int64_t
Browse files Browse the repository at this point in the history
The following code will generate warnings:
auto now = time(nullptr);
auto last_active_time = GetEventService(self->ctx_)->getActiveTime();
if (last_active_time + 60 * 1000 / 1000 <= now) {

src/ams/../controller/controller_timer.h: In lambda function:
src/ams/../controller/controller_timer.h:117:57: warning: comparison of integer expressions of different signedness: 'long long int' and 'long long unsigned int' [-Wsign-compare]
  117 |                 if (last_active_time + 60 * 1000 / 1000 <= now) {

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI committed Oct 22, 2024
1 parent b4a6d45 commit 7720a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ typedef uint16_t sa_family_t;

#ifdef CONFIG_SYSTEM_TIME64
typedef uint64_t clock_t;
typedef uint64_t time_t; /* Holds time in seconds */
typedef int64_t time_t; /* Holds time in seconds */
#else
typedef uint32_t clock_t;
typedef uint32_t time_t; /* Holds time in seconds */
Expand Down

0 comments on commit 7720a88

Please sign in to comment.