[MPlayer-cvslog] r37788 - trunk/gui/dialog/menu.c

ib subversion at mplayerhq.hu
Sun Feb 21 14:39:21 CET 2016


Author: ib
Date: Sun Feb 21 14:39:21 2016
New Revision: 37788

Log:
Optimize GUI language table.

Store fixed size entry directly
instead of via pointer.

Modified:
   trunk/gui/dialog/menu.c

Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c	Sun Feb 21 13:32:19 2016	(r37787)
+++ trunk/gui/dialog/menu.c	Sun Feb 21 14:39:21 2016	(r37788)
@@ -230,7 +230,7 @@ GtkWidget * AddSeparator( GtkWidget * Me
 typedef struct
 {
  int id;
- const char * id2;
+ const char id2[3];
  const char * name;
 } Languages_t;
 
@@ -438,7 +438,7 @@ static const char * GetLanguage( void *l
     else if ( p[3] != 0) return language;
   }
  for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
-  if ( type == GET_LANG_INT ? Languages[i].id == l : strcasecmp(Languages[i].id2, p) == 0 ) return Languages[i].name;
+  if ( type == GET_LANG_INT ? Languages[i].id == l : strncasecmp(Languages[i].id2, p, sizeof(Languages[i].id2)) == 0 ) return Languages[i].name;
  return MSGTR_GUI_Unknown;
 }
 #undef lng


More information about the MPlayer-cvslog mailing list