summaryrefslogtreecommitdiff
path: root/main/abstract_jb.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
commite6b2e9a7501b5d2e351a5e626fa13dfc3c113f1e (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /main/abstract_jb.c
parent88bda581ec7c524050bca769c6705ee5c66357ad (diff)
Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/abstract_jb.c')
-rw-r--r--main/abstract_jb.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/main/abstract_jb.c b/main/abstract_jb.c
index d7ff7354a..cda9a6dca 100644
--- a/main/abstract_jb.c
+++ b/main/abstract_jb.c
@@ -110,8 +110,7 @@ static void jb_force_resynch_adaptive(void *jb);
static void jb_empty_and_reset_adaptive(void *jb);
/* Available jb implementations */
-static struct ast_jb_impl avail_impl[] =
-{
+static const struct ast_jb_impl avail_impl[] = {
{
.name = "fixed",
.create = jb_create_fixed,
@@ -150,13 +149,13 @@ enum {
};
/* Translations between impl and abstract return codes */
-static int fixed_to_abstract_code[] =
+static const int fixed_to_abstract_code[] =
{JB_IMPL_OK, JB_IMPL_DROP, JB_IMPL_INTERP, JB_IMPL_NOFRAME};
-static int adaptive_to_abstract_code[] =
+static const int adaptive_to_abstract_code[] =
{JB_IMPL_OK, JB_IMPL_NOFRAME, JB_IMPL_NOFRAME, JB_IMPL_INTERP, JB_IMPL_DROP, JB_IMPL_OK};
/* JB_GET actions (used only for the frames log) */
-static char *jb_get_actions[] = {"Delivered", "Dropped", "Interpolated", "No"};
+static const char * const jb_get_actions[] = {"Delivered", "Dropped", "Interpolated", "No"};
/*! \brief Macros for the frame log files */
#define jb_framelog(...) do { \
@@ -181,7 +180,7 @@ static void jb_choose_impl(struct ast_channel *chan)
{
struct ast_jb *jb = &chan->jb;
struct ast_jb_conf *jbconf = &jb->conf;
- struct ast_jb_impl *test_impl;
+ const struct ast_jb_impl *test_impl;
int i, avail_impl_count = ARRAY_LEN(avail_impl);
jb->impl = &avail_impl[default_impl];
@@ -303,7 +302,7 @@ int ast_jb_get_when_to_wakeup(struct ast_channel *c0, struct ast_channel *c1, in
int ast_jb_put(struct ast_channel *chan, struct ast_frame *f)
{
struct ast_jb *jb = &chan->jb;
- struct ast_jb_impl *jbimpl = jb->impl;
+ const struct ast_jb_impl *jbimpl = jb->impl;
void *jbobj = jb->jbobj;
struct ast_frame *frr;
long now = 0;
@@ -385,7 +384,7 @@ void ast_jb_get_and_deliver(struct ast_channel *c0, struct ast_channel *c1)
static void jb_get_and_deliver(struct ast_channel *chan)
{
struct ast_jb *jb = &chan->jb;
- struct ast_jb_impl *jbimpl = jb->impl;
+ const struct ast_jb_impl *jbimpl = jb->impl;
void *jbobj = jb->jbobj;
struct ast_frame *f, finterp;
long now;
@@ -450,7 +449,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
{
struct ast_jb *jb = &chan->jb;
struct ast_jb_conf *jbconf = &jb->conf;
- struct ast_jb_impl *jbimpl = jb->impl;
+ const struct ast_jb_impl *jbimpl = jb->impl;
void *jbobj;
struct ast_channel *bridged;
long now;
@@ -534,7 +533,7 @@ static int create_jb(struct ast_channel *chan, struct ast_frame *frr)
void ast_jb_destroy(struct ast_channel *chan)
{
struct ast_jb *jb = &chan->jb;
- struct ast_jb_impl *jbimpl = jb->impl;
+ const struct ast_jb_impl *jbimpl = jb->impl;
void *jbobj = jb->jbobj;
struct ast_frame *f;