[libdvdnav-devel] [PATCH] libdvdnav: vm/vm.c - remove extra parentheses

Steve Dibb beandog at gentoo.org
Sat Apr 26 21:36:02 CEST 2014


Fixes compiler warnings:

src/vm/vm.c:183:17: warning: equality comparison with extraneous 
parentheses [-Wparentheses-equality]
     if((data[i] == 0)) break;
         ~~~~~~~~^~~~
src/vm/vm.c:183:17: note: remove extraneous parentheses around the 
comparison to silence this warning
     if((data[i] == 0)) break;
        ~        ^   ~
src/vm/vm.c:183:17: note: use '=' to turn this equality comparison into 
an assignment
     if((data[i] == 0)) break;
                 ^~
                 =
src/vm/vm.c:194:17: warning: equality comparison with extraneous 
parentheses [-Wparentheses-equality]
     if((data[i] == 0)) break;
         ~~~~~~~~^~~~
src/vm/vm.c:194:17: note: remove extraneous parentheses around the 
comparison to silence this warning
     if((data[i] == 0)) break;
        ~        ^   ~
src/vm/vm.c:194:17: note: use '=' to turn this equality comparison into 
an assignment
     if((data[i] == 0)) break;
                 ^~
                 =
src/vm/vm.c:205:17: warning: equality comparison with extraneous 
parentheses [-Wparentheses-equality]
     if((data[i] == 0)) break;
         ~~~~~~~~^~~~
src/vm/vm.c:205:17: note: remove extraneous parentheses around the 
comparison to silence this warning
     if((data[i] == 0)) break;
        ~        ^   ~
src/vm/vm.c:205:17: note: use '=' to turn this equality comparison into 
an assignment
     if((data[i] == 0)) break;
                 ^~
                 =

Patch:

diff --git a/src/vm/vm.c b/src/vm/vm.c
index 0de93e3..14497f5 100644
--- a/src/vm/vm.c
+++ b/src/vm/vm.c
@@ -180,7 +180,7 @@ static int dvd_read_name(char *name, char *serial, 
const char *device) {

    fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
    for(i=25; i < 73; i++ ) {
-    if((data[i] == 0)) break;
+    if(data[i] == 0) break;
      if((data[i] > 32) && (data[i] < 127)) {
        fprintf(MSG_OUT, "%c", data[i]);
      } else {
@@ -191,7 +191,7 @@ static int dvd_read_name(char *name, char *serial, 
const char *device) {
    name[48] = 0;
    fprintf(MSG_OUT, "\nlibdvdnav: DVD Serial Number: ");
    for(i=73; i < 89; i++ ) {
-    if((data[i] == 0)) break;
+    if(data[i] == 0) break;
      if((data[i] > 32) && (data[i] < 127)) {
        fprintf(MSG_OUT, "%c", data[i]);
      } else {
@@ -202,7 +202,7 @@ static int dvd_read_name(char *name, char *serial, 
const char *device) {
    serial[14] = 0;
    fprintf(MSG_OUT, "\nlibdvdnav: DVD Title (Alternative): ");
    for(i=89; i < 128; i++ ) {
-    if((data[i] == 0)) break;
+    if(data[i] == 0) break;
      if((data[i] > 32) && (data[i] < 127)) {
        fprintf(MSG_OUT, "%c", data[i]);
      } else {


More information about the libdvdnav-devel mailing list