Mesa (master): tgsi: s/unsigned/enum pipe_shader_type/ in ureg code

Brian Paul brianp at kemper.freedesktop.org
Thu Feb 8 17:31:21 UTC 2018


Module: Mesa
Branch: master
Commit: 0f40f4ffdae7b9cc5b9cb32a9373ab95ebee4383
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f40f4ffdae7b9cc5b9cb32a9373ab95ebee4383

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Feb  7 18:18:39 2018 -0700

tgsi: s/unsigned/enum pipe_shader_type/ in ureg code

And add a default switch case to silence a compiler warning.

Reviewed-by: Mathias Fröhlich <mathias.froehlich at web.de>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/auxiliary/tgsi/tgsi_ureg.c | 9 ++++++---
 src/gallium/auxiliary/tgsi/tgsi_ureg.h | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index b3f8b1e14e..b2cc45da63 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -107,7 +107,7 @@ struct hw_atomic_decl {
 
 struct ureg_program
 {
-   unsigned processor;
+   enum pipe_shader_type processor;
    bool supports_any_inout_decl_range;
    int next_shader_processor;
 
@@ -2070,6 +2070,8 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg )
                        PIPE_SHADER_FRAGMENT :
                        ureg->next_shader_processor);
       break;
+   default:
+      ; /* nothing */
    }
 
    emit_header( ureg );
@@ -2163,14 +2165,15 @@ void ureg_free_tokens( const struct tgsi_token *tokens )
 
 
 struct ureg_program *
-ureg_create(unsigned processor)
+ureg_create(enum pipe_shader_type processor)
 {
    return ureg_create_with_screen(processor, NULL);
 }
 
 
 struct ureg_program *
-ureg_create_with_screen(unsigned processor, struct pipe_screen *screen)
+ureg_create_with_screen(enum pipe_shader_type processor,
+                        struct pipe_screen *screen)
 {
    int i;
    struct ureg_program *ureg = CALLOC_STRUCT( ureg_program );
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 03496896aa..e8ebae9435 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -93,10 +93,11 @@ struct ureg_dst
 struct pipe_context;
 
 struct ureg_program *
-ureg_create(unsigned processor);
+ureg_create(enum pipe_shader_type processor);
 
 struct ureg_program *
-ureg_create_with_screen(unsigned processor, struct pipe_screen *screen);
+ureg_create_with_screen(enum pipe_shader_type processor,
+                        struct pipe_screen *screen);
 
 const struct tgsi_token *
 ureg_finalize( struct ureg_program * );




More information about the mesa-commit mailing list