[MPlayer-cvslog] r37084 - in trunk/gui: ui/render.c win32/widgetrender.c

ib subversion at mplayerhq.hu
Thu Mar 27 03:22:17 CET 2014


Author: ib
Date: Thu Mar 27 03:22:17 2014
New Revision: 37084

Log:
Use strlower() and strupper() in TranslateFilename().

This simplifies the code.

Modified:
   trunk/gui/ui/render.c
   trunk/gui/win32/widgetrender.c

Modified: trunk/gui/ui/render.c
==============================================================================
--- trunk/gui/ui/render.c	Thu Mar 27 03:18:16 2014	(r37083)
+++ trunk/gui/ui/render.c	Thu Mar 27 03:22:17 2014	(r37084)
@@ -120,21 +120,10 @@ static char *TranslateFilename(int how, 
         break;
     }
 
-    if (how) {
-        p = fname;
-
-        while (*p) {
-            char t = 0;
-
-            if (how == 1 && *p >= 'A' && *p <= 'Z')
-                t = 32;
-            if (how == 2 && *p >= 'a' && *p <= 'z')
-                t = -32;
-
-            *p = *p + t;
-            p++;
-        }
-    }
+    if (how == 1)
+        strlower(fname);
+    if (how == 2)
+        strupper(fname);
 
     return fname;
 }

Modified: trunk/gui/win32/widgetrender.c
==============================================================================
--- trunk/gui/win32/widgetrender.c	Thu Mar 27 03:18:16 2014	(r37083)
+++ trunk/gui/win32/widgetrender.c	Thu Mar 27 03:22:17 2014	(r37084)
@@ -198,21 +198,8 @@ char *TranslateFilename (int how, char *
             break;
     }
 
-    if (how)
-    {
-        p = fname;
-
-        while (*p)
-        {
-            char t = 0;
-
-            if (how == 1 && *p >= 'A' && *p <= 'Z') t = 32;
-            if (how == 2 && *p >= 'a' && *p <= 'z') t = -32;
-
-            *p = *p + t;
-            p++;
-        }
-    }
+    if (how == 1) strlower(fname);
+    if (how == 2) strupper(fname);
 
     return fname;
 }


More information about the MPlayer-cvslog mailing list