From 57841823a1b188b788bd342f0436fd35811a8228 Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Thu, 21 Jul 2022 23:43:07 +0200 Subject: [PATCH] nine: char can be unsigned on non-x86 platforms Keep sign by using int8_t to get the same result on non-x86 machines. Reviewed-by: Axel Davy Signed-off-by: David Heidelberg Part-of: --- src/gallium/frontends/nine/buffer9.c | 4 ++-- src/gallium/frontends/nine/nine_ff.c | 2 +- src/gallium/frontends/nine/nine_ff.h | 2 +- src/gallium/frontends/nine/nine_state.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gallium/frontends/nine/buffer9.c b/src/gallium/frontends/nine/buffer9.c index 3dd1db4393c..cc6369ff389 100644 --- a/src/gallium/frontends/nine/buffer9.c +++ b/src/gallium/frontends/nine/buffer9.c @@ -323,7 +323,7 @@ NineBuffer9_Lock( struct NineBuffer9 *This, BASEBUF_REGISTER_UPDATE(This); } - *ppbData = (char *)This->managed.data + OffsetToLock; + *ppbData = (int8_t *)This->managed.data + OffsetToLock; DBG("returning pointer %p\n", *ppbData); This->nlocks++; return D3D_OK; @@ -710,6 +710,6 @@ NineBuffer9_Upload( struct NineBuffer9 *This ) box_upload.x, box_upload.width, upload_flags, - (char *)This->managed.data + box_upload.x); + (int8_t *)This->managed.data + box_upload.x); This->managed.dirty = FALSE; } diff --git a/src/gallium/frontends/nine/nine_ff.c b/src/gallium/frontends/nine/nine_ff.c index 6c9f896ad21..edf131cefad 100644 --- a/src/gallium/frontends/nine/nine_ff.c +++ b/src/gallium/frontends/nine/nine_ff.c @@ -1574,7 +1574,7 @@ nine_ff_get_vs(struct NineDevice9 *device) unsigned s, i; boolean has_indexes = false; boolean has_weights = false; - char input_texture_coord[8]; + int8_t input_texture_coord[8]; assert(sizeof(key) <= sizeof(key.value32)); diff --git a/src/gallium/frontends/nine/nine_ff.h b/src/gallium/frontends/nine/nine_ff.h index 5345b99dbb5..65baabd4ba7 100644 --- a/src/gallium/frontends/nine/nine_ff.h +++ b/src/gallium/frontends/nine/nine_ff.h @@ -66,7 +66,7 @@ nine_ff_get_projected_key(struct nine_context *context, unsigned num_stages) { unsigned s, i; uint16_t projected = 0; - char input_texture_coord[num_stages]; + int8_t input_texture_coord[num_stages]; memset(&input_texture_coord, 0, sizeof(input_texture_coord)); if (context->vdecl) { diff --git a/src/gallium/frontends/nine/nine_state.c b/src/gallium/frontends/nine/nine_state.c index f800dd94f64..8916af3ccde 100644 --- a/src/gallium/frontends/nine/nine_state.c +++ b/src/gallium/frontends/nine/nine_state.c @@ -417,7 +417,7 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device) context->pipe_data.cb0_swvp.buffer_size = cb.buffer_size; context->pipe_data.cb0_swvp.user_buffer = cb.user_buffer; - cb.user_buffer = (char *)cb.user_buffer + 4096 * sizeof(float[4]); + cb.user_buffer = (int8_t *)cb.user_buffer + 4096 * sizeof(float[4]); context->pipe_data.cb1_swvp.buffer_offset = cb.buffer_offset; context->pipe_data.cb1_swvp.buffer_size = cb.buffer_size; context->pipe_data.cb1_swvp.user_buffer = cb.user_buffer; @@ -3041,7 +3041,7 @@ update_vertex_elements_sw(struct NineDevice9 *device) unsigned n, b, i; int index; int8_t vdecl_index_map[16]; /* vs->num_inputs <= 16 */ - char used_streams[device->caps.MaxStreams]; + int8_t used_streams[device->caps.MaxStreams]; int dummy_vbo_stream = -1; BOOL need_dummy_vbo = FALSE; struct cso_velems_state ve; @@ -3206,7 +3206,7 @@ update_vs_constants_sw(struct NineDevice9 *device) if (cb.buffer) pipe_resource_reference(&cb.buffer, NULL); - cb.user_buffer = (char *)buf + 4096 * sizeof(float[4]); + cb.user_buffer = (int8_t *)buf + 4096 * sizeof(float[4]); pipe_sw->set_constant_buffer(pipe_sw, PIPE_SHADER_VERTEX, 1, false, &cb); if (cb.buffer)