Skip to content

Commit

Permalink
fixing c headers
Browse files Browse the repository at this point in the history
  • Loading branch information
sjml committed Nov 17, 2024
1 parent f55f91a commit 464bc8d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion beschi/writers/boilerplate/C.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#ifndef INCLUDE_BESCHI_H
#define INCLUDE_BESCHI_H

#include <stdbool.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

typedef uint8_t beschi_err_t;
#define BESCHI_ERR_OK 0
Expand Down
3 changes: 2 additions & 1 deletion beschi/writers/boilerplate/C.1.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ beschi_err_t beschi__ReadString(beschi_DataAccess *r, char **s, {# STRING_SIZE_T
if (r->bufferSize < r->position + *len) {
return BESCHI_ERR_EOF;
}
*s = (char*)calloc(1, (size_t)(*len + 1));
*s = (char*)BESCHI_MALLOC((size_t)(*len + 1));
if (*s == NULL) { return BESCHI_ERR_ALLOCATION_FAILURE; }
memcpy(*s, r->buffer + r->position, *len);
(*s)[*len] = '\0';
r->position += *len;
return BESCHI_ERR_OK;
}
Expand Down
1 change: 0 additions & 1 deletion docs/dev/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ This file is a rough todo list for the tool itself.

## dustoff notes
- add endian handling to C writer for the sake of completion
- GCC has found some more warnings if -Wextra is turned on; look at those
- test suite for destroying and cleaning up messages
- add notes about trustworthiness
- all reading code assumes it's reading stuff that was written by a corresponding writer
Expand Down

0 comments on commit 464bc8d

Please sign in to comment.