[asterisk-commits] rmudgett: trunk r412400 - in /trunk: ./ channels/ main/ res/ res/ari/ res/par...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 15 13:01:55 CDT 2014


Author: rmudgett
Date: Tue Apr 15 13:01:47 2014
New Revision: 412400

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412400
Log:
Remove unused RAII_VAR() declarations.

* Remove unused RAII_VAR() declarations.  The compiler cannot catch these
because the cleanup function "references" the unused variable.  Some
actually allocated and released resources that were never used.

* Fixed some whitespace issues in stasis_bridges.c.
........

Merged revisions 412399 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/channels/chan_oss.c
    trunk/channels/chan_skinny.c
    trunk/main/cdr.c
    trunk/main/pbx.c
    trunk/main/stasis_bridges.c
    trunk/main/stasis_channels.c
    trunk/res/ari/resource_channels.c
    trunk/res/ari/resource_recordings.c
    trunk/res/parking/parking_applications.c
    trunk/res/parking/parking_manager.c
    trunk/res/res_ari.c
    trunk/res/res_fax.c
    trunk/res/res_parking.c
    trunk/res/res_pjsip/location.c
    trunk/res/res_pjsip/security_events.c
    trunk/res/res_pjsip_refer.c
    trunk/res/res_pjsip_session.c
    trunk/res/res_stasis_playback.c
    trunk/res/res_stasis_recording.c
    trunk/res/stasis/app.c
    trunk/res/stasis_recording/stored.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_oss.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Tue Apr 15 13:01:47 2014
@@ -1175,7 +1175,6 @@
 static char *console_transfer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct chan_oss_pvt *o = find_desc(oss_active);
