[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step1 r299178 - in /team/dvossel/f...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 20 18:45:01 UTC 2010


Author: dvossel
Date: Mon Dec 20 12:44:57 2010
New Revision: 299178

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299178
Log:
renamed ast_format cmp enum values

Modified:
    team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h
    team/dvossel/fixtheworld_phase1_step1/main/format.c
    team/dvossel/fixtheworld_phase1_step1/main/format_cap.c
    team/dvossel/fixtheworld_phase1_step1/tests/test_format_api.c

Modified: team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h?view=diff&rev=299178&r1=299177&r2=299178
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h (original)
+++ team/dvossel/fixtheworld_phase1_step1/include/asterisk/format.h Mon Dec 20 12:44:57 2010
@@ -126,9 +126,9 @@
 
 enum ast_format_cmp_res {
 	/*! structure 1 is identical to structure 2. */
-	AST_FORMAT_CMP_SAME = 0,
+	AST_FORMAT_CMP_EQUAL = 0,
 	/*! structure 1 contains elements not in structure 2. */
-	AST_FORMAT_CMP_NOT_SUBSET,
+	AST_FORMAT_CMP_NOT_EQUAL,
 	/*! structure 1 is a proper subset of the elements in structure 2.*/
 	AST_FORMAT_CMP_SUBSET,
 };

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=299178&r1=299177&r2=299178
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/main/format.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/main/format.c Mon Dec 20 12:44:57 2010
@@ -181,7 +181,7 @@
 	ast_rwlock_unlock(&wrapper->wraplock);
 	ao2_ref(wrapper, -1);
 
-	return (res == AST_FORMAT_CMP_NOT_SUBSET) ? -1 : 0;
+	return (res == AST_FORMAT_CMP_NOT_EQUAL) ? -1 : 0;
 }
 
 int ast_format_isset(struct ast_format *format, ... )
@@ -198,7 +198,7 @@
  */
 static enum ast_format_cmp_res format_cmp_helper(struct ast_format *format1, struct ast_format *format2)
 {
-	enum ast_format_cmp_res res = AST_FORMAT_CMP_SAME;
+	enum ast_format_cmp_res res = AST_FORMAT_CMP_EQUAL;
 	struct interface_ao2_wrapper *wrapper;
 	struct interface_ao2_wrapper tmp_wrapper = {
 		.id = format1->id,
@@ -233,7 +233,7 @@
 enum ast_format_cmp_res ast_format_cmp(struct ast_format *format1, struct ast_format *format2)
 {
 	if (format1->id != format2->id) {
-		return AST_FORMAT_CMP_NOT_SUBSET;
+		return AST_FORMAT_CMP_NOT_EQUAL;
 	}
 
 	return format_cmp_helper(format1, format2);

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=299178&r1=299177&r2=299178
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/main/format_cap.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/main/format_cap.c Mon Dec 20 12:44:57 2010
@@ -49,7 +49,7 @@
 	struct ast_format *format2 = (struct ast_format *) obj;
 	int res = ast_format_cmp(format1, format2);
 
-	return ((res == AST_FORMAT_CMP_SAME) ||
+	return ((res == AST_FORMAT_CMP_EQUAL) ||
 			(res == AST_FORMAT_CMP_SUBSET)) ?
 				CMP_MATCH | CMP_STOP :
 				0;
@@ -107,7 +107,7 @@
 	struct ast_format *format1 = (struct ast_format *) arg;
 	struct ast_format *format2 = (struct ast_format *) obj;
 
-	return (ast_format_cmp(format1, format2) == AST_FORMAT_CMP_SAME) ? CMP_MATCH : 0;
+	return (ast_format_cmp(format1, format2) == AST_FORMAT_CMP_EQUAL) ? CMP_MATCH : 0;
 }
 
 int ast_cap_remove(struct ast_cap *cap, struct ast_format *format)

Modified: team/dvossel/fixtheworld_phase1_step1/tests/test_format_api.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step1/tests/test_format_api.c?view=diff&rev=299178&r1=299177&r2=299178
==============================================================================
--- team/dvossel/fixtheworld_phase1_step1/tests/test_format_api.c (original)
+++ team/dvossel/fixtheworld_phase1_step1/tests/test_format_api.c Mon Dec 20 12:44:57 2010
@@ -68,11 +68,11 @@
 
 	if ((attr1->samp_flags == attr2->samp_flags) &&
 		!(strcmp(attr1->string, attr2->string))) {
-		return AST_FORMAT_CMP_SAME;
+		return AST_FORMAT_CMP_EQUAL;
 	}
 	if ((attr1->samp_flags != (attr1->samp_flags & attr2->samp_flags)) ||
 		(!ast_strlen_zero(attr1->string) && strcmp(attr1->string, attr2->string))) {
-		return AST_FORMAT_CMP_NOT_SUBSET;
+		return AST_FORMAT_CMP_NOT_EQUAL;
 	}
 	return AST_FORMAT_CMP_SUBSET;
 }
@@ -226,11 +226,11 @@
 	}
 
 	/* exercise compare functions */
-	if (ast_format_cmp(&format1, &format2) != AST_FORMAT_CMP_NOT_SUBSET) {
+	if (ast_format_cmp(&format1, &format2) != AST_FORMAT_CMP_NOT_EQUAL) {
 		ast_test_status_update(test, "cmp 1 failed.\n");
 		return AST_TEST_FAIL;
 	}
-	if (ast_format_cmp(&format1, &format1) != AST_FORMAT_CMP_SAME) {
+	if (ast_format_cmp(&format1, &format1) != AST_FORMAT_CMP_EQUAL) {
 		ast_test_status_update(test, "cmp 2 failed.\n");
 		return AST_TEST_FAIL;
 	}




More information about the asterisk-commits mailing list