mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
cpukit/score/src/kern_ntptime.c: Negative Shift Value Warning
The code in question was shifting a signed integer. This was caught by the -Wshift-negative-value GCC warning. Closes #5339.
This commit is contained in:
@@ -116,6 +116,15 @@ typedef int64_t l_fp;
|
||||
#define L_MPY(v, a) ((v) *= (a))
|
||||
#define L_CLR(v) ((v) = 0)
|
||||
#define L_ISNEG(v) ((v) < 0)
|
||||
#ifdef __rtems__
|
||||
#define L_LINT(v, a) \
|
||||
do { \
|
||||
if ((a) < 0) \
|
||||
((v) = -((uint64_t)(-(a)) << 32)); \
|
||||
else \
|
||||
((v) = (uint64_t)(a) << 32); \
|
||||
} while (0)
|
||||
#else
|
||||
#define L_LINT(v, a) \
|
||||
do { \
|
||||
if ((a) < 0) \
|
||||
@@ -123,6 +132,7 @@ typedef int64_t l_fp;
|
||||
else \
|
||||
((v) = (int64_t)(a) << 32); \
|
||||
} while (0)
|
||||
#endif /* __rtems__ */
|
||||
#define L_GINT(v) ((v) < 0 ? -(-(v) >> 32) : (v) >> 32)
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user