mesa: rename, make _mesa_register_file_name() non-static
authorBrian Paul <brianp@vmware.com>
Tue, 23 Nov 2010 17:11:46 +0000 (10:11 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 23 Nov 2010 22:52:42 +0000 (15:52 -0700)
Plus remove unused parameter.

src/mesa/program/prog_print.c
src/mesa/program/prog_print.h

index 79c01020eb24dffb52538cfeb5dfdc874d112ed2..abebf392c0ad9cc573124a8937c614db4afb18f9 100644 (file)
@@ -42,8 +42,8 @@
 /**
  * Return string name for given program/register file.
  */
-static const char *
-file_string(gl_register_file f, gl_prog_print_mode mode)
+const char *
+_mesa_register_file_name(gl_register_file f)
 {
    switch (f) {
    case PROGRAM_TEMPORARY:
@@ -275,7 +275,8 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode,
 
    switch (mode) {
    case PROG_PRINT_DEBUG:
-      sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index);
+      sprintf(str, "%s[%s%d]",
+              _mesa_register_file_name(f), addr, index);
       if (hasIndex2) {
          int offset = strlen(str);
          const char *addr2 = relAddr2 ? "ADDR+" : "";
@@ -497,7 +498,7 @@ fprint_dst_reg(FILE * f,
 
 #if 0
    fprintf(f, "%s[%d]%s",
-          file_string((gl_register_file) dstReg->File, mode),
+          _mesa_register_file_name((gl_register_file) dstReg->File),
           dstReg->Index,
           _mesa_writemask_string(dstReg->WriteMask));
 #endif
@@ -522,7 +523,7 @@ fprint_src_reg(FILE *f,
           abs);
 #if 0
    fprintf(f, "%s[%d]%s",
-          file_string((gl_register_file) srcReg->File, mode),
+          _mesa_register_file_name((gl_register_file) srcReg->File),
           srcReg->Index,
           _mesa_swizzle_string(srcReg->Swizzle,
                                srcReg->Negate, GL_FALSE));
@@ -615,8 +616,7 @@ _mesa_fprint_instruction_opt(FILE *f,
       if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
          fprintf(f, ", ");
          fprintf(f, "%s[%d]%s",
-                file_string((gl_register_file) inst->SrcReg[0].File,
-                            mode),
+                 _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
                 inst->SrcReg[0].Index,
                 _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
                                      inst->SrcReg[0].Negate, GL_FALSE));
@@ -632,8 +632,7 @@ _mesa_fprint_instruction_opt(FILE *f,
       fprintf(f, " ");
       fprint_dst_reg(f, &inst->DstReg, mode, prog);
       fprintf(f, ", %s[%d], %s",
-             file_string((gl_register_file) inst->SrcReg[0].File,
-                         mode),
+             _mesa_register_file_name((gl_register_file) inst->SrcReg[0].File),
              inst->SrcReg[0].Index,
              _mesa_swizzle_string(inst->SrcReg[0].Swizzle,
                                   inst->SrcReg[0].Negate, GL_TRUE));
@@ -964,7 +963,6 @@ static void
 _mesa_fprint_parameter_list(FILE *f,
                             const struct gl_program_parameter_list *list)
 {
-   const gl_prog_print_mode mode = PROG_PRINT_DEBUG;
    GLuint i;
 
    if (!list)
@@ -978,7 +976,7 @@ _mesa_fprint_parameter_list(FILE *f,
       const GLfloat *v = list->ParameterValues[i];
       fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}",
              i, param->Size,
-             file_string(list->Parameters[i].Type, mode),
+             _mesa_register_file_name(list->Parameters[i].Type),
              param->Name, v[0], v[1], v[2], v[3]);
       if (param->Flags & PROG_PARAM_BIT_CENTROID)
          fprintf(f, " Centroid");
index f080b3fd2e6ab95db1201b48bf31b009e6155595..d962087db3869396adb8a334c9d9378a34afe18c 100644 (file)
@@ -47,6 +47,9 @@ typedef enum {
 } gl_prog_print_mode;
 
 
+extern const char *
+_mesa_register_file_name(gl_register_file f);
+
 extern void
 _mesa_print_vp_inputs(GLbitfield inputs);