请教(void) 0的用法,在线等~~~~
#define NU_SUPERVISOR_MODE() ((void) 0)
#define NU_USER_MODE() ((void) 0)
VOID CSC_Place_On_List(CS_NODE **head, CS_NODE *new_node)
{
NU_SUPERV_USER_VARIABLES
/* Switch to supervisor mode */
NU_SUPERVISOR_MODE();
/* Determine if the list in non-empty. */
if (*head)
{
/* The list is not empty. Add the new node to the end of
the list. */
new_node -> cs_previous = (*head) -> cs_previous;
(new_node -> cs_previous) -> cs_next = new_node;
new_node -> cs_next = (*head);
(new_node -> cs_next) -> cs_previous = new_node;
}
else
{
/* The list is empty, setup the head and the new node. */
(*head) = new_node;
new_node -> cs_previous = new_node;
new_node -> cs_next = new_node;
}
/* Return to user mode */
NU_USER_MODE();
}
--------------------
这是Nucleus的一段代码,我看不懂下面这两段代码:
NU_SUPERVISOR_MODE();
NU_USER_MODE();
请问这两句代码的作用?
谢谢
[解决办法]
mark之
[解决办法]
0啊,只是个占位的,在这个代码,什么用都没有,
编译过后,就会被编译器给扔了。
[解决办法]
#define NU_SUPERVISOR_MODE() ((void) 0)
#define NU_USER_MODE() ((void) 0)
从上面的代码看,没任何作用,除了提示以下
跟
#define NU_SUPERVISOR_MODE()
#define NU_USER_MODE()
效果一样的
但是,如果以后它想实现模型功能,只要直接改这两个宏就可以了
[解决办法]
Mark!
不会作具体事情,看来是预留的。
[解决办法]
想想 ASSERT() 宏