mirror of https://github.com/stella-emu/stella.git
comment to BSPF::matches() added
some compiler warnings fixed
This commit is contained in:
parent
d702829ed3
commit
20ff2163ca
|
@ -190,15 +190,17 @@ namespace BSPF
|
|||
return findIgnoreCase(s1, s2) != string::npos;
|
||||
}
|
||||
|
||||
inline bool matches(const string& command, const string& in)
|
||||
// Test whether the first string matches the second one (case insensitive)
|
||||
// - the first character must match
|
||||
// - the following characters must appear in the order of the first string
|
||||
inline bool matches(const string& s1, const string& s2)
|
||||
{
|
||||
if(BSPF::startsWithIgnoreCase(command, in.substr(0, 1)))
|
||||
if(BSPF::startsWithIgnoreCase(s1, s2.substr(0, 1)))
|
||||
{
|
||||
size_t pos = 1;
|
||||
|
||||
for(int j = 1; j < in.size(); j++)
|
||||
for(uInt32 j = 1; j < s2.size(); j++)
|
||||
{
|
||||
int found = BSPF::findIgnoreCase(command, in.substr(j, 1), pos);
|
||||
size_t found = BSPF::findIgnoreCase(s1, s2.substr(j, 1), pos);
|
||||
if(found == string::npos)
|
||||
return false;
|
||||
pos += found + 1;
|
||||
|
|
|
@ -914,7 +914,7 @@ bool PromptWidget::saveBuffer(const FilesystemNode& file)
|
|||
string PromptWidget::getCompletionPrefix(const StringList& completions)
|
||||
{
|
||||
// Find the largest match at the beginning of the completions provided
|
||||
for(int len = 1;; len++)
|
||||
for(uInt32 len = 1;; len++)
|
||||
{
|
||||
for(const auto& s1 : completions)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue