mirror of
https://github.com/proski/madwifi
synced 2024-11-22 06:21:47 +03:00
Copy new macros from the DFS branch
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3823 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
9fb3122e7a
commit
8d74405839
@ -90,6 +90,15 @@
|
||||
|
||||
#define howmany(x, y) (((x)+((y)-1))/(y))
|
||||
|
||||
/* roundup() and howmany() macros that works both with positive and negative
|
||||
* values. */
|
||||
#define roundup_s(x,y) _roundup_s((signed)(x),(signed)(y))
|
||||
#define howmany_s(x,y) _howmany_s((signed)(x),(signed)(y))
|
||||
#define _roundup_s(x,y) \
|
||||
((x) >= 0 ? (((x)+((y)-1))/(y))*(y) : ((x)/(y))*(y))
|
||||
#define _howmany_s(x, y) \
|
||||
((x) >= 0 ? (((x)+((y)-1))/(y)) : ((x)/(y)))
|
||||
|
||||
/* Bit map related macros. */
|
||||
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
|
||||
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
|
||||
|
Loading…
Reference in New Issue
Block a user