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:
Joel Sherrill
2025-09-18 17:48:06 -05:00
parent 948bbec7f6
commit 78e050f603

View File

@@ -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)
/*