Module: Mesa
Branch: main
Commit: e8114fe9a74843398b1050248b6d9135192bc486
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8114fe9a74843398b1050248b6d9135192bc486

Author: Erik Faye-Lund <[email protected]>
Date:   Mon Jun 26 09:43:07 2023 +0200

aux/util: uint -> unsigned

Reviewed-by: Yonggang Luo <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24002>

---

 src/gallium/auxiliary/util/u_gen_mipmap.c     |  8 +++++---
 src/gallium/auxiliary/util/u_gen_mipmap.h     |  6 ++++--
 src/gallium/auxiliary/util/u_pstipple.c       | 16 ++++++++--------
 src/gallium/auxiliary/util/u_simple_shaders.c | 16 ++++++++--------
 src/gallium/auxiliary/util/u_simple_shaders.h | 14 +++++++-------
 src/gallium/auxiliary/util/u_split_prim.h     |  6 +++---
 src/gallium/auxiliary/util/u_tests.c          |  2 +-
 src/gallium/auxiliary/util/u_tile.c           | 10 ++++++----
 src/gallium/auxiliary/util/u_tile.h           | 15 ++++++++++-----
 9 files changed, 52 insertions(+), 41 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c 
b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 30ccc9750dc..664e5b1d698 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -57,12 +57,14 @@
  */
 bool
 util_gen_mipmap(struct pipe_context *pipe, struct pipe_resource *pt,
-                enum pipe_format format, uint base_level, uint last_level,
-                uint first_layer, uint last_layer, uint filter)
+                enum pipe_format format,
+                unsigned base_level, unsigned last_level,
+                unsigned first_layer, unsigned last_layer,
+                unsigned filter)
 {
    struct pipe_screen *screen = pipe->screen;
    struct pipe_blit_info blit;
-   uint dstLevel;
+   unsigned dstLevel;
    bool is_zs = util_format_is_depth_or_stencil(format);
    bool has_depth =
       util_format_has_depth(util_format_description(format));
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.h 
b/src/gallium/auxiliary/util/u_gen_mipmap.h
index c80853c9082..ce783d09f09 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.h
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.h
@@ -40,8 +40,10 @@ struct pipe_context;
 
 extern bool
 util_gen_mipmap(struct pipe_context *pipe, struct pipe_resource *pt,
-                enum pipe_format format, uint base_level, uint last_level,
-                uint first_layer, uint last_layer, uint filter);
+                enum pipe_format format,
+                unsigned base_level, unsigned last_level,
+                unsigned first_layer, unsigned last_layer,
+                unsigned filter);
 
 
 #ifdef __cplusplus
