将十六进制数传递给函数

ant*_*009 4 c

gcc 4.4.2 c89

我在API头文件中有这些定义.

/* Reason for releasing call */
#define UNASSIGNED_NUMBER      0x01  /* Number unassigned / unallocated */
#define NORMAL_CLEARING        0x10  /* Call dropped under normal conditions*/
#define CHANNEL_UNACCEPTABLE   0x06
#define USER_BUSY              0x11  /* End user is busy */
.
.
.
Run Code Online (Sandbox Code Playgroud)

但是,我想将一个传递给一个函数,但我不确定该类型.我可以传递一个整数值?release_call函数将其中一个作为参数.但是,我不确定定义是否定义为十六进制表示法.

drop_and_release_call(23, 6); /* Dropping call for CHANNEL_UNACCEPTABLE */


uint32_t drop_and_release_call(uint32_t port_num, uint32_t reason)
{
    release_call(port_num, reason);
}
Run Code Online (Sandbox Code Playgroud)

非常感谢任何建议,

ken*_*ytm 6

0x066(和CHANNEL_UNACCEPTABLE)是等价的.是0x1117(和USER_BUSY).十六进制或十进制与计算机没有区别.

(你应该drop_and_release_call(23, CHANNEL_UNACCEPTABLE)清楚.)