Skip to content

Commit c779972

Browse files
authored
Merge pull request #70 from saxbophone/develop
v0.12.2
2 parents 24bc946 + ecc8d2b commit c779972

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# begin basic metadata
22
cmake_minimum_required(VERSION 3.0)
33

4-
project(saxbospiral VERSION 0.12.1 LANGUAGES C)
4+
project(saxbospiral VERSION 0.12.2 LANGUAGES C)
55
set(CMAKE_C_STANDARD 99)
66
set(CMAKE_C_STANDARD_REQUIRED ON)
77
set(

saxbospiral.png

-1 Bytes
Loading

saxbospiral/plot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spiral_points(
3535
size_t start, size_t end
3636
) {
3737
// prepare result status
38-
status_t result = {0};
38+
status_t result = {{0, 0, 0}, 0};
3939
// the amount of space needed is the sum of all line lengths + 1 for end
4040
size_t size = sum_lines(spiral, start, end) + 1;
4141
// allocate memory
@@ -82,7 +82,7 @@ spiral_points(
8282
status_t
8383
cache_spiral_points(spiral_t * spiral, size_t limit) {
8484
// prepare result status
85-
status_t result = {0};
85+
status_t result = {{0, 0, 0}, 0};
8686
// the amount of space needed is the sum of all line lengths + 1 for end
8787
size_t size = sum_lines(*spiral, 0, limit) + 1;
8888
// allocate / reallocate memory
@@ -126,7 +126,7 @@ cache_spiral_points(spiral_t * spiral, size_t limit) {
126126
spiral->co_ord_cache.co_ords.items[0] = current;
127127
}
128128
// calculate the missing co-ords
129-
co_ord_array_t missing= {0};
129+
co_ord_array_t missing= {0, 0};
130130
status_t calculate_result = spiral_points(
131131
*spiral, &missing, current, smallest, limit
132132
);

saxbospiral/render.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ get_bounds(spiral_t spiral, co_ord_t * bounds) {
5858
status_t
5959
render_spiral(spiral_t spiral, bitmap_t * image) {
6060
// create result status struct
61-
status_t result = {0};
61+
status_t result = {{0, 0, 0}, 0};
6262
// plot co-ords of spiral into it's cache
6363
cache_spiral_points(&spiral, spiral.size);
6464
// get the min and max bounds of the spiral's co-ords
65-
co_ord_t bounds[2] = {0};
65+
co_ord_t bounds[2] = {{0, 0}};
6666
get_bounds(spiral, bounds);
6767
// get the normalisation vector needed to make all values unsigned
6868
tuple_t normalisation_vector = {

saxbospiral/solve.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ resize_spiral(
184184
* state of which line is being resized, and what size it should be.
185185
*/
186186
// set result status
187-
status_t result = {0};
187+
status_t result = {{0, 0, 0}, 0};
188188
size_t current_index = index;
189189
length_t current_length = length;
190190
while(true) {
@@ -244,7 +244,7 @@ resize_spiral(
244244
status_t
245245
plot_spiral(spiral_t * spiral, int perfection_threshold) {
246246
// set up result status
247-
status_t result = {0};
247+
status_t result = {{0, 0, 0}, 0};
248248
// calculate the length of each line
249249
for(size_t i = 0; i < spiral->size; i++) {
250250
result = resize_spiral(spiral, i, 1, perfection_threshold);

sxp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ run(
157157
return false;
158158
}
159159
// make input buffer
160-
buffer_t input_buffer = {0};
160+
buffer_t input_buffer = {0, 0};
161161
// make output buffer
162-
buffer_t output_buffer = {0};
162+
buffer_t output_buffer = {0, 0};
163163
// read input file into buffer
164164
bool read_ok = file_to_buffer(input_file, &input_buffer);
165165
// used later for telling if write of output file was success
@@ -172,7 +172,7 @@ run(
172172
return false;
173173
}
174174
// create initial blank spiral struct
175-
spiral_t spiral = {0};
175+
spiral_t spiral = {0, 0, {{0, 0}, 0}, 0};
176176
// resolve perfection threshold - set to -1 if disabled completely
177177
int perfection = (perfect == false) ? -1 : perfect_threshold;
178178
// check error condition (where no actions were specified)
@@ -212,7 +212,7 @@ run(
212212
}
213213
if(render) {
214214
// we must render an image from spiral
215-
bitmap_t image = {0};
215+
bitmap_t image = {0, 0, 0};
216216
if(handle_error(render_spiral(spiral, &image))) {
217217
// handle errors
218218
return false;

tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ test_spiral_points() {
105105
};
106106

107107
// create struct for results
108-
co_ord_array_t results = {0};
108+
co_ord_array_t results = {0, 0};
109109
// call spiral_points on struct with start point and maximum limit
110110
spiral_points(input, &results, expected[0], 0, 16);
111111

0 commit comments

Comments
 (0)