Re: diffs to port code to gcc 6

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: diffs to port code to gcc 6

Rik-4
Mike,

One question about this diff:

diff --git a/src/ov-class.cc b/src/ov-class.cc
--- a/src/ov-class.cc
+++ b/src/ov-class.cc
@@ -1195,7 +1195,7 @@
       bool b = save_ascii_data (os, val, m.key (i), false, 0);
 
       if (! b)
-        return os;
+        return ! os.fail ();
 
       i++;
     }
@@ -1326,7 +1326,7 @@
       bool b = save_binary_data (os, val, m.key (i), "", 0, save_as_floats);
 
       if (! b)
-        return os;
+        return !!os;
 
       i++;
     }

In all other cases throughout the diff file, "return os;" has been
translated to "return ! os.fail ();".  Is there a reason this single
instance is "return !!os;"?

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: diffs to port code to gcc 6

Mike Miller-4
On Mon, Aug 12, 2019 at 16:32:32 -0700, Rik wrote:

> Mike,
>
> One question about this diff:
>
> diff --git a/src/ov-class.cc b/src/ov-class.cc
> --- a/src/ov-class.cc
> +++ b/src/ov-class.cc
> @@ -1195,7 +1195,7 @@
>        bool b = save_ascii_data (os, val, m.key (i), false, 0);
>  
>        if (! b)
> -        return os;
> +        return ! os.fail ();
>  
>        i++;
>      }
> @@ -1326,7 +1326,7 @@
>        bool b = save_binary_data (os, val, m.key (i), "", 0, save_as_floats);
>  
>        if (! b)
> -        return os;
> +        return !!os;
>  
>        i++;
>      }
>
> In all other cases throughout the diff file, "return os;" has been
> translated to "return ! os.fail ();".  Is there a reason this single
> instance is "return !!os;"?
Probably not. It's been years since I created these patches, so I don't
remember. Maybe I made `!!os` as an individual change, and then used sed
to replace all the other instances. They look equivalent to me.

--
mike

signature.asc (849 bytes) Download Attachment