diff --git a/src/gallium/auxiliary/util/u_pstipple.c 
b/src/gallium/auxiliary/util/u_pstipple.c
index 39c6e4baf73..b0d5b0d1269 100644
--- a/src/gallium/auxiliary/util/u_pstipple.c
+++ b/src/gallium/auxiliary/util/u_pstipple.c
@@ -63,7 +63,7 @@ util_pstipple_update_stipple_texture(struct pipe_context 
*pipe,
                                      struct pipe_resource *tex,
                                      const uint32_t pattern[32])
 {
-   static const uint bit31 = 1u << 31;
+   static const unsigned bit31 = 1u << 31;
    struct pipe_transfer *transfer;
    uint8_t *data;
    int i, j;
@@ -174,14 +174,14 @@ util_pstipple_create_sampler(struct pipe_context *pipe)
 struct pstip_transform_context {
    struct tgsi_transform_context base;
    struct tgsi_shader_info info;
-   uint tempsUsed;  /**< bitmask */
+   unsigned tempsUsed;  /**< bitmask */
    int wincoordInput;
    unsigned wincoordFile;
    int maxInput;
-   uint samplersUsed;  /**< bitfield of samplers used */
+   unsigned samplersUsed;  /**< bitfield of samplers used */
    int freeSampler;  /** an available sampler for the pstipple */
    int numImmed;
-   uint coordOrigin;
+   unsigned coordOrigin;
    unsigned fixedUnit;
    bool hasFixedUnit;
 };
@@ -201,7 +201,7 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
    /* XXX we can use tgsi_shader_info instead of some of this */
 
    if (decl->Declaration.File == TGSI_FILE_SAMPLER) {
-      uint i;
+      unsigned i;
       for (i = decl->Range.First; i <= decl->Range.Last; i++) {
          pctx->samplersUsed |= 1u << i;
       }
@@ -212,7 +212,7 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
          pctx->wincoordInput = (int) decl->Range.First;
    }
    else if (decl->Declaration.File == TGSI_FILE_TEMPORARY) {
-      uint i;
+      unsigned i;
       for (i = decl->Range.First; i <= decl->Range.Last; i++) {
          pctx->tempsUsed |= (1 << i);
       }
@@ -237,7 +237,7 @@ pstip_transform_immed(struct tgsi_transform_context *ctx,
  * Find the lowest zero bit in the given word, or -1 if bitfield is all ones.
  */
 static int
-free_bit(uint bitfield)
+free_bit(unsigned bitfield)
 {
    return ffs(~bitfield) - 1;
 }
@@ -377,7 +377,7 @@ util_pstipple_create_fragment_shader(const struct 
tgsi_token *tokens,
                                      unsigned wincoordFile)
 {
    struct pstip_transform_context transform;
-   const uint newLen = tgsi_num_tokens(tokens) + NUM_NEW_TOKENS;
+   const unsigned newLen = tgsi_num_tokens(tokens) + NUM_NEW_TOKENS;
    struct tgsi_token *new_tokens;
 
    /* Setup shader transformation info/context.
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c 
b/src/gallium/auxiliary/util/u_simple_shaders.c
index 79fb7b97fca..35173ca91cb 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -58,9 +58,9 @@
  */
 void *
 util_make_vertex_passthrough_shader(struct pipe_context *pipe,
-                                    uint num_attribs,
+                                    unsigned num_attribs,
                                     const enum tgsi_semantic *semantic_names,
-                                    const uint *semantic_indexes,
+                                    const unsigned *semantic_indexes,
                                     bool window_space)
 {
    return util_make_vertex_passthrough_shader_with_so(pipe, num_attribs,
@@ -71,14 +71,14 @@ util_make_vertex_passthrough_shader(struct pipe_context 
*pipe,
 
 void *
 util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe,
-                                    uint num_attribs,
+                                    unsigned num_attribs,
                                     const enum tgsi_semantic *semantic_names,
-                                    const uint *semantic_indexes,
+                                    const unsigned *semantic_indexes,
                                     bool window_space, bool layered,
                                    const struct pipe_stream_output_info *so)
 {
    struct ureg_program *ureg;
-   uint i;
+   unsigned i;
 
    ureg = ureg_create( PIPE_SHADER_VERTEX );
    if (!ureg)
@@ -913,7 +913,7 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context 
*pipe,
 
 void *
 util_make_geometry_passthrough_shader(struct pipe_context *pipe,
-                                      uint num_attribs,
+                                      unsigned num_attribs,
                                       const uint8_t *semantic_names,
                                       const uint8_t *semantic_indexes)
 {
@@ -1132,8 +1132,8 @@ util_make_fs_pack_color_zs(struct pipe_context *pipe,
  */
 void *
 util_make_tess_ctrl_passthrough_shader(struct pipe_context *pipe,
-                                       uint num_vs_outputs,
-                                       uint num_tes_inputs,
+                                       unsigned num_vs_outputs,
+                                       unsigned num_tes_inputs,
                                        const uint8_t *vs_semantic_names,
                                        const uint8_t *vs_semantic_indexes,
                                        const uint8_t *tes_semantic_names,
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h 
b/src/gallium/auxiliary/util/u_simple_shaders.h
index f7fac851319..c64c6045026 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.h
+++ b/src/gallium/auxiliary/util/u_simple_shaders.h
@@ -46,16 +46,16 @@ extern "C" {
 
 extern void *
 util_make_vertex_passthrough_shader(struct pipe_context *pipe,
-                                    uint num_attribs,
+                                    unsigned num_attribs,
                                     const enum tgsi_semantic *semantic_names,
-                                    const uint *semantic_indexes,
+                                    const unsigned *semantic_indexes,
                                     bool window_space);
 
 extern void *
 util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe,
-                                    uint num_attribs,
+                                    unsigned num_attribs,
                                     const enum tgsi_semantic *semantic_names,
-                                    const uint *semantic_indexes,
+                                    const unsigned *semantic_indexes,
                                     bool window_space, bool layered,
                                     const struct pipe_stream_output_info *so);
 
@@ -137,7 +137,7 @@ util_make_fs_msaa_resolve_bilinear(struct pipe_context 
*pipe,
 
 extern void *
 util_make_geometry_passthrough_shader(struct pipe_context *pipe,
-                                      uint num_attribs,
+                                      unsigned num_attribs,
                                       const uint8_t *semantic_names,
                                       const uint8_t *semantic_indexes);
 
@@ -149,8 +149,8 @@ util_make_fs_pack_color_zs(struct pipe_context *pipe,
 
 extern void *
 util_make_tess_ctrl_passthrough_shader(struct pipe_context *pipe,
-                                       uint num_vs_outputs,
-                                       uint num_tes_inputs,
+                                       unsigned num_vs_outputs,
+                                       unsigned num_tes_inputs,
                                        const uint8_t *vs_semantic_names,
                                        const uint8_t *vs_semantic_indexes,
                                        const uint8_t *tes_semantic_names,
diff --git a/src/gallium/auxiliary/util/u_split_prim.h 
b/src/gallium/auxiliary/util/u_split_prim.h
index 09545cd4a39..c20b19f5faa 100644
--- a/src/gallium/auxiliary/util/u_split_prim.h
+++ b/src/gallium/auxiliary/util/u_split_prim.h
@@ -18,9 +18,9 @@ struct util_split_prim {
    unsigned p_start;
    unsigned p_end;
 
-   uint repeat_first:1;
-   uint close_first:1;
-   uint edgeflag_off:1;
+   unsigned repeat_first:1;
+   unsigned close_first:1;
+   unsigned edgeflag_off:1;
 };
 
 static inline void
diff --git a/src/gallium/auxiliary/util/u_tests.c 
b/src/gallium/auxiliary/util/u_tests.c
index c1a82effeed..549b184b31a 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -160,7 +160,7 @@ util_set_passthrough_vertex_shader(struct cso_context *cso,
       TGSI_SEMANTIC_POSITION,
       TGSI_SEMANTIC_GENERIC
    };
-   static const uint vs_indices[] = {0, 0};
+   static const unsigned vs_indices[] = {0, 0};
    void *vs;
 
    vs = util_make_vertex_passthrough_shader(ctx, 2, vs_attribs, vs_indices,
diff --git a/src/gallium/auxiliary/util/u_tile.c 
b/src/gallium/auxiliary/util/u_tile.c
index 75195413c93..c5261bf8adf 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -48,7 +48,8 @@
 void
 pipe_get_tile_raw(struct pipe_transfer *pt,
                   const void *src,
-                  uint x, uint y, uint w, uint h,
+                  unsigned x, unsigned y,
+                  unsigned w, unsigned h,
                   void *dst, int dst_stride)
 {
    if (dst_stride == 0)
@@ -67,7 +68,8 @@ pipe_get_tile_raw(struct pipe_transfer *pt,
 void
 pipe_put_tile_raw(struct pipe_transfer *pt,
                   void *dst,
-                  uint x, uint y, uint w, uint h,
+                  unsigned x, unsigned y,
+                  unsigned w, unsigned h,
                   const void *src, int src_stride)
 {
    enum pipe_format format = pt->resource->format;
@@ -357,7 +359,7 @@ x32_s8_get_tile_rgba(const uint32_t *src,
 void
 pipe_put_tile_rgba(struct pipe_transfer *pt,
                    void *dst,
-                   uint x, uint y, uint w, uint h,
+                   unsigned x, unsigned y, unsigned w, unsigned h,
                    enum pipe_format format, const void *p)
 {
    unsigned src_stride = w * 4;
@@ -380,7 +382,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt,
 void
 pipe_get_tile_rgba(struct pipe_transfer *pt,
                    const void *src,
-                   uint x, uint y, uint w, uint h,
+                   unsigned x, unsigned y, unsigned w, unsigned h,
                    enum pipe_format format,
                    void *dst)
 {
diff --git a/src/gallium/auxiliary/util/u_tile.h 
b/src/gallium/auxiliary/util/u_tile.h
index 119373a629d..935af78f611 100644
--- a/src/gallium/auxiliary/util/u_tile.h
+++ b/src/gallium/auxiliary/util/u_tile.h
@@ -43,7 +43,8 @@ struct pipe_transfer;
  * \return TRUE if tile is totally clipped, FALSE otherwise
  */
 static inline bool
-u_clip_tile(uint x, uint y, uint *w, uint *h, const struct pipe_box *box)
+u_clip_tile(unsigned x, unsigned y, unsigned *w, unsigned *h,
+            const struct pipe_box *box)
 {
    if ((int) x >= box->width)
       return true;
@@ -63,27 +64,31 @@ extern "C" {
 void
 pipe_get_tile_raw(struct pipe_transfer *pt,
                   const void *src,
-                  uint x, uint y, uint w, uint h,
+                  unsigned x, unsigned y,
+                  unsigned w, unsigned h,
                   void *p, int dst_stride);
 
 void
 pipe_put_tile_raw(struct pipe_transfer *pt,
                   void *dst,
-                  uint x, uint y, uint w, uint h,
+                  unsigned x, unsigned y,
+                  unsigned w, unsigned h,
                   const void *p, int src_stride);
 
 
 void
 pipe_get_tile_rgba(struct pipe_transfer *pt,
                    const void *src,
-                   uint x, uint y, uint w, uint h,
+                   unsigned x, unsigned y,
+                   unsigned w, unsigned h,
                    enum pipe_format format,
                    void *dst);
 
 void
 pipe_put_tile_rgba(struct pipe_transfer *pt,
                    void *dst,
-                   uint x, uint y, uint w, uint h,
+                   unsigned x, unsigned y,
+                   unsigned w, unsigned h,
                    enum pipe_format format,
                    const void *src);
 

Reply via email to