gcc 4.4.2 c89
I have these defines in our API header file.
/* 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 */
.
.
.
However, I want to pass one to a function but I am not sure of the type. I could pass as just an integer value? The release_call function takes one of these as its parameter. However, I am not sure as the defines are defined as hex notation.
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);
}
Many thanks for any suggestions,
0x06
and 6
(and CHANNEL_UNACCEPTABLE
) are equivalent. So is 0x11
and 17
(and USER_BUSY
). There is no distinction of hexadecimal or decimal to the computer.
(You should write drop_and_release_call(23, CHANNEL_UNACCEPTABLE)
for clarity.)
Yes, it's just an integer.
The hexadecimal aspect of it is only important when it's displayed for us to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With