resume uint32 define time_t

N/A

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Change-Id: Ica1a71e8977568c9403feb455de295e9a846463a
This commit is contained in:
anjiahao
2021-10-20 12:14:39 +08:00
parent 12a149e41d
commit 89289e6014
4 changed files with 3 additions and 5 deletions
-2
View File
@@ -230,10 +230,8 @@ typedef uint16_t sa_family_t;
#ifdef CONFIG_SYSTEM_TIME64
typedef uint64_t clock_t;
typedef int64_t time_t;
#else
typedef uint32_t clock_t;
typedef int32_t time_t;
#endif
/* The type useconds_t shall be an unsigned integer type capable of storing
+1
View File
@@ -102,6 +102,7 @@
/* Scalar types */
typedef uint32_t time_t; /* Holds time in seconds */
typedef uint8_t clockid_t; /* Identifies one time base source */
typedef FAR void *timer_t; /* Represents one POSIX timer */
+1 -1
View File
@@ -2265,7 +2265,7 @@ static time_t time2sub(FAR struct tm *tmp,
else
{
lo = 1;
for (i = 1; i < (int)TYPE_BIT(time_t) - 1; ++i)
for (i = 0; i < (int)TYPE_BIT(time_t) - 1; ++i)
{
lo *= 2;
}
+1 -2
View File
@@ -65,8 +65,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
*/
if (clock_id == CLOCK_REALTIME &&
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000 &&
tp->tv_sec >= 0)
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000)
{
#ifndef CONFIG_CLOCK_TIMEKEEPING
/* Interrupts are disabled here so that the in-memory time