mesa: Fix warning about static being in the wrong place
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 19 Aug 2015 00:41:30 +0000 (17:41 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 2 Sep 2015 23:24:17 +0000 (16:24 -0700)
Because the compiler already has enough things to complain about.

    grep -rl 'const static' src/ | while read f
    do
        sed --in-place -e 's/const static/static const/g' $f
    done

brw_eu_emit.c: In function 'brw_reg_type_to_hw_type':
brw_eu_emit.c:98:7: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
       const static int imm_hw_types[] = {
       ^
brw_eu_emit.c:120:7: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
       const static int hw_types[] = {
       ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/egl/wayland/wayland-drm/wayland-drm.c
src/gallium/drivers/i915/i915_fpc_optimize.c
src/glsl/builtin_types.cpp
src/glsl/ir_reader.cpp
src/mesa/drivers/dri/i965/brw_eu_emit.c

index e9c6e0a6507cb351c4db5b9ae14c53430493fd7e..e00d9be6a9185098d1f442fcf412cd79204780e6 100644 (file)
@@ -197,7 +197,7 @@ drm_authenticate(struct wl_client *client,
                wl_resource_post_event(resource, WL_DRM_AUTHENTICATED);
 }
 
-const static struct wl_drm_interface drm_interface = {
+static const struct wl_drm_interface drm_interface = {
        drm_authenticate,
        drm_create_buffer,
         drm_create_planar_buffer,
index 83bb64918d4f92aa55adf277696aaf16cbf6a0bf..a2b6d272939799d9b6ac92c6a2c8bc85b6b7a785 100644 (file)
@@ -69,7 +69,7 @@ static boolean same_src_reg(struct i915_full_src_register *d1, struct i915_full_
            d1->Register.Negate == d2->Register.Negate);
 }
 
-const static struct {
+static const struct {
    boolean is_texture;
    boolean commutes;
    unsigned neutral_element;
index 0d0d71d56df0b93d9578f17fa1532750f2f58058..0aedbb3546ab844f46b5915fd3890ed9a1fed16a 100644 (file)
@@ -127,7 +127,7 @@ static const struct glsl_struct_field gl_FogParameters_fields[] = {
 #define T(TYPE, MIN_GL, MIN_ES) \
    { glsl_type::TYPE##_type, MIN_GL, MIN_ES },
 
-const static struct builtin_type_versions {
+static const struct builtin_type_versions {
    const glsl_type *const type;
    int min_gl;
    int min_es;
index 469837f5e4c250ad934aae5ba50ccb0cbbc9beb3..979653304cc2cb87c048e9064dca2334b15297d2 100644 (file)
@@ -26,7 +26,7 @@
 #include "glsl_types.h"
 #include "s_expression.h"
 
-const static bool debug = false;
+static const bool debug = false;
 
 namespace {
 
index 4d397622fc122f8e3e6125541f8821d40fd6d7a8..637fd074ff152d816baec39862170974e8021bb5 100644 (file)
@@ -95,7 +95,7 @@ brw_reg_type_to_hw_type(const struct brw_device_info *devinfo,
                         enum brw_reg_type type, unsigned file)
 {
    if (file == BRW_IMMEDIATE_VALUE) {
-      const static int imm_hw_types[] = {
+      static const int imm_hw_types[] = {
          [BRW_REGISTER_TYPE_UD] = BRW_HW_REG_TYPE_UD,
          [BRW_REGISTER_TYPE_D]  = BRW_HW_REG_TYPE_D,
          [BRW_REGISTER_TYPE_UW] = BRW_HW_REG_TYPE_UW,
@@ -117,7 +117,7 @@ brw_reg_type_to_hw_type(const struct brw_device_info *devinfo,
       return imm_hw_types[type];
    } else {
       /* Non-immediate registers */
-      const static int hw_types[] = {
+      static const int hw_types[] = {
          [BRW_REGISTER_TYPE_UD] = BRW_HW_REG_TYPE_UD,
          [BRW_REGISTER_TYPE_D]  = BRW_HW_REG_TYPE_D,
          [BRW_REGISTER_TYPE_UW] = BRW_HW_REG_TYPE_UW,