You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/08/12 21:56:18 UTC
[2/2] git commit: Make NumUtil uXget functions take const pointers
Make NumUtil uXget functions take const pointers
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/c8f1158d
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/c8f1158d
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/c8f1158d
Branch: refs/heads/const_pointers
Commit: c8f1158d0007e06812d59be0a1292be6b9e44793
Parents: 31c2567
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Aug 12 21:01:23 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Aug 12 21:01:23 2014 +0200
----------------------------------------------------------------------
runtime/core/Clownfish/Util/NumberUtils.cfh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/c8f1158d/runtime/core/Clownfish/Util/NumberUtils.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Util/NumberUtils.cfh b/runtime/core/Clownfish/Util/NumberUtils.cfh
index b436d90..565359d 100644
--- a/runtime/core/Clownfish/Util/NumberUtils.cfh
+++ b/runtime/core/Clownfish/Util/NumberUtils.cfh
@@ -131,7 +131,7 @@ inert class Clownfish::Util::NumberUtils nickname NumUtil {
* bit at <code>tick</code> is set, false otherwise.
*/
inert inline bool
- u1get(void *array, uint32_t tick);
+ u1get(const void *array, uint32_t tick);
/** Interpret <code>array</code> as an array of bits; set the bit at
* <code>tick</code>.
@@ -155,7 +155,7 @@ inert class Clownfish::Util::NumberUtils nickname NumUtil {
* the value at <code>tick</code>.
*/
inert inline uint8_t
- u2get(void *array, uint32_t tick);
+ u2get(const void *array, uint32_t tick);
/** Interpret <code>array</code> as an array of two-bit integers; set the
* element at <code>tick</code> to <code>value</code>.
@@ -167,7 +167,7 @@ inert class Clownfish::Util::NumberUtils nickname NumUtil {
* the value at <code>tick</code>.
*/
inert inline uint8_t
- u4get(void *array, uint32_t tick);
+ u4get(const void *array, uint32_t tick);
/** Interpret <code>array</code> as an array of four-bit integers; set the
* element at <code>tick</code> to <code>value</code>.
@@ -394,7 +394,7 @@ cfish_NumUtil_skip_cint(const char **source_ptr) {
}
static CFISH_INLINE bool
-cfish_NumUtil_u1get(void *array, uint32_t tick) {
+cfish_NumUtil_u1get(const void *array, uint32_t tick) {
uint8_t *const u8bits = (uint8_t*)array;
const uint32_t byte_offset = tick >> 3;
const uint8_t mask = cfish_NumUtil_u1masks[tick & 0x7];
@@ -426,7 +426,7 @@ cfish_NumUtil_u1flip(void *array, uint32_t tick) {
}
static CFISH_INLINE uint8_t
-cfish_NumUtil_u2get(void *array, uint32_t tick) {
+cfish_NumUtil_u2get(const void *array, uint32_t tick) {
uint8_t *ints = (uint8_t*)array;
uint8_t byte = ints[(tick >> 2)];
int shift = cfish_NumUtil_u2shifts[tick & 0x3];
@@ -446,7 +446,7 @@ cfish_NumUtil_u2set(void *array, uint32_t tick, uint8_t value) {
static CFISH_INLINE uint8_t
-cfish_NumUtil_u4get(void *array, uint32_t tick) {
+cfish_NumUtil_u4get(const void *array, uint32_t tick) {
uint8_t *ints = (uint8_t*)array;
uint8_t byte = ints[(tick >> 1)];
int shift = cfish_NumUtil_u4shifts[(tick & 1)];