Skip to content

Commit

Permalink
Fixed warnings on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Feb 1, 2018
1 parent 32a5952 commit 2ab07e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions inireader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace infra {

/* Typedef for prototype of handler function. */
typedef int (*ini_handler)(void* user, const char* section,
const char* name, const char* value);
const char* name, const char* value);

/* Typedef for prototype of fgets-style reader function. */
typedef char* (*ini_reader)(char* str, int num, void* stream);
Expand Down Expand Up @@ -105,7 +105,7 @@ inline static char* strncpy0(char* dest, const char* src, size_t size)
/* Same as ini_parse(), but takes an ini_reader function pointer instead of
filename. Used for implementing custom or string-based I/O. */
inline int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
void* user)
void* user)
{
/* Uses a fair bit of stack (use heap instead if you need to) */
#if INI_USE_STACK
Expand Down Expand Up @@ -317,9 +317,8 @@ std::optional<bool> IniReader::getBool(std::string_view section, std::string_vie

auto valueStr = getString(section, name);
if (valueStr) {
std::string lower(*valueStr);
// Convert to lower case to make string comparisons case-insensitive
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
std::string lower = str::lowercase(*valueStr);
if (lower == "true" || lower == "yes" || lower == "on" || lower == "1") {
result = true;
} else if (lower == "false" || lower == "no" || lower == "off" || lower == "0") {
Expand Down
4 changes: 2 additions & 2 deletions ui/checkcombobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ QStringList CheckComboBox::checkedItems() const
if (model()) {
QModelIndex index = model()->index(0, modelColumn(), rootModelIndex());
QModelIndexList indexes = model()->match(index, Qt::CheckStateRole, Qt::Checked, -1, Qt::MatchExactly);
foreach (const QModelIndex& index, indexes) {
items += index.data().toString();
foreach (const QModelIndex& modelIndex, indexes) {
items += modelIndex.data().toString();
}
}
return items;
Expand Down

0 comments on commit 2ab07e9

Please sign in to comment.