Skip to content

Commit

Permalink
Specify 1U over 1 for bitmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR committed Oct 14, 2023
1 parent 2d437c7 commit 9213739
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions include/sudo_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
#define ssizeof(_x) ((ssize_t)sizeof(_x))

/* Bit map macros. */
#define sudo_setbit(_a, _i) ((_a)[(_i) / NBBY] |= 1 << ((_i) % NBBY))
#define sudo_clrbit(_a, _i) ((_a)[(_i) / NBBY] &= ~(1<<((_i) % NBBY)))
#define sudo_isset(_a, _i) ((_a)[(_i) / NBBY] & (1<<((_i) % NBBY)))
#define sudo_isclr(_a, _i) (((_a)[(_i) / NBBY] & (1<<((_i) % NBBY))) == 0)
#define sudo_setbit(_a, _i) ((_a)[(_i) / NBBY] |= 1U << ((_i) % NBBY))
#define sudo_clrbit(_a, _i) ((_a)[(_i) / NBBY] &= ~(1U<<((_i) % NBBY)))
#define sudo_isset(_a, _i) ((_a)[(_i) / NBBY] & (1U<<((_i) % NBBY)))
#define sudo_isclr(_a, _i) (((_a)[(_i) / NBBY] & (1U<<((_i) % NBBY))) == 0)

/* Macros to determine the length of a type in string form. */
#define STRLEN_MAX_UNSIGNED(t) (((sizeof(t) * 8 * 1233) >> 12) + 1)
Expand Down
4 changes: 2 additions & 2 deletions src/exec_ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@

/* Align address to a (compat) word boundary. */
#define WORDALIGN(_a, _r) \
(((_a) + ((long)(_r).wordsize - 1L)) & ~((long)(_r).wordsize - 1L))
(((_a) + ((unsigned long)(_r).wordsize - 1UL)) & ~((unsigned long)(_r).wordsize - 1UL))

/* Align pointer to a native word boundary. */
#define LONGALIGN(_p) \
(((unsigned long)(_p) + (sizeof(long) - 1)) & ~(sizeof(long) - 1))
(((unsigned long)(_p) + (sizeof(unsigned long) - 1UL)) & ~(sizeof(unsigned long) - 1UL))

/*
* See syscall(2) for a list of registers used in system calls.
Expand Down

0 comments on commit 9213739

Please sign in to comment.