diff options
author | Timothy Arceri <[email protected]> | 2020-07-01 13:59:41 +1000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-02 23:52:52 +0000 |
commit | 31dcc173b1552d1c332490367f71ac26a8615bc1 (patch) | |
tree | 189ee10d009a5f140bb65d67b56e4a760636ff35 /src | |
parent | f931099270497d5ede856fe0cbc35b8b878011b0 (diff) |
mesa: add fallthrough comments to get.c
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/get.c | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index a1199e5ad53..eb8f2c553a0 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1730,15 +1730,19 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params) params[6] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[6]); params[5] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[5]); params[4] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[4]); + /* fallthrough */ case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]); @@ -1746,6 +1750,7 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params) case TYPE_DOUBLEN_2: params[1] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]); break; @@ -1753,13 +1758,16 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params) case TYPE_INT_4: case TYPE_UINT_4: params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]); + /* fallthrough */ case TYPE_INT_3: case TYPE_UINT_3: params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]); + /* fallthrough */ case TYPE_INT_2: case TYPE_UINT_2: case TYPE_ENUM_2: params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]); + /* fallthrough */ case TYPE_INT: case TYPE_UINT: case TYPE_ENUM: @@ -1839,15 +1847,19 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params) params[6] = ((GLfloat *) p)[6]; params[5] = ((GLfloat *) p)[5]; params[4] = ((GLfloat *) p)[4]; + /* fallthrough */ case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = ((GLfloat *) p)[3]; + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = ((GLfloat *) p)[2]; + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = ((GLfloat *) p)[1]; + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = ((GLfloat *) p)[0]; @@ -1855,17 +1867,21 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params) case TYPE_DOUBLEN_2: params[1] = (GLfloat) (((GLdouble *) p)[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = (GLfloat) (((GLdouble *) p)[0]); break; case TYPE_INT_4: params[3] = (GLfloat) (((GLint *) p)[3]); + /* fallthrough */ case TYPE_INT_3: params[2] = (GLfloat) (((GLint *) p)[2]); + /* fallthrough */ case TYPE_INT_2: case TYPE_ENUM_2: params[1] = (GLfloat) (((GLint *) p)[1]); + /* fallthrough */ case TYPE_INT: case TYPE_ENUM: params[0] = (GLfloat) (((GLint *) p)[0]); @@ -1882,10 +1898,13 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params) case TYPE_UINT_4: params[3] = (GLfloat) (((GLuint *) p)[3]); + /* fallthrough */ case TYPE_UINT_3: params[2] = (GLfloat) (((GLuint *) p)[2]); + /* fallthrough */ case TYPE_UINT_2: params[1] = (GLfloat) (((GLuint *) p)[1]); + /* fallthrough */ case TYPE_UINT: params[0] = (GLfloat) (((GLuint *) p)[0]); break; @@ -1954,28 +1973,36 @@ _mesa_GetIntegerv(GLenum pname, GLint *params) params[6] = lroundf(((GLfloat *) p)[6]); params[5] = lroundf(((GLfloat *) p)[5]); params[4] = lroundf(((GLfloat *) p)[4]); + /* fallthrough */ case TYPE_FLOAT_4: params[3] = lroundf(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOAT_3: params[2] = lroundf(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOAT_2: params[1] = lroundf(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOAT: params[0] = lroundf(((GLfloat *) p)[0]); break; case TYPE_FLOATN_4: params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOATN_3: params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOATN_2: params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOATN: params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]); break; case TYPE_DOUBLEN_2: params[1] = FLOAT_TO_INT(((GLdouble *) p)[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]); break; @@ -1983,13 +2010,16 @@ _mesa_GetIntegerv(GLenum pname, GLint *params) case TYPE_INT_4: case TYPE_UINT_4: params[3] = ((GLint *) p)[3]; + /* fallthrough */ case TYPE_INT_3: case TYPE_UINT_3: params[2] = ((GLint *) p)[2]; + /* fallthrough */ case TYPE_INT_2: case TYPE_UINT_2: case TYPE_ENUM_2: params[1] = ((GLint *) p)[1]; + /* fallthrough */ case TYPE_INT: case TYPE_UINT: case TYPE_ENUM: @@ -2069,39 +2099,50 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params) params[6] = llround(((GLfloat *) p)[6]); params[5] = llround(((GLfloat *) p)[5]); params[4] = llround(((GLfloat *) p)[4]); + /* fallthrough */ case TYPE_FLOAT_4: params[3] = llround(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOAT_3: params[2] = llround(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOAT_2: params[1] = llround(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOAT: params[0] = llround(((GLfloat *) p)[0]); break; case TYPE_FLOATN_4: params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOATN_3: params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOATN_2: params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOATN: params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]); break; case TYPE_DOUBLEN_2: params[1] = FLOAT_TO_INT(((GLdouble *) p)[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]); break; case TYPE_INT_4: params[3] = ((GLint *) p)[3]; + /* fallthrough */ case TYPE_INT_3: params[2] = ((GLint *) p)[2]; + /* fallthrough */ case TYPE_INT_2: case TYPE_ENUM_2: params[1] = ((GLint *) p)[1]; + /* fallthrough */ case TYPE_INT: case TYPE_ENUM: params[0] = ((GLint *) p)[0]; @@ -2118,10 +2159,13 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params) case TYPE_UINT_4: params[3] = ((GLuint *) p)[3]; + /* fallthrough */ case TYPE_UINT_3: params[2] = ((GLuint *) p)[2]; + /* fallthrough */ case TYPE_UINT_2: params[1] = ((GLuint *) p)[1]; + /* fallthrough */ case TYPE_UINT: params[0] = ((GLuint *) p)[0]; break; @@ -2182,15 +2226,19 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params) params[6] = ((GLfloat *) p)[6]; params[5] = ((GLfloat *) p)[5]; params[4] = ((GLfloat *) p)[4]; + /* fallthrough */ case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = ((GLfloat *) p)[3]; + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = ((GLfloat *) p)[2]; + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = ((GLfloat *) p)[1]; + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = ((GLfloat *) p)[0]; @@ -2198,17 +2246,21 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params) case TYPE_DOUBLEN_2: params[1] = ((GLdouble *) p)[1]; + /* fallthrough */ case TYPE_DOUBLEN: params[0] = ((GLdouble *) p)[0]; break; case TYPE_INT_4: params[3] = ((GLint *) p)[3]; + /* fallthrough */ case TYPE_INT_3: params[2] = ((GLint *) p)[2]; + /* fallthrough */ case TYPE_INT_2: case TYPE_ENUM_2: params[1] = ((GLint *) p)[1]; + /* fallthrough */ case TYPE_INT: case TYPE_ENUM: params[0] = ((GLint *) p)[0]; @@ -2225,10 +2277,13 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params) case TYPE_UINT_4: params[3] = ((GLuint *) p)[3]; + /* fallthrough */ case TYPE_UINT_3: params[2] = ((GLuint *) p)[2]; + /* fallthrough */ case TYPE_UINT_2: params[1] = ((GLuint *) p)[1]; + /* fallthrough */ case TYPE_UINT: params[0] = ((GLuint *) p)[0]; break; @@ -2914,12 +2969,15 @@ _mesa_GetIntegeri_v( GLenum pname, GLuint index, GLint *params ) case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = lroundf(v.value_float_4[3]); + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = lroundf(v.value_float_4[2]); + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = lroundf(v.value_float_4[1]); + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = lroundf(v.value_float_4[0]); @@ -2927,6 +2985,7 @@ _mesa_GetIntegeri_v( GLenum pname, GLuint index, GLint *params ) case TYPE_DOUBLEN_2: params[1] = lroundf(v.value_double_2[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = lroundf(v.value_double_2[0]); break; @@ -2997,12 +3056,15 @@ _mesa_GetFloati_v(GLenum pname, GLuint index, GLfloat *params) case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = v.value_float_4[3]; + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = v.value_float_4[2]; + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = v.value_float_4[1]; + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = v.value_float_4[0]; @@ -3010,17 +3072,21 @@ _mesa_GetFloati_v(GLenum pname, GLuint index, GLfloat *params) case TYPE_DOUBLEN_2: params[1] = (GLfloat) v.value_double_2[1]; + /* fallthrough */ case TYPE_DOUBLEN: params[0] = (GLfloat) v.value_double_2[0]; break; case TYPE_INT_4: params[3] = (GLfloat) v.value_int_4[3]; + /* fallthrough */ case TYPE_INT_3: params[2] = (GLfloat) v.value_int_4[2]; + /* fallthrough */ case TYPE_INT_2: case TYPE_ENUM_2: params[1] = (GLfloat) v.value_int_4[1]; + /* fallthrough */ case TYPE_INT: case TYPE_ENUM: case TYPE_ENUM16: @@ -3034,10 +3100,13 @@ _mesa_GetFloati_v(GLenum pname, GLuint index, GLfloat *params) case TYPE_UINT_4: params[3] = (GLfloat) ((GLuint) v.value_int_4[3]); + /* fallthrough */ case TYPE_UINT_3: params[2] = (GLfloat) ((GLuint) v.value_int_4[2]); + /* fallthrough */ case TYPE_UINT_2: params[1] = (GLfloat) ((GLuint) v.value_int_4[1]); + /* fallthrough */ case TYPE_UINT: params[0] = (GLfloat) ((GLuint) v.value_int_4[0]); break; @@ -3088,12 +3157,15 @@ _mesa_GetDoublei_v(GLenum pname, GLuint index, GLdouble *params) case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = (GLdouble) v.value_float_4[3]; + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = (GLdouble) v.value_float_4[2]; + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = (GLdouble) v.value_float_4[1]; + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = (GLdouble) v.value_float_4[0]; @@ -3101,17 +3173,21 @@ _mesa_GetDoublei_v(GLenum pname, GLuint index, GLdouble *params) case TYPE_DOUBLEN_2: params[1] = v.value_double_2[1]; + /* fallthrough */ case TYPE_DOUBLEN: params[0] = v.value_double_2[0]; break; case TYPE_INT_4: params[3] = (GLdouble) v.value_int_4[3]; + /* fallthrough */ case TYPE_INT_3: params[2] = (GLdouble) v.value_int_4[2]; + /* fallthrough */ case TYPE_INT_2: case TYPE_ENUM_2: params[1] = (GLdouble) v.value_int_4[1]; + /* fallthrough */ case TYPE_INT: case TYPE_ENUM: case TYPE_ENUM16: @@ -3125,10 +3201,13 @@ _mesa_GetDoublei_v(GLenum pname, GLuint index, GLdouble *params) case TYPE_UINT_4: params[3] = (GLdouble) ((GLuint) v.value_int_4[3]); + /* fallthrough */ case TYPE_UINT_3: params[2] = (GLdouble) ((GLuint) v.value_int_4[2]); + /* fallthrough */ case TYPE_UINT_2: params[1] = (GLdouble) ((GLuint) v.value_int_4[1]); + /* fallthrough */ case TYPE_UINT: params[0] = (GLdouble) ((GLuint) v.value_int_4[0]); break; @@ -3246,12 +3325,15 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params) case TYPE_FLOAT_4: case TYPE_FLOATN_4: params[3] = FLOAT_TO_FIXED(((GLfloat *) p)[3]); + /* fallthrough */ case TYPE_FLOAT_3: case TYPE_FLOATN_3: params[2] = FLOAT_TO_FIXED(((GLfloat *) p)[2]); + /* fallthrough */ case TYPE_FLOAT_2: case TYPE_FLOATN_2: params[1] = FLOAT_TO_FIXED(((GLfloat *) p)[1]); + /* fallthrough */ case TYPE_FLOAT: case TYPE_FLOATN: params[0] = FLOAT_TO_FIXED(((GLfloat *) p)[0]); @@ -3259,6 +3341,7 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params) case TYPE_DOUBLEN_2: params[1] = FLOAT_TO_FIXED(((GLdouble *) p)[1]); + /* fallthrough */ case TYPE_DOUBLEN: params[0] = FLOAT_TO_FIXED(((GLdouble *) p)[0]); break; @@ -3266,13 +3349,16 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params) case TYPE_INT_4: case TYPE_UINT_4: params[3] = INT_TO_FIXED(((GLint *) p)[3]); + /* fallthrough */ case TYPE_INT_3: case TYPE_UINT_3: params[2] = INT_TO_FIXED(((GLint *) p)[2]); + /* fallthrough */ case TYPE_INT_2: case TYPE_UINT_2: case TYPE_ENUM_2: params[1] = INT_TO_FIXED(((GLint *) p)[1]); + /* fallthrough */ case TYPE_INT: case TYPE_UINT: case TYPE_ENUM: |