projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
337e79c
)
Fix set_bits
author
kwolekr
<kwolekr@minetest.net>
Wed, 1 Apr 2015 03:30:44 +0000
(23:30 -0400)
committer
kwolekr
<kwolekr@minetest.net>
Wed, 1 Apr 2015 03:30:44 +0000
(23:30 -0400)
src/util/numeric.h
patch
|
blob
|
history
diff --git
a/src/util/numeric.h
b/src/util/numeric.h
index 74c1dfea623cbfeadbe5ea5f4117c89c9751aab5..a158a2eaeb34c83c185411d4e177e21cc7f0847b 100644
(file)
--- a/
src/util/numeric.h
+++ b/
src/util/numeric.h
@@
-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)
{
u32 mask = (1 << len) - 1;
- *x &= ~(mask <<
len
);
+ *x &= ~(mask <<
pos
);
*x |= (val & mask) << pos;
}