@@ -129,15 +129,13 @@ sxbp_serialise_result_t sxbp_load_spiral(
129129 sxbp_serialise_result_t result ; // build struct for returning success / failure
130130 // first, if header is too small for header + 1 line, then return early
131131 if (buffer .size < SXBP_FILE_HEADER_SIZE + SXBP_LINE_T_PACK_SIZE ) {
132- result .status .location = SXBP_DEBUG ; // catch location of error
133- result .status .diagnostic = SXBP_OPERATION_FAIL ; // flag failure
132+ result .status = SXBP_OPERATION_FAIL ; // flag failure
134133 result .diagnostic = SXBP_DESERIALISE_BAD_HEADER_SIZE ; // failure reason
135134 return result ;
136135 }
137136 // check for magic number and return early if not right
138137 if (strncmp ((char * )buffer .bytes , "SAXBOSPIRAL" , 11 ) != 0 ) {
139- result .status .location = SXBP_DEBUG ; // catch location of error
140- result .status .diagnostic = SXBP_OPERATION_FAIL ; // flag failure
138+ result .status = SXBP_OPERATION_FAIL ; // flag failure
141139 result .diagnostic = SXBP_DESERIALISE_BAD_MAGIC_NUMBER ; // failure reason
142140 return result ;
143141 }
@@ -152,8 +150,7 @@ sxbp_serialise_result_t sxbp_load_spiral(
152150 // check for version compatibility
153151 if (sxbp_version_hash (buffer_version ) < sxbp_version_hash (min_version )) {
154152 // check failed
155- result .status .location = SXBP_DEBUG ; // catch location of error
156- result .status .diagnostic = SXBP_OPERATION_FAIL ; // flag failure
153+ result .status = SXBP_OPERATION_FAIL ; // flag failure
157154 result .diagnostic = SXBP_DESERIALISE_BAD_VERSION ; // failure reason
158155 return result ;
159156 }
@@ -162,8 +159,7 @@ sxbp_serialise_result_t sxbp_load_spiral(
162159 // Check that the file data section is large enough for the spiral size
163160 if ((buffer .size - SXBP_FILE_HEADER_SIZE ) != (SXBP_LINE_T_PACK_SIZE * spiral_size )) {
164161 // this check failed
165- result .status .location = SXBP_DEBUG ; // catch location of error
166- result .status .diagnostic = SXBP_OPERATION_FAIL ; // flag failure
162+ result .status = SXBP_OPERATION_FAIL ; // flag failure
167163 result .diagnostic = SXBP_DESERIALISE_BAD_DATA_SIZE ; // failure reason
168164 return result ;
169165 }
@@ -176,8 +172,7 @@ sxbp_serialise_result_t sxbp_load_spiral(
176172 spiral -> lines = calloc (sizeof (sxbp_line_t ), spiral -> size );
177173 // catch allocation error
178174 if (spiral -> lines == NULL ) {
179- result .status .location = SXBP_DEBUG ; // catch location of error
180- result .status .diagnostic = SXBP_MALLOC_REFUSED ; // flag failure
175+ result .status = SXBP_MALLOC_REFUSED ; // flag failure
181176 return result ;
182177 }
183178 // convert each serialised line segment in buffer into a line_t struct
@@ -203,7 +198,7 @@ sxbp_serialise_result_t sxbp_load_spiral(
203198 }
204199 }
205200 // return ok status
206- result .status . diagnostic = SXBP_OPERATION_OK ;
201+ result .status = SXBP_OPERATION_OK ;
207202 return result ;
208203}
209204
@@ -231,8 +226,7 @@ sxbp_serialise_result_t sxbp_dump_spiral(
231226 buffer -> bytes = calloc (1 , buffer -> size );
232227 // catch memory allocation failure
233228 if (buffer -> bytes == NULL ) {
234- result .status .location = SXBP_DEBUG ;
235- result .status .diagnostic = SXBP_MALLOC_REFUSED ;
229+ result .status = SXBP_MALLOC_REFUSED ;
236230 return result ;
237231 }
238232 // write first part of data header (magic number and version info)
@@ -267,7 +261,7 @@ sxbp_serialise_result_t sxbp_dump_spiral(
267261 }
268262 }
269263 // return ok status
270- result .status . diagnostic = SXBP_OPERATION_OK ;
264+ result .status = SXBP_OPERATION_OK ;
271265 return result ;
272266}
273267
0 commit comments