Skip to content

Commit ba16ae2

Browse files
committed
Move PRISM_NODISCARD to the correct position
1 parent eb1d518 commit ba16ae2

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

include/prism/arena.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef struct pm_arena_t pm_arena_t;
2525
* the caller to free the arena using pm_arena_free when it is no longer
2626
* needed.
2727
*/
28-
PRISM_EXPORTED_FUNCTION pm_arena_t * pm_arena_new(void) PRISM_NODISCARD;
28+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_arena_t * pm_arena_new(void);
2929

3030
/**
3131
* Frees both the held memory and the arena itself.

include/prism/buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct pm_buffer_t pm_buffer_t;
2424
* @returns A pointer to the initialized buffer. The caller is responsible for
2525
* freeing the buffer with pm_buffer_free.
2626
*/
27-
PRISM_EXPORTED_FUNCTION pm_buffer_t * pm_buffer_new(void) PRISM_NODISCARD;
27+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_buffer_t * pm_buffer_new(void);
2828

2929
/**
3030
* Free both the memory held by the buffer and the buffer itself.

include/prism/options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20;
114114
* @returns A new options struct with default values. It is the responsibility
115115
* of the caller to free this struct using pm_options_free().
116116
*/
117-
PRISM_EXPORTED_FUNCTION pm_options_t * pm_options_new(void) PRISM_NODISCARD;
117+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_options_t * pm_options_new(void);
118118

119119
/**
120120
* Free both the held memory of the given options struct and the struct itself.

include/prism/parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct pm_parser_t pm_parser_t;
3333
* @returns The initialized parser. It is the responsibility of the caller to
3434
* free the parser with `pm_parser_free()`.
3535
*/
36-
PRISM_EXPORTED_FUNCTION pm_parser_t * pm_parser_new(pm_arena_t *arena, const uint8_t *source, size_t size, const pm_options_t *options) PRISM_NODISCARD PRISM_NONNULL(1);
36+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_parser_t * pm_parser_new(pm_arena_t *arena, const uint8_t *source, size_t size, const pm_options_t *options) PRISM_NONNULL(1);
3737

3838
/**
3939
* Free both the memory held by the given parser and the parser itself.

include/prism/source.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef enum {
6666
* @param length The length of the source data in bytes.
6767
* @returns A new source. Aborts on allocation failure.
6868
*/
69-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_constant_new(const uint8_t *data, size_t length) PRISM_NODISCARD;
69+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_constant_new(const uint8_t *data, size_t length);
7070

7171
/**
7272
* Create a new source that wraps existing shared memory. The memory is not
@@ -76,7 +76,7 @@ PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_constant_new(const uint8_t *data
7676
* @param length The length of the source data in bytes.
7777
* @returns A new source. Aborts on allocation failure.
7878
*/
79-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_shared_new(const uint8_t *data, size_t length) PRISM_NODISCARD;
79+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_shared_new(const uint8_t *data, size_t length);
8080

8181
/**
8282
* Create a new source that owns its memory. The memory will be freed with
@@ -86,7 +86,7 @@ PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_shared_new(const uint8_t *data,
8686
* @param length The length of the source data in bytes.
8787
* @returns A new source. Aborts on allocation failure.
8888
*/
89-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_owned_new(uint8_t *data, size_t length) PRISM_NODISCARD;
89+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_owned_new(uint8_t *data, size_t length);
9090

9191
/**
9292
* Create a new source by reading a file into a heap-allocated buffer.
@@ -95,7 +95,7 @@ PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_owned_new(uint8_t *data, size_t
9595
* @param result Out parameter for the result of the initialization.
9696
* @returns A new source, or NULL on error (with result written to out param).
9797
*/
98-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_file_new(const char *filepath, pm_source_init_result_t *result) PRISM_NODISCARD PRISM_NONNULL(1, 2);
98+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_file_new(const char *filepath, pm_source_init_result_t *result) PRISM_NONNULL(1, 2);
9999

100100
/**
101101
* Create a new source by memory-mapping a file. Falls back to file reading on
@@ -110,7 +110,7 @@ PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_file_new(const char *filepath, p
110110
* @param result Out parameter for the result of the initialization.
111111
* @returns A new source, or NULL on error (with result written to out param).
112112
*/
113-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_mapped_new(const char *filepath, int open_flags, pm_source_init_result_t *result) PRISM_NODISCARD PRISM_NONNULL(1, 3);
113+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_mapped_new(const char *filepath, int open_flags, pm_source_init_result_t *result) PRISM_NONNULL(1, 3);
114114

115115
/**
116116
* Create a new source by reading from a stream using the provided callbacks.
@@ -120,7 +120,7 @@ PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_mapped_new(const char *filepath,
120120
* @param feof The function to use to check if the stream is at EOF.
121121
* @returns A new source. Aborts on allocation failure.
122122
*/
123-
PRISM_EXPORTED_FUNCTION pm_source_t * pm_source_stream_new(void *stream, pm_source_stream_fgets_t *fgets, pm_source_stream_feof_t *feof) PRISM_NODISCARD;
123+
PRISM_EXPORTED_FUNCTION PRISM_NODISCARD pm_source_t * pm_source_stream_new(void *stream, pm_source_stream_fgets_t *fgets, pm_source_stream_feof_t *feof);
124124

125125
/**
126126
* Free the given source and any memory it owns.

0 commit comments

Comments
 (0)