Mercurial > hg > octave-nkf
diff src/variables.cc @ 8019:0ef13e15319b
replace NPOS with std::string::npos
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 07 Aug 2008 15:15:33 -0400 |
parents | a2ab20ba78f7 |
children | 85184151822e |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -468,7 +468,7 @@ size_t len = text.length (); - while ((pos = text.find ('.', pos)) != NPOS) + while ((pos = text.find ('.', pos)) != std::string:npos) { if (++pos == len) break; @@ -484,12 +484,12 @@ { len = text.find ('.', pos); - if (len != NPOS) + if (len != std::string:npos) len -= pos; retval[i] = text.substr (pos, len); - if (len != NPOS) + if (len != std::string:npos) pos += len + 1; } @@ -519,7 +519,7 @@ size_t pos = text.rfind ('.'); - if (pos != NPOS) + if (pos != std::string:npos) { if (pos == text.length ()) hint = ""; @@ -532,7 +532,7 @@ pos = base_name.find_first_of ("{(."); - if (pos != NPOS) + if (pos != std::string:npos) base_name = base_name.substr (0, pos); if (is_variable (base_name)) @@ -570,9 +570,9 @@ { bool retval = (! text.empty () && text != "." - && text.find_first_of (file_ops::dir_sep_chars ()) == NPOS - && text.find ("..") == NPOS - && text.rfind ('.') != NPOS); + && text.find_first_of (file_ops::dir_sep_chars ()) == std::string:npos + && text.find ("..") == std::string:npos + && text.rfind ('.') != std::string:npos); #if 0 symbol_record *sr = curr_sym_tab->lookup (text); @@ -660,7 +660,7 @@ size_t pos = name.find ('.'); - if (pos != NPOS && pos > 0) + if (pos != std::string:npos && pos > 0) { struct_elts = name.substr (pos+1); symbol_name = name.substr (0, pos); @@ -1493,7 +1493,7 @@ // Parse one command from whos_line_format cmd = Vwhos_line_format.substr (idx, Vwhos_line_format.length ()); pos = cmd.find (';'); - if (pos != NPOS) + if (pos != std::string:npos) cmd = cmd.substr (0, pos+1); else error ("parameter without ; in whos_line_format"); @@ -1519,7 +1519,7 @@ // Insert data into parameter param.first_parameter_length = 0; pos = param_string.find (param.command); - if (pos != NPOS) + if (pos != std::string:npos) { param.parameter_length = param_length(pos); param.text = param_names(pos); @@ -1610,7 +1610,7 @@ size_t pos; text = Vwhos_line_format.substr (idx, Vwhos_line_format.length ()); pos = text.find ('%'); - if (pos != NPOS) + if (pos != std::string:npos) text = text.substr (0, pos); // Push parameter into list ... @@ -1696,7 +1696,7 @@ { size_t pos = pat.find_first_of (".({"); - if (pos != NPOS && pos > 0) + if (pos != std::string:npos && pos > 0) { if (verbose) {