d3d12: Fix GCC warnings for missing function prototypes
authorJesse Natalie <jenatali@microsoft.com>
Thu, 26 Nov 2020 01:18:26 +0000 (17:18 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Dec 2020 17:10:47 +0000 (17:10 +0000)
Most of these are adding 'static', for functions that are local
to a translation unit but weren't declared static.

There's one instance of a missing include for bringing the prototype
into the translation unit, one function missing a return type (default-int),
and one which added inline to avoid it being considered unused in some sources.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7780>

src/gallium/drivers/d3d12/d3d12_lower_point_sprite.c
src/gallium/drivers/d3d12/d3d12_nir_lower_texcmp.c
src/gallium/drivers/d3d12/d3d12_nir_passes.c
src/microsoft/compiler/dxil_buffer.h
src/microsoft/compiler/dxil_module.c
src/microsoft/compiler/dxil_nir.c
src/microsoft/compiler/dxil_nir_lower_int_samplers.c
src/microsoft/compiler/nir_to_dxil.c

index e6e7c46..8cdd350 100644 (file)
@@ -24,6 +24,7 @@
 #include "nir.h"
 #include "nir_builder.h"
 #include "d3d12_compiler.h"
+#include "d3d12_nir_passes.h"
 #include "program/prog_statevars.h"
 
 struct lower_state {
index 0002b4c..976a58a 100644 (file)
@@ -25,7 +25,7 @@
 #include "nir_builder.h"
 #include "nir_builtin_builder.h"
 
-bool
+static bool
 lower_sample_tex_compare_filter(const nir_instr *instr,
                                 UNUSED const void *_options)
 {
index a6ee662..83beea4 100644 (file)
@@ -580,7 +580,7 @@ d3d12_create_bare_samplers(nir_shader *nir)
    }
 }
 
-bool
+static bool
 lower_bool_input_filter(const nir_instr *instr,
                         UNUSED const void *_options)
 {
@@ -779,7 +779,7 @@ d3d12_fix_io_uint_type(struct nir_shader *s, uint64_t in_mask, uint64_t out_mask
    return progress;
 }
 
-bool
+static bool
 lower_load_ubo_packed_filter(const nir_instr *instr,
                              UNUSED const void *_options) {
    if (instr->type != nir_instr_type_intrinsic)
index 4f0cc60..d472667 100644 (file)
@@ -50,7 +50,7 @@ dxil_buffer_emit_vbr_bits(struct dxil_buffer *b, uint64_t data,
 bool
 dxil_buffer_align(struct dxil_buffer *b);
 
-static bool
+static inline bool
 dxil_buffer_emit_abbrev_id(struct dxil_buffer *b, uint32_t id)
 {
    return dxil_buffer_emit_bits(b, id, b->abbrev_width);
index 3fd5b1e..bb330b0 100644 (file)
@@ -64,7 +64,7 @@ dxil_module_release(struct dxil_module *m)
    dxil_buffer_finish(&m->buf);
 }
 
-bool
+static bool
 emit_bits64(struct dxil_buffer *b, uint64_t data, unsigned width)
 {
    if (data > UINT32_MAX) {
@@ -1996,7 +1996,7 @@ emit_undef_value(struct dxil_module *m)
    return emit_record_no_abbrev(&m->buf, CST_CODE_UNDEF, NULL, 0);
 }
 
-uint64_t
+static uint64_t
 encode_signed(int64_t value)
 {
    return value >= 0 ?
@@ -2104,7 +2104,7 @@ emit_consts(struct dxil_module *m)
    return true;
 }
 
-bool
+static bool
 emit_module_consts(struct dxil_module *m)
 {
    return enter_subblock(m, DXIL_CONST_BLOCK, 4) &&
@@ -2988,7 +2988,7 @@ emit_cast(struct dxil_module *m, struct dxil_instr *instr)
                                   data, ARRAY_SIZE(data));
 }
 
-bool
+static bool
 emit_branch(struct dxil_module *m, struct dxil_instr *instr)
 {
    assert(instr->type == INSTR_BR);
@@ -3014,7 +3014,7 @@ emit_branch(struct dxil_module *m, struct dxil_instr *instr)
                                 data, ARRAY_SIZE(data));
 }
 
-bool
+static bool
 emit_phi(struct dxil_module *m, struct dxil_instr *instr)
 {
    assert(instr->type == INSTR_PHI);
index 2e1b10d..0d57345 100644 (file)
@@ -417,7 +417,7 @@ lower_store_ssbo(nir_builder *b, nir_intrinsic_instr *intr)
    return true;
 }
 
-void
+static void
 lower_load_vec32(nir_builder *b, nir_ssa_def *index, unsigned num_comps, nir_ssa_def **comps, nir_intrinsic_op op)
 {
    for (unsigned i = 0; i < num_comps; i++) {
@@ -719,7 +719,7 @@ dxil_nir_lower_ubo_to_temp(nir_shader *nir)
    return progress;
 }
 
-bool
+static bool
 lower_load_ubo(nir_builder *b, nir_intrinsic_instr *intr)
 {
    assert(intr->dest.is_ssa);
@@ -788,6 +788,7 @@ dxil_nir_lower_loads_stores_to_dxil(nir_shader *nir)
    return progress;
 }
 
+static bool
 lower_shared_atomic(nir_builder *b, nir_intrinsic_instr *intr,
                     nir_intrinsic_op dxil_op)
 {
index bc420b3..81d1ad2 100644 (file)
@@ -25,7 +25,7 @@
 #include "nir_builder.h"
 #include "nir_builtin_builder.h"
 
-bool
+static bool
 lower_sample_to_txf_for_integer_tex_filter(const nir_instr *instr,
                                            UNUSED const void *_options)
 {
@@ -42,7 +42,7 @@ lower_sample_to_txf_for_integer_tex_filter(const nir_instr *instr,
    return (tex->dest_type & (nir_type_int | nir_type_uint));
 }
 
-nir_ssa_def *
+static nir_ssa_def *
 dx_get_texture_lod(nir_builder *b, nir_tex_instr *tex)
 {
    nir_tex_instr *tql;
@@ -249,7 +249,7 @@ load_bordercolor(nir_builder *b, nir_tex_instr *tex, dxil_wrap_sampler_state *ac
    return nir_build_imm(b, ndest_comp, 32, const_value);
 }
 
-nir_tex_instr *
+static nir_tex_instr *
 create_txf_from_tex(nir_builder *b, nir_tex_instr *tex)
 {
    nir_tex_instr *txf;
index ad063b6..ecebe12 100644 (file)
@@ -1996,7 +1996,7 @@ emit_alu(struct ntd_context *ctx, nir_alu_instr *alu)
    }
 }
 
-const struct dxil_value *
+static const struct dxil_value *
 load_ubo(struct ntd_context *ctx, const struct dxil_value *handle,
          const struct dxil_value *offset, enum overload_type overload)
 {
@@ -4031,7 +4031,7 @@ emit_module(struct ntd_context *ctx, nir_shader *s, const struct nir_to_dxil_opt
           dxil_emit_module(&ctx->mod);
 }
 
-unsigned int
+static unsigned int
 get_dxil_shader_kind(struct nir_shader *s)
 {
    switch (s->info.stage) {