[Mesa-dev] [PATCH 19/21] i965: Resolve GCC sign-compare warning.
Ian Romanick
idr at freedesktop.org
Wed Aug 5 09:10:00 PDT 2015
On 08/02/2015 11:09 PM, Rhys Kidd wrote:
> mesa/src/mesa/drivers/dri/i965/brw_vs_surface_state.c: In function 'brw_upload_pull_constants':
> mesa/src/mesa/drivers/dri/i965/brw_vs_surface_state.c:84:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> for (i = 0; i < prog_data->nr_pull_params; i++) {
> ^
> mesa/src/mesa/drivers/dri/i965/brw_vs_surface_state.c:89:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
> for (i = 0; i < ALIGN(prog_data->nr_pull_params, 4) / 4; i++) {
> ^
>
> Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
> ---
> src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
> index b2f91bd..41893cd 100644
> --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
> @@ -56,7 +56,7 @@ brw_upload_pull_constants(struct brw_context *brw,
> const struct brw_stage_prog_data *prog_data,
> bool dword_pitch)
> {
> - int i;
> + uint32_t i;
I don't think there's a need for a specific size here. unsigned should
be fine.
> uint32_t surf_index = prog_data->binding_table.pull_constants_start;
>
> if (!prog_data->nr_pull_params) {
>
More information about the mesa-dev
mailing list