From cb9bff92107d168ff6dd0c12dc34bc7bacc8eb7d Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 23:33:05 +0200 Subject: remove "using namespace std" from cpp headers --- src/dkimbase.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/dkimbase.cpp') diff --git a/src/dkimbase.cpp b/src/dkimbase.cpp index 0361d8e..5ee6f28 100644 --- a/src/dkimbase.cpp +++ b/src/dkimbase.cpp @@ -27,6 +27,8 @@ #include "dkim.h" +using std::string; + CDKIMBase::CDKIMBase() : m_From(nullptr), @@ -98,7 +100,7 @@ int CDKIMBase::ReAlloc(char *& szBuffer, int& nBufferSize, int nRequiredSize) //////////////////////////////////////////////////////////////////////////////// void CDKIMBase::Free(char *szBuffer) { - if (szBuffer) delete[] szBuffer; + delete[] szBuffer; } //////////////////////////////////////////////////////////////////////////////// @@ -214,17 +216,17 @@ struct isswsp { void CDKIMBase::RemoveSWSP(char *szBuffer) { - *remove_if(szBuffer, szBuffer + strlen(szBuffer), isswsp()) = '\0'; + *std::remove_if(szBuffer, szBuffer + strlen(szBuffer), isswsp()) = '\0'; } void CDKIMBase::RemoveSWSP(char *pBuffer, int& nBufLength) { - nBufLength = remove_if(pBuffer, pBuffer + nBufLength, isswsp()) - pBuffer; + nBufLength = std::remove_if(pBuffer, pBuffer + nBufLength, isswsp()) - pBuffer; } void CDKIMBase::RemoveSWSP(string& sBuffer) { - sBuffer.erase(remove_if(sBuffer.begin(), sBuffer.end(), isswsp()), sBuffer.end()); + sBuffer.erase(std::remove_if(sBuffer.begin(), sBuffer.end(), isswsp()), sBuffer.end()); } ////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3