[MPlayer-cvslog] r37887 - in trunk/gui: app/app.c dialog/fileselect.c skin/font.c skin/skin.c

ib subversion at mplayerhq.hu
Thu Aug 25 14:17:42 EEST 2016


Author: ib
Date: Thu Aug 25 14:17:42 2016
New Revision: 37887

Log:
Check return value of strcmp() more recognizably.

It may be a personal preference, but the !strcmp() notation
somehow doesn't go well with the function's name.

Modified:
   trunk/gui/app/app.c
   trunk/gui/dialog/fileselect.c
   trunk/gui/skin/font.c
   trunk/gui/skin/skin.c

Modified: trunk/gui/app/app.c
==============================================================================
--- trunk/gui/app/app.c	Thu Aug 25 14:14:59 2016	(r37886)
+++ trunk/gui/app/app.c	Thu Aug 25 14:17:42 2016	(r37887)
@@ -150,7 +150,7 @@ int appFindMessage(const char *name)
     unsigned int i;
 
     for (i = 0; i < FF_ARRAY_ELEMS(evNames); i++)
-        if (!strcmp(evNames[i].name, name))
+        if (strcmp(evNames[i].name, name) == 0)
             return evNames[i].message;
 
     return -1;

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Thu Aug 25 14:14:59 2016	(r37886)
+++ trunk/gui/dialog/fileselect.c	Thu Aug 25 14:17:42 2016	(r37887)
@@ -320,7 +320,7 @@ static void fs_fsFilterCombo_changed(Gtk
     case FILESELECT_VIDEO_AUDIO:
 
         for (i = 0; fsVideoAudioFilterNames[i][0]; i++)
-            if (!strcmp(str, fsVideoAudioFilterNames[i][0])) {
+            if (strcmp(str, fsVideoAudioFilterNames[i][0]) == 0) {
                 fsFilter = fsVideoAudioFilterNames[i][1];
                 fsLastVideoAudioFilterSelected = i;
                 break;
@@ -331,7 +331,7 @@ static void fs_fsFilterCombo_changed(Gtk
     case FILESELECT_SUBTITLE:
 
         for (i = 0; fsSubtitleFilterNames[i][0]; i++)
-            if (!strcmp(str, fsSubtitleFilterNames[i][0])) {
+            if (strcmp(str, fsSubtitleFilterNames[i][0]) == 0) {
                 fsFilter = fsSubtitleFilterNames[i][1];
                 fsLastSubtitleFilterSelected = i;
                 break;
@@ -342,7 +342,7 @@ static void fs_fsFilterCombo_changed(Gtk
     case FILESELECT_AUDIO:
 
         for (i = 0; fsAudioFileNames[i][0]; i++)
-            if (!strcmp(str, fsAudioFileNames[i][0])) {
+            if (strcmp(str, fsAudioFileNames[i][0]) == 0) {
                 fsFilter = fsAudioFileNames[i][1];
                 fsLastAudioFilterSelected = i;
                 break;
@@ -353,7 +353,7 @@ static void fs_fsFilterCombo_changed(Gtk
     case FILESELECT_FONT:
 
         for (i = 0; fsFontFileNames[i][0]; i++)
-            if (!strcmp(str, fsFontFileNames[i][0])) {
+            if (strcmp(str, fsFontFileNames[i][0]) == 0) {
                 fsFilter = fsFontFileNames[i][1];
                 fsLastFontFilterSelected = i;
                 break;
@@ -364,7 +364,7 @@ static void fs_fsFilterCombo_changed(Gtk
     case FILESELECT_IMAGE:
 
         for (i = 0; fsImageFilterNames[i][0]; i++)
-            if (!strcmp(str, fsImageFilterNames[i][0])) {
+            if (strcmp(str, fsImageFilterNames[i][0]) == 0) {
                 fsFilter = fsImageFilterNames[i][1];
                 fsLastImageFilterSelected = i;
                 break;

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Thu Aug 25 14:14:59 2016	(r37886)
+++ trunk/gui/skin/font.c	Thu Aug 25 14:17:42 2016	(r37887)
@@ -173,7 +173,7 @@ int fntRead(char *path, char *fname)
             Fonts[id]->Chr[i].h = atoi(buf);
 
             mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[font]  char: '%s' params: %d,%d %dx%d\n", item, Fonts[id]->Chr[i].x, Fonts[id]->Chr[i].y, Fonts[id]->Chr[i].w, Fonts[id]->Chr[i].h);
-        } else if (!strcmp(item, "image")) {
+        } else if (strcmp(item, "image") == 0) {
             av_strlcpy(buf, path, sizeof(buf));
             av_strlcat(buf, param, sizeof(buf));
 
@@ -206,7 +206,7 @@ int fntFindID(char *name)
 
     for (i = 0; i < MAX_FONTS; i++)
         if (Fonts[i])
-            if (!strcmp(name, Fonts[i]->name))
+            if (strcmp(name, Fonts[i]->name) == 0)
                 return i;
 
     return -1;

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Thu Aug 25 14:14:59 2016	(r37886)
+++ trunk/gui/skin/skin.c	Thu Aug 25 14:17:42 2016	(r37887)
@@ -188,7 +188,7 @@ static int item_section(char *in)
         return 1;
     }
 
-    if (!strcmp(strlower(in), "movieplayer"))
+    if (strcmp(strlower(in), "movieplayer") == 0)
         skin = &guiApp;
     else {
         skin_error(MSGTR_GUI_MSG_SkinUnknownName, in);
@@ -1235,7 +1235,7 @@ int skinRead(char *sname)
         strlower(currItem);
 
         for (i = 0; i < FF_ARRAY_ELEMS(skinItem); i++) {
-            if (!strcmp(currItem, skinItem[i].name)) {
+            if (strcmp(currItem, skinItem[i].name) == 0) {
                 if (skinItem[i].func(param) != 0) {
                     fclose(skinfile);
                     return -2;


More information about the MPlayer-cvslog mailing list