refactor NGE_INC macro for improved robustness and operator precedence handling. The NGE_INC(x, y) macro was corrected to include additional parenthesis to ensure the proper order of operations. It now increments x by 1 and applies the modulo y correctly, ensuring consistent and error-free behavior, particularly in complex expressions
This commit is contained in:
parent
f857de4ffe
commit
b13fe1161c
@ -528,7 +528,7 @@ struct nge_desc_32 {
|
||||
|
||||
#define NGE_LASTDESC(x) (!((x)->nge_ctl & NGE_CMDSTS_MORE))
|
||||
#define NGE_OWNDESC(x) ((x)->nge_ctl & NGE_CMDSTS_OWN)
|
||||
#define NGE_INC(x, y) (x) = (x + 1) % y
|
||||
#define NGE_INC(x, y) ((x) = ((x) + 1) % (y))
|
||||
#define NGE_RXBYTES(x) ((x)->nge_ctl & NGE_CMDSTS_BUFLEN)
|
||||
|
||||
#define NGE_RXSTAT_RANGELENERR 0x00010000
|
||||
|
Loading…
Reference in New Issue
Block a user