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

Marius Predut marius.predut at intel.com
Fri Apr 3 06:11:57 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/tnl_dd/t_dd_dmatmp.h   |   34 +++++++++++++++++-----------------
 src/mesa/tnl_dd/t_dd_dmatmp2.h  |   22 +++++++++++-----------
 src/mesa/tnl_dd/t_dd_triemit.h  |    8 ++++----
 src/mesa/tnl_dd/t_dd_tritmp.h   |    2 +-
 src/mesa/tnl_dd/t_dd_unfilled.h |    2 +-
 5 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 52ea2bf..667e2a6 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -128,7 +128,7 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
       }
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -163,7 +163,7 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
       }
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -195,7 +195,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
       FLUSH();
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -261,7 +261,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
       FLUSH();
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -331,7 +331,7 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx,
       FLUSH();
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -370,7 +370,7 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
       /* Could write code to emit these as indexed vertices (for the
        * g400, for instance).
        */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -409,7 +409,7 @@ static void TAG(render_poly_verts)( struct gl_context *ctx,
    else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) {
       TAG(render_tri_fan_verts)( ctx, start, count, flags );
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -500,7 +500,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
 	 /* Vertices won't fit in a single buffer or elts not
 	  * available - should never happen.
 	  */
-	 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+        fprintf(stderr, "%s - cannot draw primitive\n", __func__);
 	 return;
       }
    }
@@ -534,7 +534,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
       FLUSH();
 
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -644,7 +644,7 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
    else {
       /* Vertices won't fit in a single buffer, should never happen.
        */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -705,7 +705,7 @@ static void TAG(render_points_elts)( struct gl_context *ctx,
 	 currentsz = dmasz;
       }
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -743,7 +743,7 @@ static void TAG(render_lines_elts)( struct gl_context *ctx,
 	 currentsz = dmasz;
       }
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -777,7 +777,7 @@ static void TAG(render_line_strip_elts)( struct gl_context *ctx,
    } else {
       /* TODO: Try to emit as indexed lines.
        */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -845,7 +845,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
       FLUSH();
    } else {
       /* TODO: Try to emit as indexed lines */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -922,7 +922,7 @@ static void TAG(render_tri_strip_elts)( struct gl_context *ctx,
       }
    } else {
       /* TODO: try to emit as indexed triangles */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -959,7 +959,7 @@ static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
       }
    } else {
       /* TODO: try to emit as indexed triangles */
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
@@ -998,7 +998,7 @@ static void TAG(render_poly_elts)( struct gl_context *ctx,
    } else if (HAVE_TRI_FANS && ctx->Light.ShadeModel == GL_SMOOTH) {
       TAG(render_tri_fan_verts)( ctx, start, count, flags );
    } else {
-      fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+      fprintf(stderr, "%s - cannot draw primitive\n", __func__);
       return;
    }
 }
diff --git a/src/mesa/tnl_dd/t_dd_dmatmp2.h b/src/mesa/tnl_dd/t_dd_dmatmp2.h
index 7c6f136..96c5b47 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp2.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp2.h
@@ -121,7 +121,7 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
 {
    if (start < count) {
       LOCAL_VARS;
-      if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+      if (0) fprintf(stderr, "%s\n", __func__);
       EMIT_PRIM( ctx, GL_POINTS, HW_POINTS, start, count );
    }
 }
@@ -132,7 +132,7 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
 				     GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
    count -= (count-start) & 1;
 
    if (start+1 >= count)
@@ -156,7 +156,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
 					  GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (start+1 >= count)
       return;
