summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-21 11:54:18 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-21 11:54:18 +0200
commita291e77b2cfc4ce1b780db0d8fa664fb8094d365 (patch)
tree88f0085d143b3e93862482de364559aa9946b1e6 /src/lib
parent5bdb4f7a8974c550608c83b8872e89259211496e (diff)
some bool <-> int not needed conversions, also cleaned drivenum.* was using memset for clearing vector (nw)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/flac.cpp2
-rw-r--r--src/lib/util/options.h2
-rw-r--r--src/lib/util/unzip.cpp18
-rw-r--r--src/lib/util/vecstream.h4
4 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp
index 085eaacffef..46d349c3452 100644
--- a/src/lib/util/flac.cpp
+++ b/src/lib/util/flac.cpp
@@ -355,7 +355,7 @@ bool flac_decoder::reset()
&flac_decoder::metadata_callback_static,
&flac_decoder::error_callback_static, this) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
return false;
- return FLAC__stream_decoder_process_until_end_of_metadata(m_decoder);
+ return FLAC__stream_decoder_process_until_end_of_metadata(m_decoder)!=0;
}
diff --git a/src/lib/util/options.h b/src/lib/util/options.h
index b669000e59f..d25a29ef1db 100644
--- a/src/lib/util/options.h
+++ b/src/lib/util/options.h
@@ -86,7 +86,7 @@ public:
UINT32 flags() const { return m_flags; }
bool is_header() const { return type() == OPTION_HEADER; }
bool is_command() const { return type() == OPTION_COMMAND; }
- bool is_internal() const { return m_flags & OPTION_FLAG_INTERNAL; }
+ bool is_internal() const { return (m_flags & OPTION_FLAG_INTERNAL)!=0; }
bool has_range() const { return (!m_minimum.empty() && !m_maximum.empty()); }
int priority() const { return m_priority; }
bool is_changed() const { return m_changed; }
diff --git a/src/lib/util/unzip.cpp b/src/lib/util/unzip.cpp
index fe6ec9cb975..a65bda9a99c 100644
--- a/src/lib/util/unzip.cpp
+++ b/src/lib/util/unzip.cpp
@@ -620,16 +620,16 @@ class general_flag_reader
public:
general_flag_reader(std::uint16_t val) : m_value(val) { }
- bool encrypted() const { return bool(m_value & 0x0001); }
- bool implode_8k_dict() const { return bool(m_value & 0x0002); }
- bool implode_3_trees() const { return bool(m_value & 0x0004); }
+ bool encrypted() const { return (m_value & 0x0001) !=0; }
+ bool implode_8k_dict() const { return (m_value & 0x0002) != 0; }
+ bool implode_3_trees() const { return (m_value & 0x0004) != 0; }
unsigned deflate_option() const { return unsigned((m_value >> 1) & 0x0003); }
- bool lzma_eos_mark() const { return bool(m_value & 0x0002); }
- bool use_descriptor() const { return bool(m_value & 0x0008); }
- bool patch_data() const { return bool(m_value & 0x0020); }
- bool strong_encryption() const { return bool(m_value & 0x0040); }
- bool utf8_encoding() const { return bool(m_value & 0x0800); }
- bool directory_encryption() const { return bool(m_value & 0x2000); }
+ bool lzma_eos_mark() const { return (m_value & 0x0002) != 0; }
+ bool use_descriptor() const { return (m_value & 0x0008) != 0; }
+ bool patch_data() const { return (m_value & 0x0020) != 0; }
+ bool strong_encryption() const { return (m_value & 0x0040) != 0; }
+ bool utf8_encoding() const { return (m_value & 0x0800) != 0; }
+ bool directory_encryption() const { return (m_value & 0x2000) != 0; }
private:
std::uint16_t m_value;
diff --git a/src/lib/util/vecstream.h b/src/lib/util/vecstream.h
index 1af7dd0cd86..faf8b73c669 100644
--- a/src/lib/util/vecstream.h
+++ b/src/lib/util/vecstream.h
@@ -148,8 +148,8 @@ public:
protected:
virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) override
{
- bool const in(which & std::ios_base::in);
- bool const out(which & std::ios_base::out);
+ bool const in((which & std::ios_base::in)!=0);
+ bool const out((which & std::ios_base::out)!=0);
if ((!in && !out) ||
(in && out && (std::ios_base::cur == dir)) ||
(in && !(m_mode & std::ios_base::in)) ||