From: Konstantin Kharlamov Date: Fri, 29 Dec 2017 05:32:29 +0000 (+0300) Subject: st/nine: constify some variables X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1379d9759fb7f1359b4a43380a0e99f3c2ca5985;p=mesa.git st/nine: constify some variables Just a nice hint for both peoples and compilers. Signed-off-by: Konstantin Kharlamov Signed-off-by: Marek Olšák --- diff --git a/src/gallium/state_trackers/nine/nine_pipe.h b/src/gallium/state_trackers/nine/nine_pipe.h index 6bd4a0c8972..c8fef628276 100644 --- a/src/gallium/state_trackers/nine/nine_pipe.h +++ b/src/gallium/state_trackers/nine/nine_pipe.h @@ -201,7 +201,7 @@ compressed_format( D3DFORMAT fmt ) static inline boolean depth_stencil_format( D3DFORMAT fmt ) { - static D3DFORMAT allowed[] = { + static const D3DFORMAT allowed[] = { D3DFMT_D16_LOCKABLE, D3DFMT_D32, D3DFMT_D15S1, diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 422df931c74..7db07d8f693 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -378,7 +378,7 @@ struct sm1_instruction struct sm1_src_param dst_rel[1]; struct sm1_dst_param dst[1]; - struct sm1_op_info *info; + const struct sm1_op_info *info; }; static void @@ -2901,7 +2901,7 @@ DECL_SPECIAL(COMMENT) #define _OPI(o,t,vv1,vv2,pv1,pv2,d,s,h) \ { D3DSIO_##o, TGSI_OPCODE_##t, { vv1, vv2 }, { pv1, pv2, }, d, s, h } -struct sm1_op_info inst_table[] = +static const struct sm1_op_info inst_table[] = { _OPI(NOP, NOP, V(0,0), V(3,0), V(0,0), V(3,0), 0, 0, SPECIAL(NOP)), /* 0 */ _OPI(MOV, MOV, V(0,0), V(3,0), V(0,0), V(3,0), 1, 1, NULL), @@ -3008,10 +3008,10 @@ struct sm1_op_info inst_table[] = _OPI(BREAKP, BRK, V(0,0), V(3,0), V(2,1), V(3,0), 0, 1, SPECIAL(BREAKP)) }; -struct sm1_op_info inst_phase = +static const struct sm1_op_info inst_phase = _OPI(PHASE, NOP, V(0,0), V(0,0), V(1,4), V(1,4), 0, 0, SPECIAL(PHASE)); -struct sm1_op_info inst_comment = +static const struct sm1_op_info inst_comment = _OPI(COMMENT, NOP, V(0,0), V(3,0), V(0,0), V(3,0), 0, 0, SPECIAL(COMMENT)); static void @@ -3279,7 +3279,7 @@ sm1_parse_instruction(struct shader_translator *tx) struct sm1_instruction *insn = &tx->insn; HRESULT hr; DWORD tok; - struct sm1_op_info *info = NULL; + const struct sm1_op_info *info = NULL; unsigned i; sm1_parse_comments(tx, TRUE);