mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-19 16:51:53 +00:00
Simplfy cmpack
This commit is contained in:
parent
419aca414d
commit
e4819f6410
1 changed files with 2 additions and 6 deletions
|
@ -188,13 +188,9 @@ static node_t nodes[MAXNETNODES];
|
|||
// 0 if a = n (mod 256)
|
||||
// >0 if a > b (mod 256)
|
||||
// mnemonic: to use it compare to 0: cmpack(a,b)<0 is "a < b" ...
|
||||
FUNCMATH static INT32 cmpack(UINT8 a, UINT8 b)
|
||||
FUNCMATH static inline INT32 cmpack(UINT8 a, UINT8 b)
|
||||
{
|
||||
register INT32 d = a - b;
|
||||
|
||||
if (d >= 127 || d < -128)
|
||||
return -d;
|
||||
return d;
|
||||
return (SINT8)(a - b);
|
||||
}
|
||||
|
||||
/** Sets freeack to a free acknum and copies the netbuffer in the ackpak table
|
||||
|
|
Loading…
Reference in a new issue