Mesa (master): radeonsi: mark unreachable paths to avoid warnings

Marek Olšák mareko at kemper.freedesktop.org
Wed Aug 26 13:46:33 UTC 2015


Module: Mesa
Branch: master
Commit: f8b01ae47cc4760d5687e50f3315b5a89e19cd26
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8b01ae47cc4760d5687e50f3315b5a89e19cd26

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Tue Aug 18 03:23:29 2015 +0300

radeonsi: mark unreachable paths to avoid warnings

Otherwise we get:
warning: 'num_user_sgprs' may be used uninitialized in this function
...

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/radeonsi/si_shader.c        |    2 +-
 src/gallium/drivers/radeonsi/si_state_shaders.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index fa6c15a..6b70a8f 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -2418,7 +2418,7 @@ static void tex_fetch_args(
 			num_deriv_channels = 1;
 			break;
 		default:
-			assert(0); /* no other targets are valid here */
+			unreachable("invalid target");
 		}
 
 		for (param = 0; param < 2; param++)
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 0347014..a09f588 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -181,7 +181,7 @@ static void si_shader_es(struct si_shader *shader)
 		vgpr_comp_cnt = 3; /* all components are needed for TES */
 		num_user_sgprs = SI_TES_NUM_USER_SGPR;
 	} else
-		assert(0);
+		unreachable("invalid shader selector type");
 
 	num_sgprs = shader->num_sgprs;
 	/* One SGPR after user SGPRs is pre-loaded with es2gs_offset */
@@ -338,7 +338,7 @@ static void si_shader_vs(struct si_shader *shader)
 		vgpr_comp_cnt = 3; /* all components are needed for TES */
 		num_user_sgprs = SI_TES_NUM_USER_SGPR;
 	} else
-		assert(0);
+		unreachable("invalid shader selector type");
 
 	num_sgprs = shader->num_sgprs;
 	if (num_user_sgprs > num_sgprs) {




More information about the mesa-commit mailing list