فهرست منبع

COVERITY 4: remove dead code in XYZ_dispatch().

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2549 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 16 سال پیش
والد
کامیت
3848fc2069
6فایلهای تغییر یافته به همراه19 افزوده شده و 71 حذف شده
  1. 1 7
      lib/cfg.c
  2. 4 10
      lib/confdb.c
  3. 5 19
      lib/cpg.c
  4. 5 19
      lib/evs.c
  5. 2 8
      lib/quorum.c
  6. 2 8
      lib/votequorum.c

+ 1 - 7
lib/cfg.c

@@ -220,14 +220,8 @@ corosync_cfg_dispatch (
 		/*
 		 * Determine if more messages should be processed
 		 */
-		switch (dispatch_flags) {
-		case CS_DISPATCH_ONE:
+		if (dispatch_flags == CS_DISPATCH_ONE) {
 			cont = 0;
-			break;
-		case CS_DISPATCH_ALL:
-			break;
-		case CS_DISPATCH_BLOCKING:
-			break;
 		}
 	} while (cont);
 

+ 4 - 10
lib/confdb.c

@@ -297,8 +297,8 @@ cs_error_t confdb_dispatch (
 	}
 
 	/*
-	 * Timeout instantly for SA_DISPATCH_ONE or SA_DISPATCH_ALL and
-	 * wait indefinately for SA_DISPATCH_BLOCKING
+	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
+	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 */
 	if (dispatch_types == CONFDB_DISPATCH_ALL) {
 		timeout = 0;
@@ -394,15 +394,9 @@ cs_error_t confdb_dispatch (
 
 		/*
 		 * Determine if more messages should be processed
-		 * */
-		switch (dispatch_types) {
-		case CONFDB_DISPATCH_ONE:
+		 */
+		if (dispatch_types == CS_DISPATCH_ONE) {
 			cont = 0;
-			break;
-		case CONFDB_DISPATCH_ALL:
-			break;
-		case CONFDB_DISPATCH_BLOCKING:
-			break;
 		}
 	} while (cont);
 

+ 5 - 19
lib/cpg.c

@@ -258,7 +258,6 @@ cs_error_t cpg_dispatch (
 	struct res_lib_cpg_deliver_callback *res_cpg_deliver_callback;
 	cpg_callbacks_t callbacks;
 	coroipc_response_header_t *dispatch_data;
-	int ignore_dispatch = 0;
 	struct cpg_address member_list[CPG_MEMBERS_MAX];
 	struct cpg_address left_list[CPG_MEMBERS_MAX];
 	struct cpg_address joined_list[CPG_MEMBERS_MAX];
@@ -273,8 +272,8 @@ cs_error_t cpg_dispatch (
 	}
 
 	/*
-	 * Timeout instantly for SA_DISPATCH_ONE or SA_DISPATCH_ALL and
-	 * wait indefinately for SA_DISPATCH_BLOCKING
+	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
+	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 */
 	if (dispatch_types == CPG_DISPATCH_ALL) {
 		timeout = 0;
@@ -378,22 +377,9 @@ cs_error_t cpg_dispatch (
 
 		/*
 		 * Determine if more messages should be processed
-		 * */
-		switch (dispatch_types) {
-		case CPG_DISPATCH_ONE:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			} else {
-				cont = 0;
-			}
-			break;
-		case CPG_DISPATCH_ALL:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			}
-			break;
-		case CPG_DISPATCH_BLOCKING:
-			break;
+		 */
+		if (dispatch_types == CS_DISPATCH_ONE) {
+			cont = 0;
 		}
 	} while (cont);
 

+ 5 - 19
lib/evs.c

@@ -231,7 +231,6 @@ evs_error_t evs_dispatch (
 	struct res_evs_deliver_callback *res_evs_deliver_callback;
 	evs_callbacks_t callbacks;
 	coroipc_response_header_t *dispatch_data;
-	int ignore_dispatch = 0;
 
 	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
 	if (error != CS_OK) {
@@ -239,8 +238,8 @@ evs_error_t evs_dispatch (
 	}
 
 	/*
-	 * Timeout instantly for SA_DISPATCH_ONE or SA_DISPATCH_ALL and
-	 * wait indefinately for SA_DISPATCH_BLOCKING
+	 * Timeout instantly for CS_DISPATCH_ONE or CS_DISPATCH_ALL and
+	 * wait indefinately for CS_DISPATCH_BLOCKING
 	 */
 	if (dispatch_types == EVS_DISPATCH_ALL) {
 		timeout = 0;
@@ -318,22 +317,9 @@ evs_error_t evs_dispatch (
 
 		/*
 		 * Determine if more messages should be processed
-		 * */
-		switch (dispatch_types) {
-		case EVS_DISPATCH_ONE:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			} else {
-				cont = 0;
-			}
-			break;
-		case EVS_DISPATCH_ALL:
-			if (ignore_dispatch) {
-				ignore_dispatch = 0;
-			}
-			break;
-		case EVS_DISPATCH_BLOCKING:
-			break;
+		 */
+		if (dispatch_types == CS_DISPATCH_ONE) {
+			cont = 0;
 		}
 	} while (cont);
 

+ 2 - 8
lib/quorum.c

@@ -408,15 +408,9 @@ cs_error_t quorum_dispatch (
 
 		/*
 		 * Determine if more messages should be processed
-		 * */
-		switch (dispatch_types) {
-		case CS_DISPATCH_ONE:
+		 */
+		if (dispatch_types == CS_DISPATCH_ONE) {
 			cont = 0;
-			break;
-		case CS_DISPATCH_ALL:
-			break;
-		case CS_DISPATCH_BLOCKING:
-			break;
 		}
 	} while (cont);
 

+ 2 - 8
lib/votequorum.c

@@ -775,15 +775,9 @@ cs_error_t votequorum_dispatch (
 
 		/*
 		 * Determine if more messages should be processed
-		 * */
-		switch (dispatch_types) {
-		case CS_DISPATCH_ONE:
+		 */
+		if (dispatch_types == CS_DISPATCH_ONE) {
 			cont = 0;
-			break;
-		case CS_DISPATCH_ALL:
-			break;
-		case CS_DISPATCH_BLOCKING:
-			break;
 		}
 	} while (cont);