mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 18:40:46 +00:00
pbx.h: Make ast_state_cb_type take more const.
This eliminates some casts that I made a note saying v10 and above would no longer need them. Better late than never :) Change-Id: I346cdb3032b6478ceb40eb6fe732978b54035572
This commit is contained in:
@@ -2461,7 +2461,7 @@ static int extensionstate2devicestate(int state)
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int extension_state_cb(char *context, char *exten, struct ast_state_cb_info *info, void *data)
|
static int extension_state_cb(const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
|
||||||
{
|
{
|
||||||
struct ao2_iterator miter, qiter;
|
struct ao2_iterator miter, qiter;
|
||||||
struct member *m;
|
struct member *m;
|
||||||
|
@@ -1269,7 +1269,7 @@ static void check_for_nat(const struct ast_sockaddr *them, struct sip_pvt *p);
|
|||||||
|
|
||||||
/*--- Device monitoring and Device/extension state/event handling */
|
/*--- Device monitoring and Device/extension state/event handling */
|
||||||
static int extensionstate_update(const char *context, const char *exten, struct state_notify_data *data, struct sip_pvt *p, int force);
|
static int extensionstate_update(const char *context, const char *exten, struct state_notify_data *data, struct sip_pvt *p, int force);
|
||||||
static int cb_extensionstate(char *context, char *exten, struct ast_state_cb_info *info, void *data);
|
static int cb_extensionstate(const char *context, const char *exten, struct ast_state_cb_info *info, void *data);
|
||||||
static int sip_poke_noanswer(const void *data);
|
static int sip_poke_noanswer(const void *data);
|
||||||
static int sip_poke_peer(struct sip_peer *peer, int force);
|
static int sip_poke_peer(struct sip_peer *peer, int force);
|
||||||
static void sip_poke_all_peers(void);
|
static void sip_poke_all_peers(void);
|
||||||
@@ -17389,7 +17389,7 @@ static int extensionstate_update(const char *context, const char *exten, struct
|
|||||||
/*! \brief Callback for the devicestate notification (SUBSCRIBE) support subsystem
|
/*! \brief Callback for the devicestate notification (SUBSCRIBE) support subsystem
|
||||||
\note If you add an "hint" priority to the extension in the dial plan,
|
\note If you add an "hint" priority to the extension in the dial plan,
|
||||||
you will get notifications on device state changes */
|
you will get notifications on device state changes */
|
||||||
static int cb_extensionstate(char *context, char *exten, struct ast_state_cb_info *info, void *data)
|
static int cb_extensionstate(const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
|
||||||
{
|
{
|
||||||
struct sip_pvt *p = data;
|
struct sip_pvt *p = data;
|
||||||
struct state_notify_data notify_data = {
|
struct state_notify_data notify_data = {
|
||||||
|
@@ -1671,7 +1671,7 @@ static struct ast_channel_tech skinny_tech = {
|
|||||||
.send_digit_end = skinny_senddigit_end,
|
.send_digit_end = skinny_senddigit_end,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int skinny_extensionstate_cb(char *context, char *id, struct ast_state_cb_info *info, void *data);
|
static int skinny_extensionstate_cb(const char *context, const char *exten, struct ast_state_cb_info *info, void *data);
|
||||||
|
|
||||||
static struct skinny_line *skinny_line_alloc(void)
|
static struct skinny_line *skinny_line_alloc(void)
|
||||||
{
|
{
|
||||||
@@ -3413,7 +3413,7 @@ static void transmit_serviceurlstat(struct skinny_device *d, int instance)
|
|||||||
transmit_response(d, req);
|
transmit_response(d, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int skinny_extensionstate_cb(char *context, char *exten, struct ast_state_cb_info *info, void *data)
|
static int skinny_extensionstate_cb(const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
|
||||||
{
|
{
|
||||||
struct skinny_container *container = data;
|
struct skinny_container *container = data;
|
||||||
struct skinny_device *d = NULL;
|
struct skinny_device *d = NULL;
|
||||||
|
@@ -109,7 +109,7 @@ struct ast_state_cb_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Typedef for devicestate and hint callbacks */
|
/*! \brief Typedef for devicestate and hint callbacks */
|
||||||
typedef int (*ast_state_cb_type)(char *context, char *id, struct ast_state_cb_info *info, void *data);
|
typedef int (*ast_state_cb_type)(const char *context, const char *exten, struct ast_state_cb_info *info, void *data);
|
||||||
|
|
||||||
/*! \brief Typedef for devicestate and hint callback removal indication callback */
|
/*! \brief Typedef for devicestate and hint callback removal indication callback */
|
||||||
typedef void (*ast_state_cb_destroy_type)(int id, void *data);
|
typedef void (*ast_state_cb_destroy_type)(int id, void *data);
|
||||||
|
@@ -6765,7 +6765,7 @@ int ast_manager_unregister(const char *action)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int manager_state_cb(char *context, char *exten, struct ast_state_cb_info *info, void *data)
|
static int manager_state_cb(const char *context, const char *exten, struct ast_state_cb_info *info, void *data)
|
||||||
{
|
{
|
||||||
/* Notify managers of change */
|
/* Notify managers of change */
|
||||||
char hint[512];
|
char hint[512];
|
||||||
|
@@ -3231,8 +3231,7 @@ static int execute_state_callback(ast_state_cb_type cb,
|
|||||||
info.exten_state = AST_EXTENSION_REMOVED;
|
info.exten_state = AST_EXTENSION_REMOVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTE: The casts will not be needed for v10 and later */
|
res = cb(context, exten, &info, data);
|
||||||
res = cb((char *) context, (char *) exten, &info, data);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -191,8 +191,9 @@ static void notify_task_data_destructor(void *obj)
|
|||||||
ast_free(task_data->exten_state_data.user_agent);
|
ast_free(task_data->exten_state_data.user_agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct notify_task_data *alloc_notify_task_data(char *exten, struct exten_state_subscription *exten_state_sub,
|
static struct notify_task_data *alloc_notify_task_data(const char *exten,
|
||||||
struct ast_state_cb_info *info)
|
struct exten_state_subscription *exten_state_sub,
|
||||||
|
struct ast_state_cb_info *info)
|
||||||
{
|
{
|
||||||
struct notify_task_data *task_data =
|
struct notify_task_data *task_data =
|
||||||
ao2_alloc(sizeof(*task_data), notify_task_data_destructor);
|
ao2_alloc(sizeof(*task_data), notify_task_data_destructor);
|
||||||
@@ -270,8 +271,8 @@ static int notify_task(void *obj)
|
|||||||
*
|
*
|
||||||
* Upon state change, send the appropriate notification to the subscriber.
|
* Upon state change, send the appropriate notification to the subscriber.
|
||||||
*/
|
*/
|
||||||
static int state_changed(char *context, char *exten,
|
static int state_changed(const char *context, const char *exten,
|
||||||
struct ast_state_cb_info *info, void *data)
|
struct ast_state_cb_info *info, void *data)
|
||||||
{
|
{
|
||||||
struct notify_task_data *task_data;
|
struct notify_task_data *task_data;
|
||||||
struct exten_state_subscription *exten_state_sub = data;
|
struct exten_state_subscription *exten_state_sub = data;
|
||||||
|
Reference in New Issue
Block a user