Skip to content

Commit 7dffe00

Browse files
authored
Merge pull request #139 from saxbophone/develop
v0.21.2
2 parents 04d4ccb + 958433f commit 7dffe00

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# begin basic metadata
2424
cmake_minimum_required(VERSION 3.0)
2525

26-
project(libsaxbospiral VERSION 0.21.1 LANGUAGES C)
26+
project(libsaxbospiral VERSION 0.21.2 LANGUAGES C)
2727

2828
# set default C standard to use (C99) if not already set
2929
if(NOT DEFINED SAXBOSPIRAL_C_STANDARD)

saxbospiral/initialise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ sxbp_status_t sxbp_init_spiral(sxbp_buffer_t buffer, sxbp_spiral_t* spiral) {
8787
*/
8888
for(size_t s = 0; s < buffer.size; s++) {
8989
// byte-level loop
90-
for(size_t b = 0; b < 8; b++) {
90+
for(uint8_t b = 0; b < 8; b++) {
9191
// bit level loop
9292
uint8_t e = 7 - b; // which power of two to use with bit mask
9393
uint8_t bit = (buffer.bytes[s] & (1 << e)) >> e; // the current bit
94-
size_t index = (s * 8) + b + 1; // line index
94+
size_t index = (s * 8) + (size_t)b + 1; // line index
9595
sxbp_rotation_t rotation; // the rotation we're going to make
9696
// set rotation direction based on the current bit
9797
rotation = (bit == 0) ? SXBP_CLOCKWISE : SXBP_ANTI_CLOCKWISE;

saxbospiral/serialise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static uint64_t load_uint64_t(sxbp_buffer_t* buffer, size_t start_index) {
4949
// preconditional assertions
5050
assert(buffer->bytes != NULL);
5151
uint64_t value = 0;
52-
for(size_t i = 0; i < 8; i++) {
52+
for(uint8_t i = 0; i < 8; i++) {
5353
value |= (buffer->bytes[start_index + i]) << (8 * (7 - i));
5454
}
5555
return value;
@@ -65,7 +65,7 @@ static uint32_t load_uint32_t(sxbp_buffer_t* buffer, size_t start_index) {
6565
// preconditional assertions
6666
assert(buffer->bytes != NULL);
6767
uint32_t value = 0;
68-
for(size_t i = 0; i < 4; i++) {
68+
for(uint8_t i = 0; i < 4; i++) {
6969
value |= (buffer->bytes[start_index + i]) << (8 * (3 - i));
7070
}
7171
return value;

0 commit comments

Comments
 (0)