I'm not sure what the type of name_attr.value() is, so I can't say for sure.

But the only thing that changed is that we removed 'operator int()' that lets 
you do an implicit cast to bool to test if the string contained anything. The 
right way to do that is by testing !u.empty(). Nothing else changed for 
ustring, so I wouldn't expect any other changes needed.

This int cast was well-intentioned but led to subtle bugs. Since removing it, 
we have found bugs in both OSL and USD that were due to this -- cases where the 
code compiled fine, but were wrong. We only found the locations of those bugs 
because those lines didn't compile at all once we removed the 'operator int()', 
and then upon looking at those spots realized that the code there could never 
have worked properly, since the intended use of the code was not to test 
emptiness and it was incorrectly matching the method signature. 


> On Dec 10, 2018, at 12:53 PM, Richard Shaw <[email protected]> wrote:
> 
> Or is it further up where I need to apply the fix?
> 
>         if(name_attr) {
>                 node->name = ustring(name_attr.value());
>         }
> 
> Thanks,
> Richard
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]




_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to