-	RAII_VAR(struct ast_channel *, b, NULL, ast_channel_cleanup);
 	char *tmp, *ext, *ctx;
 
 	switch (cmd) {

Modified: trunk/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Tue Apr 15 13:01:47 2014
@@ -7202,8 +7202,6 @@
 		}
 
 		if ((sub && sub->owner) && (ast_channel_state(sub->owner) ==  AST_STATE_UP)) {
-			RAII_VAR(struct ast_channel *, bridged, NULL, ast_channel_cleanup);
-
 			c = sub->owner;
 			ast_channel_lock(c);
 			bridge_channel = ast_channel_get_bridge_channel(c);

Modified: trunk/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cdr.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Tue Apr 15 13:01:47 2014
@@ -1085,7 +1085,6 @@
 	struct ast_var_t *it_var, *it_copy_var;
 	struct ast_channel_snapshot *party_a;
 	struct ast_channel_snapshot *party_b;
-	RAII_VAR(struct module_config *, mod_cfg, ao2_global_obj_ref(module_configs), ao2_cleanup);
 
 	for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {
 		struct ast_cdr *cdr_copy;
@@ -1239,9 +1238,6 @@
  */
 static void cdr_object_finalize(struct cdr_object *cdr)
 {
-	RAII_VAR(struct module_config *, mod_cfg,
-			ao2_global_obj_ref(module_configs), ao2_cleanup);
-
 	if (!ast_tvzero(cdr->end)) {
 		return;
 	}
@@ -1644,8 +1640,6 @@
 
 static int dial_state_process_dial_end(struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer, const char *dial_status)
 {
-	RAII_VAR(struct module_config *, mod_cfg,
-			ao2_global_obj_ref(module_configs), ao2_cleanup);
 	struct ast_channel_snapshot *party_a;
 
 	if (caller) {

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Apr 15 13:01:47 2014
@@ -4834,8 +4834,6 @@
 	struct pbx_find_info q = { .stacklen = 0 }; /* the rest is reset in pbx_find_extension */
 	char passdata[EXT_DATA_SIZE];
 	int matching_action = (action == E_MATCH || action == E_CANMATCH || action == E_MATCHMORE);
-	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
-	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 
 	ast_rdlock_contexts();
 	if (found)

Modified: trunk/main/stasis_bridges.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_bridges.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/main/stasis_bridges.c (original)
+++ trunk/main/stasis_bridges.c Tue Apr 15 13:01:47 2014
@@ -346,11 +346,11 @@
 		return NULL;
 	}
 
-        return ast_json_pack("{s: s, s: o, s: O, s: O}",
-                "type", "BridgeMerged",
-                "timestamp", ast_json_timeval(*stasis_message_timestamp(msg), NULL),
-                "bridge", json_bridge_to,
-                "bridge_from", json_bridge_from);
+	return ast_json_pack("{s: s, s: o, s: O, s: O}",
+		"type", "BridgeMerged",
+		"timestamp", ast_json_timeval(*stasis_message_timestamp(msg), NULL),
+		"bridge", json_bridge_to,
+		"bridge_from", json_bridge_from);
 }
 
 void ast_bridge_publish_merge(struct ast_bridge *to, struct ast_bridge *from)
@@ -466,10 +466,10 @@
 }
 
 static struct ast_json *simple_bridge_channel_event(
-        const char *type,
-        struct ast_bridge_snapshot *bridge_snapshot,
-        struct ast_channel_snapshot *channel_snapshot,
-        const struct timeval *tv,
+	const char *type,
+	struct ast_bridge_snapshot *bridge_snapshot,
+	struct ast_channel_snapshot *channel_snapshot,
+	const struct timeval *tv,
 	const struct stasis_message_sanitizer *sanitize)
 {
 	RAII_VAR(struct ast_json *, json_bridge,
@@ -481,31 +481,31 @@
 		return NULL;
 	}
 
-        return ast_json_pack("{s: s, s: o, s: O, s: O}",
-                "type", type,
-                "timestamp", ast_json_timeval(*tv, NULL),
-                "bridge", json_bridge,
-                "channel", json_channel);
+	return ast_json_pack("{s: s, s: o, s: O, s: O}",
+		"type", type,
+		"timestamp", ast_json_timeval(*tv, NULL),
+		"bridge", json_bridge,
+		"channel", json_channel);
 }
 
 struct ast_json *ast_channel_entered_bridge_to_json(
 	struct stasis_message *msg,
 	const struct stasis_message_sanitizer *sanitize)
 {
-        struct ast_bridge_blob *obj = stasis_message_data(msg);
+	struct ast_bridge_blob *obj = stasis_message_data(msg);
 
 	return simple_bridge_channel_event("ChannelEnteredBridge", obj->bridge,
-                obj->channel, stasis_message_timestamp(msg), sanitize);
+		obj->channel, stasis_message_timestamp(msg), sanitize);
 }
 
 struct ast_json *ast_channel_left_bridge_to_json(
 	struct stasis_message *msg,
 	const struct stasis_message_sanitizer *sanitize)
 {
-        struct ast_bridge_blob *obj = stasis_message_data(msg);
+	struct ast_bridge_blob *obj = stasis_message_data(msg);
 
 	return simple_bridge_channel_event("ChannelLeftBridge", obj->bridge,
-                obj->channel, stasis_message_timestamp(msg), sanitize);
+		obj->channel, stasis_message_timestamp(msg), sanitize);
 }
 
 static struct ast_json *container_to_json_array(struct ao2_container *items,

Modified: trunk/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/stasis_channels.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/main/stasis_channels.c (original)
+++ trunk/main/stasis_channels.c Tue Apr 15 13:01:47 2014
@@ -716,7 +716,6 @@
 static struct ast_manager_event_blob *agent_login_to_ami(struct stasis_message *msg)
 {
 	RAII_VAR(struct ast_str *, channel_string, NULL, ast_free);
-	RAII_VAR(struct ast_str *, party_string, ast_str_create(256), ast_free);
 	struct ast_channel_blob *obj = stasis_message_data(msg);
 	const char *agent = ast_json_string_get(ast_json_object_get(obj->blob, "agent"));
 
@@ -734,7 +733,6 @@
 static struct ast_manager_event_blob *agent_logoff_to_ami(struct stasis_message *msg)
 {
 	RAII_VAR(struct ast_str *, channel_string, NULL, ast_free);
-	RAII_VAR(struct ast_str *, party_string, ast_str_create(256), ast_free);
 	struct ast_channel_blob *obj = stasis_message_data(msg);
 	const char *agent = ast_json_string_get(ast_json_object_get(obj->blob, "agent"));
 	long logintime = ast_json_integer_get(ast_json_object_get(obj->blob, "logintime"));

Modified: trunk/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/resource_channels.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/ari/resource_channels.c (original)
+++ trunk/res/ari/resource_channels.c Tue Apr 15 13:01:47 2014
@@ -464,7 +464,6 @@
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_app_recording *, recording, NULL, ao2_cleanup);
 	RAII_VAR(char *, recording_url, NULL, ast_free);
 	struct ast_json *json;

Modified: trunk/res/ari/resource_recordings.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/resource_recordings.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/ari/resource_recordings.c (original)
+++ trunk/res/ari/resource_recordings.c Tue Apr 15 13:01:47 2014
@@ -166,7 +166,6 @@
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_recording *, recording, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	enum stasis_app_recording_oper_results res;
 
 	recording = stasis_app_recording_find_by_name(name);

Modified: trunk/res/parking/parking_applications.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/parking/parking_applications.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/parking/parking_applications.c (original)
+++ trunk/res/parking/parking_applications.c Tue Apr 15 13:01:47 2014
@@ -553,7 +553,6 @@
 {
 	RAII_VAR(struct parking_lot *, lot, NULL, ao2_cleanup);
 	RAII_VAR(struct parked_user *, pu, NULL, ao2_cleanup); /* Parked user being retrieved */
-	RAII_VAR(struct ast_bridge *, parking_bridge, NULL, ao2_cleanup);
 	struct ast_bridge *retrieval_bridge;
 	int res;
 	int target_space = -1;

Modified: trunk/res/parking/parking_manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/parking/parking_manager.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/parking/parking_manager.c (original)
+++ trunk/res/parking/parking_manager.c Tue Apr 15 13:01:47 2014
@@ -152,7 +152,6 @@
 
 static struct ast_parked_call_payload *parked_call_payload_from_failure(struct ast_channel *chan)
 {
-	RAII_VAR(struct ast_parked_call_payload *, payload, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_channel_snapshot *, parkee_snapshot, NULL, ao2_cleanup);
 
 	ast_channel_lock(chan);
@@ -167,7 +166,6 @@
 
 static struct ast_parked_call_payload *parked_call_payload_from_parked_user(struct parked_user *pu, enum ast_parked_call_event_type event_type)
 {
-	RAII_VAR(struct ast_parked_call_payload *, payload, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_channel_snapshot *, parkee_snapshot, NULL, ao2_cleanup);
 	long int timeout;
 	long int duration;
@@ -177,7 +175,6 @@
 	ast_channel_lock(pu->chan);
 	parkee_snapshot = ast_channel_snapshot_create(pu->chan);
 	ast_channel_unlock(pu->chan);
-
 	if (!parkee_snapshot) {
 		return NULL;
 	}

Modified: trunk/res/res_ari.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_ari.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_ari.c (original)
+++ trunk/res/res_ari.c Tue Apr 15 13:01:47 2014
@@ -472,7 +472,6 @@
 	struct ast_variable *get_params, struct ast_variable *headers,
 	struct ast_ari_response *response)
 {
-	RAII_VAR(char *, response_text, NULL, ast_free);
 	RAII_VAR(struct stasis_rest_handlers *, root, NULL, ao2_cleanup);
 	struct stasis_rest_handlers *handler;
 	RAII_VAR(struct ast_variable *, path_vars, NULL, ast_variables_destroy);

Modified: trunk/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_fax.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_fax.c (original)
+++ trunk/res/res_fax.c Tue Apr 15 13:01:47 2014
@@ -1175,7 +1175,6 @@
 static int report_fax_status(struct ast_channel *chan, struct ast_fax_session_details *details, const char *status)
 {
 	RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
-	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
 	struct ast_json *json_filenames = NULL;
 

Modified: trunk/res/res_parking.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_parking.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_parking.c (original)
+++ trunk/res/res_parking.c Tue Apr 15 13:01:47 2014
@@ -689,7 +689,6 @@
 
 static int extension_is_compatible(struct parking_lot_cfg *lot_cfg, const char *app_type, struct ast_exten *extension)
 {
-	RAII_VAR(struct parking_lot_cfg *, owner, NULL, ao2_cleanup);
 	const char *extension_registrar = ast_get_extension_registrar(extension);
 	const char *extension_context = ast_get_context_name(ast_get_extension_context(extension));
 	const char *extension_name = ast_get_extension_name(extension);

Modified: trunk/res/res_pjsip/location.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/location.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_pjsip/location.c (original)
+++ trunk/res/res_pjsip/location.c Tue Apr 15 13:01:47 2014
@@ -158,7 +158,6 @@
 
 	while ((aor_name = strsep(&rest, ","))) {
 		RAII_VAR(struct ast_sip_aor *, aor, ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
-		RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);
 
 		if (!aor) {
 			continue;

Modified: trunk/res/res_pjsip/security_events.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/security_events.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_pjsip/security_events.c (original)
+++ trunk/res/res_pjsip/security_events.c Tue Apr 15 13:01:47 2014
@@ -136,7 +136,6 @@
 	char call_id[pj_strlen(&rdata->msg_info.cid->id) + 1];
 	char nonce[64] = "", response[256] = "";
 	struct ast_sockaddr local, remote;
-	RAII_VAR(struct ast_sip_endpoint *, artificial, ast_sip_get_artificial_endpoint(), ao2_cleanup);
 
 	struct ast_security_event_chal_resp_failed chal_resp_failed = {
 				.common.event_type = AST_SECURITY_EVENT_CHAL_RESP_FAILED,

Modified: trunk/res/res_pjsip_refer.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_refer.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_pjsip_refer.c (original)
+++ trunk/res/res_pjsip_refer.c Tue Apr 15 13:01:47 2014
@@ -732,7 +732,6 @@
 	int response = 0;
 	RAII_VAR(struct ast_sip_session *, other_session, NULL, ao2_cleanup);
 	struct invite_replaces invite;
-	RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);
 
 	/* If a Replaces header is present make sure it is valid */
 	if (pjsip_replaces_verify_request(rdata, &other_dlg, PJ_TRUE, &packet) != PJ_SUCCESS) {

Modified: trunk/res/res_pjsip_session.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_session.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_pjsip_session.c (original)
+++ trunk/res/res_pjsip_session.c Tue Apr 15 13:01:47 2014
@@ -302,7 +302,7 @@
 	for (i = 0; i < sdp->media_count; ++i) {
 		RAII_VAR(int *, port, ao2_alloc(sizeof(int), NULL), ao2_cleanup);
 		RAII_VAR(int *, port_match, NULL, ao2_cleanup);
-		RAII_VAR(int *, bundle_match, NULL, ao2_cleanup);
+
 		*port = sdp->media[i]->desc.port;
 		port_match = ao2_find(portlist, port, OBJ_KEY);
 		if (port_match) {

Modified: trunk/res/res_stasis_playback.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_stasis_playback.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_stasis_playback.c (original)
+++ trunk/res/res_stasis_playback.c Tue Apr 15 13:01:47 2014
@@ -192,7 +192,6 @@
 static void playback_publish(struct stasis_app_playback *playback)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
-	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
 
 	ast_assert(playback != NULL);

Modified: trunk/res/res_stasis_recording.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_stasis_recording.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/res_stasis_recording.c (original)
+++ trunk/res/res_stasis_recording.c Tue Apr 15 13:01:47 2014
@@ -211,7 +211,6 @@
 static void recording_publish(struct stasis_app_recording *recording, const char *cause)
 {
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
-	RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
 
 	ast_assert(recording != NULL);

Modified: trunk/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/stasis/app.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/stasis/app.c (original)
+++ trunk/res/stasis/app.c Tue Apr 15 13:01:47 2014
@@ -387,7 +387,6 @@
 	struct ast_channel_snapshot *new_snapshot,
 	const struct timeval *tv)
 {
-	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ast_json *json_channel;
 
 	/* No Newexten event on cache clear or first event */
@@ -422,7 +421,6 @@
 	struct ast_channel_snapshot *new_snapshot,
 	const struct timeval *tv)
 {
-	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ast_json *json_channel;
 
 	/* No NewCallerid event on cache clear or first event */

Modified: trunk/res/stasis_recording/stored.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/stasis_recording/stored.c?view=diff&rev=412400&r1=412399&r2=412400
==============================================================================
--- trunk/res/stasis_recording/stored.c (original)
+++ trunk/res/stasis_recording/stored.c Tue Apr 15 13:01:47 2014
@@ -247,7 +247,6 @@
 {
 	RAII_VAR(struct stasis_app_stored_recording *, recording, NULL,
 		ao2_cleanup);
-	RAII_VAR(struct ast_str *, name, NULL, ast_free);
 	const char *ext;
 	char *dot;
 




More information about the asterisk-commits mailing list