mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
resume uint32 define time_t
N/A Signed-off-by: anjiahao <anjiahao@xiaomi.com> Change-Id: Ica1a71e8977568c9403feb455de295e9a846463a
This commit is contained in:
@@ -230,10 +230,8 @@ typedef uint16_t sa_family_t;
|
|||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
#ifdef CONFIG_SYSTEM_TIME64
|
||||||
typedef uint64_t clock_t;
|
typedef uint64_t clock_t;
|
||||||
typedef int64_t time_t;
|
|
||||||
#else
|
#else
|
||||||
typedef uint32_t clock_t;
|
typedef uint32_t clock_t;
|
||||||
typedef int32_t time_t;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The type useconds_t shall be an unsigned integer type capable of storing
|
/* The type useconds_t shall be an unsigned integer type capable of storing
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
|
|
||||||
/* Scalar types */
|
/* Scalar types */
|
||||||
|
|
||||||
|
typedef uint32_t time_t; /* Holds time in seconds */
|
||||||
typedef uint8_t clockid_t; /* Identifies one time base source */
|
typedef uint8_t clockid_t; /* Identifies one time base source */
|
||||||
typedef FAR void *timer_t; /* Represents one POSIX timer */
|
typedef FAR void *timer_t; /* Represents one POSIX timer */
|
||||||
|
|
||||||
|
|||||||
@@ -2265,7 +2265,7 @@ static time_t time2sub(FAR struct tm *tmp,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
lo = 1;
|
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;
|
lo *= 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,8 +65,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (clock_id == CLOCK_REALTIME &&
|
if (clock_id == CLOCK_REALTIME &&
|
||||||
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000 &&
|
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000)
|
||||||
tp->tv_sec >= 0)
|
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
||||||
/* Interrupts are disabled here so that the in-memory time
|
/* Interrupts are disabled here so that the in-memory time
|
||||||
|
|||||||
Reference in New Issue
Block a user