Skip to content

Commit

Permalink
Fix set_bits
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Apr 1, 2015
1 parent 337e79c commit 699e066
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/numeric.h
Expand Up @@ -258,7 +258,7 @@ inline u32 get_bits(u32 x, u32 pos, u32 len)
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)

This comment has been minimized.

Copy link
@Zeno-

Zeno- Apr 1, 2015

Contributor

Are you able to document this function? (and the other new ones)

{
u32 mask = (1 << len) - 1;
*x &= ~(mask << len);
*x &= ~(mask << pos);
*x |= (val & mask) << pos;
}

Expand Down

0 comments on commit 699e066

Please sign in to comment.