Browse Source

[multiple] mark addtl funcs attr returns_nonnull

master
Glenn Strauss 7 months ago
parent
commit
dde9df4310
  1. 3
      src/array.h
  2. 3
      src/base64.h
  3. 1
      src/configfile.h
  4. 3
      src/fdevent.h
  5. 1
      src/keyvalue.h
  6. 2
      src/log.h
  7. 1
      src/mod_magnet_cache.c
  8. 5
      src/mod_magnet_cache.h
  9. 2
      src/mod_ssi_expr.c
  10. 4
      src/mod_ssi_expr.h
  11. 1
      src/network_write.h
  12. 2
      src/reqpool.h
  13. 3
      src/status_counter.h
  14. 1
      src/vector.h

3
src/array.h

@ -37,6 +37,7 @@ typedef struct {
buffer value;
} data_string;
__attribute_returns_nonnull__
data_string *data_string_init(void);
typedef struct {
@ -45,6 +46,7 @@ typedef struct {
array value;
} data_array;
__attribute_returns_nonnull__
data_array *data_array_init(void);
typedef struct {
@ -53,6 +55,7 @@ typedef struct {
int value;
} data_integer;
__attribute_returns_nonnull__
data_integer *data_integer_init(void);
__attribute_returns_nonnull__

3
src/base64.h

@ -14,7 +14,10 @@ unsigned char* buffer_append_base64_decode(buffer *out, const char* in, size_t i
size_t li_to_base64_no_padding(char* out, size_t out_length, const unsigned char* in, size_t in_length, base64_charset charset);
size_t li_to_base64(char* out, size_t out_length, const unsigned char* in, size_t in_length, base64_charset charset);
__attribute_returns_nonnull__
char* buffer_append_base64_encode_no_padding(buffer *out, const unsigned char* in, size_t in_length, base64_charset charset);
__attribute_returns_nonnull__
char* buffer_append_base64_encode(buffer *out, const unsigned char* in, size_t in_length, base64_charset charset);
#endif

1
src/configfile.h

@ -46,6 +46,7 @@ struct data_config {
};
__attribute_cold__
__attribute_returns_nonnull__
data_config *data_config_init(void);
__attribute_cold__

3
src/fdevent.h

@ -51,6 +51,7 @@ int fdevent_config(const char **event_handler_name, struct log_error_st *errh);
__attribute_cold__
__attribute_const__
__attribute_returns_nonnull__
const char * fdevent_show_event_handlers(void);
__attribute_cold__
@ -70,7 +71,9 @@ void fdevent_fdnode_event_clr(fdevents *ev, fdnode *fdn, int event);
int fdevent_poll(fdevents *ev, int timeout_ms);
__attribute_returns_nonnull__
fdnode * fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx);
void fdevent_unregister(fdevents *ev, int fd);
void fdevent_sched_close(fdevents *ev, int fd, int issock);

1
src/keyvalue.h

@ -25,6 +25,7 @@ typedef struct {
__attribute_cold__
__attribute_malloc__
__attribute_returns_nonnull__
pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void);
__attribute_cold__

2
src/log.h

@ -22,6 +22,8 @@ struct log_error_st {
};
__attribute_cold__
__attribute_malloc__
__attribute_returns_nonnull__
log_error_st * log_error_st_init (void);
__attribute_cold__

1
src/mod_magnet_cache.c

@ -14,6 +14,7 @@ static script *script_init() {
script *sc;
sc = calloc(1, sizeof(*sc));
force_assert(sc);
sc->name = buffer_init();
sc->etag = buffer_init();

5
src/mod_magnet_cache.h

@ -20,7 +20,12 @@ typedef struct {
uint32_t size;
} script_cache;
#if 0
__attribute_malloc__
__attribute_returns_nonnull__
script_cache *script_cache_init(void);
#endif
void script_cache_free_data(script_cache *cache);
lua_State *script_cache_get_script(script_cache *cache, buffer *name, int etag_flags);

2
src/mod_ssi_expr.c

@ -22,11 +22,11 @@ typedef struct {
int in_cond;
} ssi_tokenizer_t;
__attribute_malloc__
ssi_val_t *ssi_val_init(void) {
ssi_val_t *s;
s = calloc(1, sizeof(*s));
force_assert(s);
return s;
}

4
src/mod_ssi_expr.h

@ -24,7 +24,11 @@ void ssiexprparserFree(void *p, void (*freeProc)(void*));
void ssiexprparser(void *yyp, int yymajor, buffer *yyminor, ssi_ctx_t *ctx);
int ssi_val_tobool(ssi_val_t *B);
__attribute_malloc__
__attribute_returns_nonnull__
ssi_val_t *ssi_val_init(void);
void ssi_val_free(ssi_val_t *s);
#endif

1
src/network_write.h

@ -8,6 +8,7 @@ int network_write_init(server *srv);
__attribute_cold__
__attribute_const__
__attribute_returns_nonnull__
const char * network_write_show_handlers(void);
#endif

2
src/reqpool.h

@ -8,6 +8,8 @@ void request_init_data (request_st *r, connection *con, server *srv);
void request_reset (request_st *r);
void request_reset_ex (request_st *r);
void request_release (request_st *r);
__attribute_returns_nonnull__
request_st * request_acquire (connection *con);
__attribute_cold__

3
src/status_counter.h

@ -4,6 +4,7 @@
#include "base_decls.h"
__attribute_returns_nonnull__
static inline
int *status_counter_get_counter(const char *s, size_t len);
static inline
@ -15,9 +16,9 @@ void status_counter_set(const char *s, size_t len, int val);
/* inline status counter routines */
#include "array.h"
#include "plugin.h"
__attribute_returns_nonnull__
static inline
int *status_counter_get_counter(const char *s, size_t len) {
return array_get_int_ptr(&plugin_stats, s, len);

1
src/vector.h

@ -14,6 +14,7 @@ void vector_free(void *data);
__attribute_malloc__
void *vector_malloc(size_t sz);
__attribute_returns_nonnull__
void *vector_realloc(void *data, size_t elem_size, size_t size, size_t used);
#define DEFINE_TYPED_VECTOR(name, entry, release) \

Loading…
Cancel
Save