mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
nuttx/math: fix greenhills build warning on using sizeof with operand
the detailed warning info are:
CC: syslog/vsyslog.c "pthread/pthread_create.c", line 443: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
ptcb->cmn.timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: dirent/lib_closedir.c "sched/sched_profil.c", line 81: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
^
"sched/sched_profil.c", line 142: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, (wdparm_t)prof);
^
CC: common/arm_modifyreg8.c "sched/sched_setscheduler.c", line 165: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: misc/lib_utsname.c "sched/sched_unlock.c", line 275: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
rtcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
"sched/sched_roundrobin.c", line 119: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: armv7-m/arm_fpuconfig.c cxarm: Error: No files. Try -help.
CC: misc/lib_crc8ccitt.c cxarm: Error: No files. Try -help.
cxarm: Error: No files. Try -help.
CC: getprime_main.c cxarm: Error: No files. Try -help.
cxarm: Error: No files. Try -help.
CC: misc/lib_log2ceil.c cxarm: Error: No files. Try -help.
CC: task/task_start.c "task/task_setup.c", line 423: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
@@ -260,12 +260,12 @@ extern "C"
|
||||
})
|
||||
|
||||
# define div_const(n, base) \
|
||||
((sizeof(n) == sizeof(uint64_t)) ? div64_const(n, base) : ((n) / (base)))
|
||||
((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const(n, base) : ((n) / (base)))
|
||||
# define div_const_roundup(n, base) \
|
||||
((sizeof(n) == sizeof(uint64_t)) ? div64_const((n) + (base) - 1, base) : \
|
||||
((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const((n) + (base) - 1, base) : \
|
||||
(((n) + (base) - 1) / (base)))
|
||||
# define div_const_roundnearest(n, base) \
|
||||
((sizeof(n) == sizeof(uint64_t)) ? div64_const((n) + ((base) / 2), base) : \
|
||||
((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const((n) + ((base) / 2), base) : \
|
||||
(((n) + ((base) / 2)) / (base)))
|
||||
#else
|
||||
# define div_const(n, base) ((n) / (base))
|
||||
|
||||
Reference in New Issue
Block a user