[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step1 r299190 - /team/dvossel/fixt...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 20 20:37:10 UTC 2010


Author: dvossel
Date: Mon Dec 20 14:37:06 2010
New Revision: 299190

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299190
Log:
Removed unnecessary casts

Modified:
    team/dvossel/fixtheworld_phase1_step1/main/format.c
    team/dvossel/fixtheworld_phase1_step1/main/format_cap.c

Modified: team/dvossel/fixtheworld_phase1_step1/main/format.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/main/format.c?view=diff&rev=299190&r1=299189&r2=299190
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/main/format.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/main/format.c Mon Dec 20 14:37:06 2010
@@ -40,7 +40,7 @@
 /*! This is the lock used to protect the interfaces container.  Yes, ao2_containers
  * do have their own locking, but we need the capability of performing read/write
  * locks on this specific container. */
-ast_rwlock_t ilock;
+static ast_rwlock_t ilock;
 
 /*! a wrapper is used put interfaces into the ao2 container. */
 struct interface_ao2_wrapper {
@@ -53,21 +53,21 @@
 
 static int interface_cmp_cb(void *obj, void *arg, int flags)
 {
-	struct interface_ao2_wrapper *wrapper1 = (struct interface_ao2_wrapper *) obj;
-	struct interface_ao2_wrapper *wrapper2 = (struct interface_ao2_wrapper *) arg;
+	struct interface_ao2_wrapper *wrapper1 = obj;
+	struct interface_ao2_wrapper *wrapper2 = arg;
 
 	return (wrapper2->id == wrapper1->id) ? CMP_MATCH | CMP_STOP : 0;
 }
 
 static int interface_hash_cb(const void *obj, const int flags)
 {
-	struct interface_ao2_wrapper *wrapper = (struct interface_ao2_wrapper *) obj;
+	const struct interface_ao2_wrapper *wrapper = obj;
 	return wrapper->id;
 }
 
 static void interface_destroy_cb(void *obj)
 {
-	struct interface_ao2_wrapper *wrapper = (struct interface_ao2_wrapper *) obj;
+	struct interface_ao2_wrapper *wrapper = obj;
 	ast_rwlock_destroy(&wrapper->wraplock);
 }
 

Modified: team/dvossel/fixtheworld_phase1_step1/main/format_cap.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/main/format_cap.c?view=diff&rev=299190&r1=299189&r2=299190
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/main/format_cap.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/main/format_cap.c Mon Dec 20 14:37:06 2010
@@ -45,8 +45,8 @@
  * another format, or if the format is a proper subset of another format. */
 static int cmp_cb(void *obj, void *arg, int flags)
 {
-	struct ast_format *format1 = (struct ast_format *) arg;
-	struct ast_format *format2 = (struct ast_format *) obj;
+	struct ast_format *format1 = arg;
+	struct ast_format *format2 = obj;
 	int res = ast_format_cmp(format1, format2);
 
 	return ((res == AST_FORMAT_CMP_EQUAL) ||
@@ -57,7 +57,7 @@
 
 static int hash_cb(const void *obj, const int flags)
 {
-	struct ast_format *format = (struct ast_format *) obj;
+	const struct ast_format *format = obj;
 	return format->id;
 }
 
@@ -125,8 +125,8 @@
 
 static int multiple_by_id_cb(void *obj, void *arg, int flag)
 {
-	struct ast_format *format1 = (struct ast_format *) arg;
-	struct ast_format *format2 = (struct ast_format *) obj;
+	struct ast_format *format1 = arg;
+	struct ast_format *format2 = obj;
 
 	return (format1->id == format2->id) ? CMP_MATCH : 0;
 }
@@ -177,8 +177,8 @@
 
 static int find_joint_cb(void *obj, void *arg, int flag)
 {
-	struct ast_format *format = (struct ast_format *) obj;
-	struct find_joint_data *data = (struct find_joint_data*) arg;
+	struct ast_format *format = obj;
+	struct find_joint_data *data = arg;
 
 	struct ast_format tmp = { 0, };
 	if (!ast_format_joint(format, data->format, &tmp)) {




More information about the asterisk-commits mailing list