@@ -204,7 +204,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
 {
    LOCAL_VARS;
    GLuint j, nr;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (flags & PRIM_BEGIN) {
       j = start;
@@ -292,7 +292,7 @@ static void TAG(render_triangles_verts)( struct gl_context *ctx,
 					 GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    count -= (count-start)%3;
 
@@ -313,7 +313,7 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx,
 					 GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (start + 2 >= count)
       return;
@@ -358,7 +358,7 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
 				       GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (start+2 >= count) 
       return;
@@ -401,7 +401,7 @@ static void TAG(render_poly_verts)( struct gl_context *ctx,
 				    GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (start+2 >= count) 
       return;
@@ -415,7 +415,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
 					  GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    count -= (count-start) & 1;
 
@@ -466,7 +466,7 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
 				     GLuint flags )
 {
    LOCAL_VARS;
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
    count -= (count-start)%4;
 
    if (start+3 >= count) 
@@ -642,7 +642,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
    GLuint j, nr;
    ELT_TYPE *dest;
 
-   if (0) fprintf(stderr, "%s\n", __FUNCTION__);
+   if (0) fprintf(stderr, "%s\n", __func__);
 
    if (flags & PRIM_BEGIN)
       j = start;
diff --git a/src/mesa/tnl_dd/t_dd_triemit.h b/src/mesa/tnl_dd/t_dd_triemit.h
index 082e83f..093501f 100644
--- a/src/mesa/tnl_dd/t_dd_triemit.h
+++ b/src/mesa/tnl_dd/t_dd_triemit.h
@@ -39,7 +39,7 @@ static __inline void TAG(quad)( CTX_ARG,
    GLuint j;
 
    if (DO_DEBUG_VERTS) {
-      fprintf(stderr, "%s\n", __FUNCTION__);
+      fprintf(stderr, "%s\n", __func__);
       PRINT_VERTEX(v0);
       PRINT_VERTEX(v1);
       PRINT_VERTEX(v2);
@@ -63,7 +63,7 @@ static __inline void TAG(quad)( CTX_ARG,
    GLuint j;
 
    if (DO_DEBUG_VERTS) {
-      fprintf(stderr, "%s\n", __FUNCTION__);
+      fprintf(stderr, "%s\n", __func__);
       PRINT_VERTEX(v0);
       PRINT_VERTEX(v1);
       PRINT_VERTEX(v2);
@@ -90,7 +90,7 @@ static __inline void TAG(triangle)( CTX_ARG,
    GLuint j;
 
    if (DO_DEBUG_VERTS) {
-      fprintf(stderr, "%s\n", __FUNCTION__);
+      fprintf(stderr, "%s\n", __func__);
       PRINT_VERTEX(v0);
       PRINT_VERTEX(v1);
       PRINT_VERTEX(v2);
@@ -139,7 +139,7 @@ static void TAG(fast_clipped_poly)( struct gl_context *ctx, const GLuint *elts,
    GLuint i,j;
 
    if (DO_DEBUG_VERTS) {
-      fprintf(stderr, "%s\n", __FUNCTION__);
+      fprintf(stderr, "%s\n", __func__);
       PRINT_VERTEX(VERT(elts[0]));
       PRINT_VERTEX(VERT(elts[1]));
    }
diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h
index 6fe2c82..2176f1f 100644
--- a/src/mesa/tnl_dd/t_dd_tritmp.h
+++ b/src/mesa/tnl_dd/t_dd_tritmp.h
@@ -121,7 +121,7 @@ static void TAG(triangle)( struct gl_context *ctx, GLuint e0, GLuint e1, GLuint
    GLuint facing = 0;
    LOCAL_VARS(3);
 
-/*     fprintf(stderr, "%s\n", __FUNCTION__); */
+/*     fprintf(stderr, "%s\n", __func__); */
 
    v[0] = (VERTEX *)GET_VERTEX(e0);
    v[1] = (VERTEX *)GET_VERTEX(e1);
diff --git a/src/mesa/tnl_dd/t_dd_unfilled.h b/src/mesa/tnl_dd/t_dd_unfilled.h
index 6be0e7f..82190c0 100644
--- a/src/mesa/tnl_dd/t_dd_unfilled.h
+++ b/src/mesa/tnl_dd/t_dd_unfilled.h
@@ -59,7 +59,7 @@ static void TAG(unfilled_tri)( struct gl_context *ctx,
       }
    }
 
-/*     fprintf(stderr, "%s %s %d %d %d\n", __FUNCTION__, */
+/*     fprintf(stderr, "%s %s %d %d %d\n", __func__, */
 /*  	   _mesa_lookup_enum_by_nr( mode ), */
 /*  	   ef[e0], ef[e1], ef[e2]); */
 
-- 
1.7.9.5



More information about the mesa-dev mailing list