copperplate/clockobj: prevent warning with -Wconversion
PATCH 1/1 copperplate/clockobj: prevent warning with -Wconversion
make cast explicit to avoid warning when user code is compiled with -Wconversion
---
include/copperplate/clockobj.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0
b/include/copperplate/clockobj.h
index 8568794d9..063bcce90 100644
include/copperplate/clockobj.h +0 -0
@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct
timespec *ts)
{
unsigned long rem;
- ts->tv_sec = cobalt_divrem_billion(ns, &rem);
+ ts->tv_sec = (__kernel_time_t)cobalt_divrem_billion(ns, &rem);
ts->tv_nsec = rem;
}
--
2.11.0
Quoted 2 lines · Mauro Salvini
make cast explicit to avoid warning when user code is compiled with -Wconversion
Please sign-off your patches, according to CONTRIBUTING.md.
include/copperplate/clockobj.h void clockobj_ns_to_timespec(ticks_t ns, struct · line 136
Quoted 11 lines
--- include/copperplate/clockobj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/copperplate/clockobj.h +0
-0@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts)
Something mangled this line, probably your mail client.
include/copperplate/clockobj.h void clockobj_ns_to_timespec(ticks_t ns, struct · line 140
Quoted 5 lines
include/copperplate/clockobj.h +1
-1{ unsigned long rem; - ts->tv_sec =cobalt_divrem_billion (ns, &rem); + ts->tv_sec = (__kernel_time_t )cobalt_divrem_billion (ns, &rem);
Why not time_t, the public target type?
Quoted 7 lines
include/copperplate/clockobj.h +0
-0ts->tv_nsec = rem; }Signature · 2 lines
-- 2.11.0
Thanks,
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
PATCH 1/1 copperplate/clockobj: prevent warning with -Wconversion
make cast explicit to avoid warning when user code is compiled with -Wconversion
--- include/copperplate/clockobj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/copperplate/clockobj.h +1 -1
@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts) {unsigned long rem; - ts->tv_sec =cobalt_divrem_billion (ns, &rem); + ts->tv_sec = (time_t )cobalt_divrem_billion (ns, &rem); ts->tv_nsec = rem; }
Signature · 1 line
2.11.0
Jan Kiszka
AppliedQuoted 14 lines · Mauro Salvini via Xenomai
make cast explicit to avoid warning when user code is compiled with -Wconversion
Signed-off-by Mauro Salvini <[email protected]>--- include/copperplate/clockobj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/copperplate/clockobj.h +0
-0
include/copperplate/clockobj.h void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts) · line 142
Quoted 8 lines
include/copperplate/clockobj.h +1
-1@@ -136,7 +136,7 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec *ts) {unsigned long rem; - ts->tv_sec =cobalt_divrem_billion (ns, &rem); + ts->tv_sec = (time_t )cobalt_divrem_billion (ns, &rem); ts->tv_nsec = rem; }
Thanks, applied.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux