changeset 34685:311b47301ea7

Remove gstrcasecmp(). This function isn't necessary. strcasecmp() can be used just as well, because both arguments to the gstrcasecmp() calls have been checked to be not NULL prior to the call.
author ib
date Fri, 24 Feb 2012 17:26:35 +0000
parents b03481253518
children ff81a1db421e
files gui/ui/gtk/preferences.c gui/util/string.c gui/util/string.h
diffstat 3 files changed, 2 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/preferences.c	Fri Feb 24 17:16:54 2012 +0000
+++ b/gui/ui/gtk/preferences.c	Fri Feb 24 17:26:35 2012 +0000
@@ -319,7 +319,7 @@
   {
    int i;
    for ( i=0;lEncoding[i].name;i++ )
-    if ( !gstrcasecmp( sub_cp,lEncoding[i].name ) ) break;
+    if ( !strcasecmp( sub_cp,lEncoding[i].name ) ) break;
    if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment );
   }
 #endif
@@ -338,7 +338,7 @@
   {
    int i;
    for ( i=0;lEncoding[i].name;i++ )
-    if ( !gstrcasecmp( subtitle_font_encoding,lEncoding[i].name ) ) break;
+    if ( !strcasecmp( subtitle_font_encoding,lEncoding[i].name ) ) break;
    if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment );
   }
  switch ( subtitle_autoscale )
--- a/gui/util/string.c	Fri Feb 24 17:16:54 2012 +0000
+++ b/gui/util/string.c	Fri Feb 24 17:26:35 2012 +0000
@@ -163,16 +163,6 @@
     return strcmp(a, b);
 }
 
-int gstrcasecmp(const char *a, const char *b)
-{
-    if (!a && !b)
-        return 0;
-    if (!a || !b)
-        return -1;
-
-    return strcasecmp(a, b);
-}
-
 /**
  * @brief A strncmp() that can handle NULL pointers.
  *
--- a/gui/util/string.h	Fri Feb 24 17:16:54 2012 +0000
+++ b/gui/util/string.h	Fri Feb 24 17:26:35 2012 +0000
@@ -23,7 +23,6 @@
 
 char *decomment(char *in);
 char *fgetstr(char *str, int size, FILE *file);
-int gstrcasecmp(const char *a, const char *b);
 char *gstrchr(const char *str, int c);
 int gstrcmp(const char *a, const char *b);
 char *gstrdup(const char *str);