[Mesa-dev] [PATCH kmscube] cube-tex: Handle SMOOTH switch case

Fabio Estevam festevam at gmail.com
Wed Mar 15 21:56:53 UTC 2017


In kmscube.c there is the following logic:

	if (mode == SMOOTH) {
		egl = init_cube_smooth(gbm);
	} else {
		egl = init_cube_tex(gbm, mode);
	}

,which makes init_cube_tex() to be never called on the SMOOTH case.

Handle the SMOOTH switch case inside init_tex() to fix the following
build warning:

cube-tex.c: In function 'init_tex':
cube-tex.c:438:2: warning: enumeration value 'SMOOTH' not handled in switch [-Wswitch]
  switch (mode) {
  ^

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
 cube-tex.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cube-tex.c b/cube-tex.c
index a543e83..8aab06c 100644
--- a/cube-tex.c
+++ b/cube-tex.c
@@ -442,6 +442,9 @@ static int init_tex(enum mode mode)
 		return init_tex_nv12_2img();
 	case NV12_1IMG:
 		return init_tex_nv12_1img();
+	/* should never reach here */
+	case SMOOTH:
+		return -1;
 	}
 	return -1;
 }
-- 
2.7.4



More information about the mesa-dev mailing list