aboutsummaryrefslogtreecommitdiffstats
path: root/src/cms
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-04-18 18:35:38 +0000
committerlloyd <[email protected]>2011-04-18 18:35:38 +0000
commitc4bedb32c0547e8f6b67ece566050073726120f5 (patch)
tree17183000888bda5156637360d10d9901ced3565b /src/cms
parent06a32c91e639cc2b0c636553a8aa395aa90d4d37 (diff)
Maintainer mode warning cleanups, mostly for C style casts which I
added to the flags here.
Diffstat (limited to 'src/cms')
-rw-r--r--src/cms/cms_algo.cpp2
-rw-r--r--src/cms/cms_dec.cpp4
-rw-r--r--src/cms/cms_enc.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/cms/cms_algo.cpp b/src/cms/cms_algo.cpp
index 50384d85a..3c245cc6f 100644
--- a/src/cms/cms_algo.cpp
+++ b/src/cms/cms_algo.cpp
@@ -99,7 +99,7 @@ SecureVector<byte> CMS_Encoder::wrap_key(RandomNumberGenerator& rng,
throw Encoding_Error("CMS: 128-bit KEKs must be used with " + cipher);
SecureVector<byte> lcekpad;
- lcekpad.push_back((byte)cek.length());
+ lcekpad.push_back(static_cast<byte>(cek.length()));
lcekpad += cek.bits_of();
while(lcekpad.size() % 8)
lcekpad.push_back(rng.next_byte());
diff --git a/src/cms/cms_dec.cpp b/src/cms/cms_dec.cpp
index c86e1d0ae..a9f4e69d9 100644
--- a/src/cms/cms_dec.cpp
+++ b/src/cms/cms_dec.cpp
@@ -86,7 +86,9 @@ std::string CMS_Decoder::get_data() const
{
if(layer_type() != DATA)
throw Invalid_State("CMS: Cannot retrieve data from non-DATA layer");
- return std::string((const char*)&data[0], data.size());
+
+ return std::string(reinterpret_cast<const char*>(&data[0]),
+ data.size());
}
/*
diff --git a/src/cms/cms_enc.cpp b/src/cms/cms_enc.cpp
index cd739ef08..1a45a6a46 100644
--- a/src/cms/cms_enc.cpp
+++ b/src/cms/cms_enc.cpp
@@ -30,7 +30,7 @@ void CMS_Encoder::set_data(const byte buf[], size_t length)
*/
void CMS_Encoder::set_data(const std::string& str)
{
- set_data((const byte*)str.c_str(), str.length());
+ set_data(reinterpret_cast<const byte*>(str.c_str()), str.length());
}
/*