33#warning "Please compile this code for a target with 64-bit words or greater."
44#endif
55
6+ #include <stdint.h>
67#include <stdio.h>
78#include <stdlib.h>
89#include <string.h>
@@ -64,7 +65,7 @@ static void dump_uint32_t(uint32_t value, buffer_t* buffer, size_t start_index)
6465 * whether the operation was successful or not and information about what went
6566 * wrong if it was not successful
6667 */
67- serialise_result_t load_spiral (buffer_t buffer , spiral_t * spiral ) {
68+ serialise_result_t load_spiral (buffer_t buffer , spiral_t * spiral ) {
6869 serialise_result_t result ; // build struct for returning success / failure
6970 // first, if header is too small for header + 1 line, then return early
7071 if (buffer .size < FILE_HEADER_SIZE + LINE_T_PACK_SIZE ) {
@@ -74,7 +75,7 @@ serialise_result_t load_spiral(buffer_t buffer, spiral_t * spiral) {
7475 return result ;
7576 }
7677 // check for magic number and return early if not right
77- if (strncmp ((char * )buffer .bytes , "SAXBOSPIRAL" , 11 ) != 0 ) {
78+ if (strncmp ((char * )buffer .bytes , "SAXBOSPIRAL" , 11 ) != 0 ) {
7879 result .status .location = DEBUG ; // catch location of error
7980 result .status .diagnostic = OPERATION_FAIL ; // flag failure
8081 result .diagnostic = DESERIALISE_BAD_MAGIC_NUMBER ; // failure reason
@@ -153,7 +154,7 @@ serialise_result_t load_spiral(buffer_t buffer, spiral_t * spiral) {
153154 * whether the operation was successful or not and information about what went
154155 * wrong if it was not successful
155156 */
156- serialise_result_t dump_spiral (spiral_t spiral , buffer_t * buffer ) {
157+ serialise_result_t dump_spiral (spiral_t spiral , buffer_t * buffer ) {
157158 serialise_result_t result ; // build struct for returning success / failure
158159 // populate buffer struct, base size on header + spiral size
159160 buffer -> size = (FILE_HEADER_SIZE + (LINE_T_PACK_SIZE * spiral .size ));
@@ -167,7 +168,7 @@ serialise_result_t dump_spiral(spiral_t spiral, buffer_t * buffer) {
167168 }
168169 // write first part of data header (magic number and version info)
169170 sprintf (
170- (char * )buffer -> bytes , "SAXBOSPIRAL\n%c%c%c\n" ,
171+ (char * )buffer -> bytes , "SAXBOSPIRAL\n%c%c%c\n" ,
171172 VERSION .major , VERSION .minor , VERSION .patch
172173 );
173174 // write second part of data header (size, solved count and seconds fields)
0 commit comments