diff options
author | lloyd <[email protected]> | 2009-12-23 01:09:09 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-23 01:09:09 +0000 |
commit | e4bc193fd6232da46a3676f1e21e7a14bf5b1a6f (patch) | |
tree | d4640ca3c55e092ff4e743bc51ff9fd7fccd83d6 /src | |
parent | d7a893e9506e739d261a75d99743d0dc75803a79 (diff) |
Avoid MSVC warning 4800 about implicit conversion from T to bool. Mostly
because it makes the code slightly more explicit.
Diffstat (limited to 'src')
-rw-r--r-- | src/cert/x509/pkcs10.cpp | 2 | ||||
-rw-r--r-- | src/constructs/tss/tss.h | 2 | ||||
-rw-r--r-- | src/libstate/lookup.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/cert/x509/pkcs10.cpp b/src/cert/x509/pkcs10.cpp index 5617cece4..81bb58555 100644 --- a/src/cert/x509/pkcs10.cpp +++ b/src/cert/x509/pkcs10.cpp @@ -186,7 +186,7 @@ std::vector<OID> PKCS10_Request::ex_constraints() const */ bool PKCS10_Request::is_CA() const { - return info.get1_u32bit("X509v3.BasicConstraints.is_ca"); + return (info.get1_u32bit("X509v3.BasicConstraints.is_ca") > 0); } /* diff --git a/src/constructs/tss/tss.h b/src/constructs/tss/tss.h index 45d64d9cb..c8b0242d8 100644 --- a/src/constructs/tss/tss.h +++ b/src/constructs/tss/tss.h @@ -45,7 +45,7 @@ class BOTAN_DLL RTSS_Share byte share_id() const; u32bit size() const { return contents.size(); } - bool initialized() const { return contents.size(); } + bool initialized() const { return (contents.size() > 0); } private: SecureVector<byte> contents; }; diff --git a/src/libstate/lookup.cpp b/src/libstate/lookup.cpp index 3b49116f6..090c25fca 100644 --- a/src/libstate/lookup.cpp +++ b/src/libstate/lookup.cpp @@ -71,7 +71,7 @@ HashFunction* get_hash(const std::string& algo_spec) bool have_hash(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_hash_function(algo_spec); + return (af.prototype_hash_function(algo_spec) != 0); } /** @@ -80,7 +80,7 @@ bool have_hash(const std::string& algo_spec) const MessageAuthenticationCode* retrieve_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_mac(algo_spec); + return (af.prototype_mac(algo_spec) != 0); } /** @@ -89,7 +89,7 @@ const MessageAuthenticationCode* retrieve_mac(const std::string& algo_spec) MessageAuthenticationCode* get_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.make_mac(algo_spec); + return (af.make_mac(algo_spec) != 0); } /** @@ -98,7 +98,7 @@ MessageAuthenticationCode* get_mac(const std::string& algo_spec) bool have_mac(const std::string& algo_spec) { Algorithm_Factory& af = global_state().algorithm_factory(); - return af.prototype_mac(algo_spec); + return (af.prototype_mac(algo_spec) != 0); } /** |