Skip to content

Commit

Permalink
global: add missing static keyword to internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
prajnoha committed Jan 23, 2024
1 parent 4d408a3 commit 1ed2fb5
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/base/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int sid_buffer_vfmt_add(struct sid_buffer *buf, const void **mem, size_t *pos, c
return 0;
}

int _do_sid_buffer_release(struct sid_buffer *buf, size_t pos, sid_buffer_pos_t whence, bool rewind)
static int _do_sid_buffer_release(struct sid_buffer *buf, size_t pos, sid_buffer_pos_t whence, bool rewind)
{
size_t count = sid_buffer_count(buf);

Expand All @@ -204,7 +204,7 @@ int sid_buffer_rewind(struct sid_buffer *buf, size_t pos, sid_buffer_pos_t whenc
return _do_sid_buffer_release(buf, pos, whence, true);
}

int _do_sid_buffer_release_mem(struct sid_buffer *buf, const void *mem, bool rewind)
static int _do_sid_buffer_release_mem(struct sid_buffer *buf, const void *mem, bool rewind)
{
if (mem < buf->mem)
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void bitmap_destroy(struct bitmap *bitmap)
free(bitmap);
}

int _get_coord(struct bitmap *bitmap, size_t bit_pos, unsigned *block, unsigned *bit)
static int _get_coord(struct bitmap *bitmap, size_t bit_pos, unsigned *block, unsigned *bit)
{
if (bit_pos >= bitmap->bit_count)
return -ERANGE;
Expand Down
30 changes: 15 additions & 15 deletions src/resource/kv-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,15 @@ static int _set_value(struct kv_store *kv_store,

static void _kv_store_trans_rollback_value(sid_resource_t *kv_store_res, struct kv_rollback_arg *rollback_arg);

void *_do_kv_store_set_value(sid_resource_t *kv_store_res,
const char *key,
void *value,
size_t value_size,
kv_store_value_flags_t flags,
kv_store_value_op_flags_t op_flags,
kv_store_update_cb_fn_t kv_update_fn,
void *kv_update_fn_arg,
const char *archive_key)
static void *_do_kv_store_set_value(sid_resource_t *kv_store_res,
const char *key,
void *value,
size_t value_size,
kv_store_value_flags_t flags,
kv_store_value_op_flags_t op_flags,
kv_store_update_cb_fn_t kv_update_fn,
void *kv_update_fn_arg,
const char *archive_key)
{
struct kv_store *kv_store = sid_resource_get_data(kv_store_res);
struct iovec iov_internal = {.iov_base = value, .iov_len = value_size};
Expand Down Expand Up @@ -837,12 +837,12 @@ static int _unset_value(struct kv_store *kv_store, const char *key, struct kv_up
return 0;
}

int _do_kv_store_unset(sid_resource_t *kv_store_res,
const char *key,
struct sid_buffer *unset_buf,
kv_store_update_cb_fn_t kv_unset_fn,
void *kv_unset_fn_arg,
const char *archive_key)
static int _do_kv_store_unset(sid_resource_t *kv_store_res,
const char *key,
struct sid_buffer *unset_buf,
kv_store_update_cb_fn_t kv_unset_fn,
void *kv_unset_fn_arg,
const char *archive_key)
{
struct kv_store *kv_store = sid_resource_get_data(kv_store_res);
struct kv_update_fn_relay relay;
Expand Down
4 changes: 2 additions & 2 deletions src/resource/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ int64_t sid_resource_get_prio(sid_resource_t *res)
return res->prio;
}

sid_resource_t *_get_resource_with_event_loop(sid_resource_t *res, int error_if_not_found)
static sid_resource_t *_get_resource_with_event_loop(sid_resource_t *res, int error_if_not_found)
{
sid_resource_t *tmp_res = res;

Expand All @@ -551,7 +551,7 @@ sid_resource_t *_get_resource_with_event_loop(sid_resource_t *res, int error_if_
return NULL;
}

void _handle_event_counter(sid_resource_event_source_t *es)
static void _handle_event_counter(sid_resource_event_source_t *es)
{
es->events_fired++;
if ((es->events_max != SID_RESOURCE_UNLIMITED_EVENT_COUNT) && (es->events_fired == es->events_max))
Expand Down
18 changes: 9 additions & 9 deletions src/resource/ubridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ static size_t _svalue_ext_data_offset(kv_scalar_t *svalue)
return owner_size;
}

bool _is_string_data(char *ptr, size_t len)
static bool _is_string_data(char *ptr, size_t len)
{
int i;

Expand Down Expand Up @@ -2590,13 +2590,13 @@ const void *sid_ucmd_get_foreign_dev_mod_kv(sid_resource_t *mod_res,
archive);
}

int _do_sid_ucmd_mod_reserve_kv(sid_resource_t *mod_res,
struct sid_ucmd_common_ctx *common,
const char *dom,
sid_ucmd_kv_namespace_t ns,
const char *key_core,
sid_ucmd_kv_flags_t flags,
int unset)
static int _do_sid_ucmd_mod_reserve_kv(sid_resource_t *mod_res,
struct sid_ucmd_common_ctx *common,
const char *dom,
sid_ucmd_kv_namespace_t ns,
const char *key_core,
sid_ucmd_kv_flags_t flags,
int unset)
{
const char *owner = _get_mod_name(mod_res);
char *key = NULL;
Expand Down Expand Up @@ -3291,7 +3291,7 @@ static char *_canonicalize_kv_key(char *id)
return id;
}

int _part_get_whole_disk(sid_resource_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, char *devno_buf, size_t devno_buf_size)
static int _part_get_whole_disk(sid_resource_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, char *devno_buf, size_t devno_buf_size)
{
const char *s;
int r;
Expand Down
4 changes: 2 additions & 2 deletions src/resource/worker-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static int _setup_channels(sid_resource_t *owner, worker_type_t type, struct wor
return -1;
}

void _destroy_channels(struct worker_channel *channels, unsigned channel_count)
static void _destroy_channels(struct worker_channel *channels, unsigned channel_count)
{
unsigned i;
struct worker_channel *chan;
Expand Down Expand Up @@ -713,7 +713,7 @@ void _destroy_channels(struct worker_channel *channels, unsigned channel_count)
free(channels);
}

int _close_non_channel_fds(sid_resource_t *res, struct worker_channel *channels, unsigned channel_count)
static int _close_non_channel_fds(sid_resource_t *res, struct worker_channel *channels, unsigned channel_count)
{
static const char *proc_self_fd_dir = SYSTEM_PROC_PATH "/self/fd";
DIR *d;
Expand Down

0 comments on commit 1ed2fb5

Please sign in to comment.