[Mesa-dev] [PATCH] main: replace __FUNCTION__ with __func__

Marius Predut marius.predut at intel.com
Tue Apr 7 12:04:58 PDT 2015


Consistently just use C99's __func__ everywhere.
The patch was verified with Microsoft Visual studio 2013
redistributable package(RTM version number: 18.0.21005.1)
Next MSVC versions intends to support __func__.
No functional changes.

Signed-off-by: Marius Predut <marius.predut at intel.com>
---
 src/mesa/main/atifragshader.c  |    4 ++--
 src/mesa/main/ffvertex_prog.c  |    6 +++---
 src/mesa/main/format_unpack.py |    4 ++--
 src/mesa/main/glformats.c      |    2 +-
 src/mesa/main/mtypes.h         |    2 +-
 src/mesa/main/state.c          |    2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c
index 9d967b9..9fc3552 100644
--- a/src/mesa/main/atifragshader.c
+++ b/src/mesa/main/atifragshader.c
@@ -476,7 +476,7 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle)
    curI->swizzle = swizzle;
 
 #if MESA_DEBUG_ATI_FS
-   _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__,
+   _mesa_debug(ctx, "%s(%s, %s, %s)\n", __func__,
 	       _mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(coord),
 	       _mesa_lookup_enum_by_nr(swizzle));
 #endif
@@ -549,7 +549,7 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle)
    curI->swizzle = swizzle;
 
 #if MESA_DEBUG_ATI_FS
-   _mesa_debug(ctx, "%s(%s, %s, %s)\n", __FUNCTION__,
+   _mesa_debug(ctx, "%s(%s, %s, %s)\n", __func__,
 	       _mesa_lookup_enum_by_nr(dst), _mesa_lookup_enum_by_nr(interp),
 	       _mesa_lookup_enum_by_nr(swizzle));
 #endif
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 395b00e..edf7e33 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -619,13 +619,13 @@ static void emit_op3fn(struct tnl_program *p,
 
 
 #define emit_op3(p, op, dst, mask, src0, src1, src2) \
-   emit_op3fn(p, op, dst, mask, src0, src1, src2, __FUNCTION__, __LINE__)
+   emit_op3fn(p, op, dst, mask, src0, src1, src2, __func__, __LINE__)
 
 #define emit_op2(p, op, dst, mask, src0, src1) \
-    emit_op3fn(p, op, dst, mask, src0, src1, undef, __FUNCTION__, __LINE__)
+    emit_op3fn(p, op, dst, mask, src0, src1, undef, __func__, __LINE__)
 
 #define emit_op1(p, op, dst, mask, src0) \
-    emit_op3fn(p, op, dst, mask, src0, undef, undef, __FUNCTION__, __LINE__)
+    emit_op3fn(p, op, dst, mask, src0, undef, undef, __func__, __LINE__)
 
 
 static struct ureg make_temp( struct tnl_program *p, struct ureg reg )
diff --git a/src/mesa/main/format_unpack.py b/src/mesa/main/format_unpack.py
index 53bdf64..9917548 100644
--- a/src/mesa/main/format_unpack.py
+++ b/src/mesa/main/format_unpack.py
@@ -333,7 +333,7 @@ _mesa_unpack_rgba_row(mesa_format format, GLuint n,
       unpack_float_ycbcr_rev(src, dst, n);
       break;
    default:
-      _mesa_problem(NULL, "%s: bad format %s", __FUNCTION__,
+      _mesa_problem(NULL, "%s: bad format %s", __func__,
                     _mesa_get_format_name(format));
       return;
    }
@@ -402,7 +402,7 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
       break;
 %endfor
    default:
-      _mesa_problem(NULL, "%s: bad format %s", __FUNCTION__,
+      _mesa_problem(NULL, "%s: bad format %s", __func__,
                     _mesa_get_format_name(format));
       return;
    }
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 4e05229..8ced579 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1393,7 +1393,7 @@ _mesa_base_format_has_channel(GLenum base_format, GLenum pname)
       return GL_FALSE;
    default:
       _mesa_warning(NULL, "%s: Unexpected channel token 0x%x\n",
-		    __FUNCTION__, pname);
+		    __func__, pname);
       return GL_FALSE;
    }
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 8e1dba6..ab74489 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4523,7 +4523,7 @@ struct gl_context
 #ifdef DEBUG
 extern int MESA_VERBOSE;
 extern int MESA_DEBUG_FLAGS;
-# define MESA_FUNCTION __FUNCTION__
+# define MESA_FUNCTION __func__
 #else
 # define MESA_VERBOSE 0
 # define MESA_DEBUG_FLAGS 0
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index dadfb3c..ccf83d7 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -507,7 +507,7 @@ _mesa_set_varying_vp_inputs( struct gl_context *ctx,
           ctx->FragmentProgram._TexEnvProgram) {
          ctx->NewState |= _NEW_VARYING_VP_INPUTS;
       }
-      /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/
+      /*printf("%s %x\n", __func__, varying_inputs);*/
    }
 }
 
-- 
1.7.9.5



More information about the mesa-dev mailing list