arb_program_interface_query: Silence return-type warning.

Submitted by Vinson Lee on Oct. 4, 2016, 12:34 a.m.

Details

Message ID 1475541284-30468-1-git-send-email-vlee@freedesktop.org
State New
Headers show
Series "arb_program_interface_query: Silence return-type warning." ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Vinson Lee Oct. 4, 2016, 12:34 a.m.
compare-with-shader-subroutine.c: In function 'get_shadertype_from_program_interface':
compare-with-shader-subroutine.c:251:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Fixes: 39ccf8c59bd5 ("arb_program_interface_query: add compare-with-shader-subroutine test")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
index 2ac9da9..4c52ea7 100644
--- a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
+++ b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
@@ -247,6 +247,7 @@  get_shadertype_from_program_interface(const GLenum programInterface)
                 return GL_COMPUTE_SHADER;
         default:
                 assert(!"unexpected programInterface value");
+                return GL_VERTEX_SHADER;
         }
 }
 

Comments

On 10/04/2016 03:34 AM, Vinson Lee wrote:
> compare-with-shader-subroutine.c: In function 'get_shadertype_from_program_interface':
> compare-with-shader-subroutine.c:251:1: warning: control reaches end of non-void function [-Wreturn-type]
>  }
>  ^
>
> Fixes: 39ccf8c59bd5 ("arb_program_interface_query: add compare-with-shader-subroutine test")
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>  tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
> index 2ac9da9..4c52ea7 100644
> --- a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
> +++ b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
> @@ -247,6 +247,7 @@ get_shadertype_from_program_interface(const GLenum programInterface)
>                  return GL_COMPUTE_SHADER;
>          default:
>                  assert(!"unexpected programInterface value");
> +                return GL_VERTEX_SHADER;

I'd prefer GL_INVALID_ENUM but not a big deal ..

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
On 04/10/16 09:26, Tapani Pälli wrote:
> 
> 
> On 10/04/2016 03:34 AM, Vinson Lee wrote:
>> compare-with-shader-subroutine.c: In function
>> 'get_shadertype_from_program_interface':
>> compare-with-shader-subroutine.c:251:1: warning: control reaches end
>> of non-void function [-Wreturn-type]
>>  }
>>  ^
>>
>> Fixes: 39ccf8c59bd5 ("arb_program_interface_query: add
>> compare-with-shader-subroutine test")
>> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
>> ---
>>  tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
>> | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git
>> a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
>> b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
>> index 2ac9da9..4c52ea7 100644
>> ---
>> a/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
>> +++
>> b/tests/spec/arb_program_interface_query/compare-with-shader-subroutine.c
>> @@ -247,6 +247,7 @@ get_shadertype_from_program_interface(const GLenum
>> programInterface)
>>                  return GL_COMPUTE_SHADER;
>>          default:
>>                  assert(!"unexpected programInterface value");
>> +                return GL_VERTEX_SHADER;
> 
> I'd prefer GL_INVALID_ENUM but not a big deal ..

I agree on both (on preferring and not being a big deal).

> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>