Mercurial > octave
diff libinterp/corefcn/sysdep.cc @ 27741:b5e88a4bce43
Stop compilation warning regarding signed/unsigned comparison in MXE Octave (bug #52720)
* sysdep.cc (drive_or_unc_share): Change std::string::find() comparisons from
-1 for failure to std::string::npos.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 23 Nov 2019 07:47:54 -0800 |
parents | f90564fb99e0 |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/libinterp/corefcn/sysdep.cc Sat Nov 23 14:43:02 2019 +0100 +++ b/libinterp/corefcn/sysdep.cc Sat Nov 23 07:47:54 2019 -0800 @@ -353,11 +353,12 @@ { // It starts with two slashes. Find the next slash. size_t next_slash = name.find ("\\", 3); - if (next_slash != -1 && len > next_slash+1) + if (next_slash != std::string::npos && len > next_slash+1) { // Check if it ends with the share size_t last_slash = name.find ("\\", next_slash+1); - if (last_slash == -1 || (len > next_slash+2 && last_slash == len-1)) + if (last_slash == std::string::npos + || (len > next_slash+2 && last_slash == len-1)) candidate = true; } }