if (m_ParseCookies->size() == 0)
{
// must be initialized to invalid value (DWORD) -1
- m_ParseCookies->assign(nLineCount, -1);
+ m_ParseCookies->assign(nLineCount, (DWORD)-1);
}
if (nLineIndex < 0)
ASSERT (cookiesSize == nLineCount);
// must be reinitialized to invalid value (DWORD) - 1
for (int i = nLineIndex; i < cookiesSize; ++i)
- (*m_ParseCookies)[i] = -1;
+ (*m_ParseCookies)[i] = (DWORD)-1;
}
// This line'th actual length must be recalculated
if (m_pnActualLineLength->size())
arrSize = nLineCount;
// must be initialized to invalid value (DWORD) - 1
for (size_t i = oldsize; i < arrSize; ++i)
- (*m_ParseCookies)[i] = -1;
+ (*m_ParseCookies)[i] = (DWORD)-1;
}
for (size_t i = nLineIndex; i < arrSize; ++i)
- (*m_ParseCookies)[i] = -1;
+ (*m_ParseCookies)[i] = (DWORD)-1;
}
// Recalculate actual length for all lines below this
typename S::const_iterator end2(str2.end());
while (it1 != end1 && it2 != end2)
{
- typename S::value_type c1(Ascii::toLower(*it1));
- typename S::value_type c2(Ascii::toLower(*it2));
+ typename S::value_type c1(static_cast<typename S::value_type>(Ascii::toLower(*it1)));
+ typename S::value_type c2(static_cast<typename S::value_type>(Ascii::toLower(*it2)));
if (c1 < c2)
return -1;
else if (c1 > c2)
#include <sys/stat.h>
#include <algorithm>
#include <string>
+#include <cctype>
+#include <cwctype>
#include <map>
#include <cassert>
#include <exception>
return false;//In no Start and End pair, and no single in-line set, then it's not trivial
if (StartOfComment == Line.c_str() &&
- ((EndOfComment + filtercommentsset.EndMarker.size()) - StartOfComment) == Line.size())
+ static_cast<size_t>((EndOfComment + filtercommentsset.EndMarker.size()) - StartOfComment) == Line.size())
{//If entire line is blocked by End and Start markers, then entire line is trivial
return true;
}
if (m_options.m_bIgnoreCase)
{
//ignore case
- std::transform(LineDataLeft.begin(), LineDataLeft.end(), LineDataLeft.begin(), ::toupper);
- std::transform(LineDataRight.begin(), LineDataRight.end(), LineDataRight.begin(), ::toupper);
+ // std::transform(LineDataLeft.begin(), LineDataLeft.end(), LineDataLeft.begin(), ::toupper);
+ for (std::basic_string<char>::iterator pb = LineDataLeft.begin(), pe = LineDataLeft.end(); pb != pe; ++pb)
+ *pb = static_cast<char>(::toupper(*pb));
+ // std::transform(LineDataRight.begin(), LineDataRight.end(), LineDataRight.begin(), ::toupper);
+ for (std::basic_string<char>::iterator pb = LineDataRight.begin(), pe = LineDataRight.end(); pb != pe; ++pb)
+ *pb = static_cast<char>(::toupper(*pb));
}
if (!LineDataLeft.empty())
static void find_and_hash_each_line (struct file_data *);
static void find_identical_ends (struct file_data[]);
static char *prepare_text_end (struct file_data *, short);
-static enum UNICODESET get_unicode_signature(struct file_data *, unsigned *bom);
+static enum UNICODESET get_unicode_signature(struct file_data *, int *pBomsize);
/* Check for binary files and compare them for exact identity. */
#define binary_file_p(buf, size) (size != 0 && memchr (buf, '\0', size) != 0)
/** @brief Get unicode signature from file_data. */
-static enum UNICODESET get_unicode_signature(struct file_data *current, unsigned *bom)
+static enum UNICODESET get_unicode_signature(struct file_data *current, int *pBomsize)
{
// initialize to a pattern that differs everywhere from all possible unicode signatures
unsigned long sig = 0x3F3F3F3F;
memcpy(&sig, current->buffer, min(current->buffered_chars, 4));
// check for the two possible 4 bytes signatures
int tmp;
- int *bomsize = bom ? bom : &tmp;
+ int *bomsize = pBomsize ? pBomsize : &tmp;
if (sig == 0x0000FEFF)
{
char *const p = current->buffer;
char *r = p; // receives the return value
char *q0, *t;
- unsigned bom = 0;
- enum UNICODESET sig = get_unicode_signature(current, &bom);
- char *const u0 = p + bom;
+ int bomsize = 0;
+ enum UNICODESET sig = get_unicode_signature(current, &bomsize);
+ char *const u0 = p + bomsize;
if (sig == UCS4LE)
{