[MPlayer-cvslog] r21815 - trunk/libmenu/menu.c

gpoirier subversion at mplayerhq.hu
Thu Jan 4 17:00:27 CET 2007


Author: gpoirier
Date: Thu Jan  4 17:00:27 2007
New Revision: 21815

Modified:
   trunk/libmenu/menu.c

Log:
fix gprof support (aka work around gprof's brain dead design)
as stated here: http://sourceware.org/binutils/docs-2.17/gprof/Implementation.html
mcount() is a symbol reserved by gprof to perform instrumentation, so we shouldn't declare a symbol that has this name
Fixes issue discussed here:
date: Jan 3, 2007 3:17 PM
subject: [MPlayer-advusers] gcc, mplayer and profile (mcount)


Modified: trunk/libmenu/menu.c
==============================================================================
--- trunk/libmenu/menu.c	(original)
+++ trunk/libmenu/menu.c	Thu Jan  4 17:00:27 2007
@@ -53,7 +53,7 @@
 } menu_def_t;
 
 static menu_def_t* menu_list = NULL;
-static int mcount = 0;
+static int menu_count = 0;
 
 
 static int menu_parse_config(char* buffer) {
@@ -91,20 +91,20 @@
     }
     // Got it : add this to our list
     if(minfo) {
-      menu_list = realloc(menu_list,(mcount+2)*sizeof(menu_def_t));
-      menu_list[mcount].name = name;
-      menu_list[mcount].type = minfo;
-      menu_list[mcount].cfg = m_struct_alloc(&minfo->priv_st);
-      menu_list[mcount].args = body;
+      menu_list = realloc(menu_list,(menu_count+2)*sizeof(menu_def_t));
+      menu_list[menu_count].name = name;
+      menu_list[menu_count].type = minfo;
+      menu_list[menu_count].cfg = m_struct_alloc(&minfo->priv_st);
+      menu_list[menu_count].args = body;
       // Setup the attribs
       for(i = 0 ; attribs[2*i] ; i++) {
 	if(strcasecmp(attribs[2*i],"name") == 0) continue;
-	if(!m_struct_set(&minfo->priv_st,menu_list[mcount].cfg,attribs[2*i], attribs[2*i+1]))
+	if(!m_struct_set(&minfo->priv_st,menu_list[menu_count].cfg,attribs[2*i], attribs[2*i+1]))
 	  mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_BadAttrib,attribs[2*i],attribs[2*i+1],
 		 name,parser->line);
       }
-      mcount++;
-      memset(&menu_list[mcount],0,sizeof(menu_def_t));
+      menu_count++;
+      memset(&menu_list[menu_count],0,sizeof(menu_def_t));
     } else {
       mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuType,element,parser->line);
       free(name);
@@ -174,7 +174,7 @@
     if(menu_list[i].args) free(menu_list[i].args);
   }
   free(menu_list);
-  mcount = 0;
+  menu_count = 0;
 }
 
 /// Default read_key function



More information about the MPlayer-cvslog mailing list