Revision: 3571
http://svn.sourceforge.net/winmerge/?rev=3571&view=rev
Author: kimmov
Date: 2006-09-16 00:38:48 -0700 (Sat, 16 Sep 2006)
Log Message:
-----------
Fix typecasting warnings
Modified Paths:
--------------
trunk/Src/Changes.txt
trunk/Src/MergeDoc.cpp
trunk/Src/locality.cpp
trunk/Src/locality.h
Modified: trunk/Src/Changes.txt
===================================================================
--- trunk/Src/Changes.txt 2006-09-16 07:14:04 UTC (rev 3570)
+++ trunk/Src/Changes.txt 2006-09-16 07:38:48 UTC (rev 3571)
@@ -9,6 +9,8 @@
Src/editlib: memcombo.cpp
Remove unused variable
Src: OpenDlg.cpp
+ Fix typecasting warnings
+ Src: locality.cpp locality.h MergeDoc.cpp
2006-09-15 Kimmo
BUG: [ 1558839 ] ShellExtension does not compile as 64-bit
Modified: trunk/Src/MergeDoc.cpp
===================================================================
--- trunk/Src/MergeDoc.cpp 2006-09-16 07:14:04 UTC (rev 3570)
+++ trunk/Src/MergeDoc.cpp 2006-09-16 07:38:48 UTC (rev 3571)
@@ -71,11 +71,10 @@
extern CLogFile gLog;
+/** @brief Max len of path in caption. */
static const UINT CAPTION_PATH_MAX = 50;
-/**
- * @brief EOL types
- */
+/** @brief EOL types */
static LPCTSTR crlfs[] =
{
_T ("\x0d\x0a"), // DOS/Windows style
@@ -83,6 +82,9 @@
_T ("\x0d") // Macintosh style
};
+static CString GetLineByteTimeReport(UINT lines, __int64 bytes,
+ const COleDateTime & start);
+
/////////////////////////////////////////////////////////////////////////////
// CMergeDoc
@@ -1422,11 +1424,15 @@
/**
* @brief Return a string giving #lines and #bytes and how much time elapsed.
+ * @param [in] lines Count of lines.
+ * @param [in] bytes Count of bytes.
+ * @param [in] start Time used.
+ * @return Formatted string.
*/
-static CString
-GetLineByteTimeReport(UINT lines, UINT bytes, const COleDateTime & start)
+static CString GetLineByteTimeReport(UINT lines, __int64 bytes,
+ const COleDateTime & start)
{
- CString sLines = locality::NumToLocaleStr(lines);
+ CString sLines = locality::NumToLocaleStr((int)lines);
CString sBytes = locality::NumToLocaleStr(bytes);
COleDateTimeSpan duration = COleDateTime::GetCurrentTime() - start;
CString sMinutes = locality::NumToLocaleStr((int)duration.GetTotalMinutes());
@@ -1525,12 +1531,12 @@
CString eol, preveol;
CString sline;
bool done = false;
- int next_line_report = 100; // for trace messages
- int next_line_multiple = 5; // for trace messages
+ UINT next_line_report = 100; // for trace messages
+ UINT next_line_multiple = 5; // for trace messages
COleDateTime start = COleDateTime::GetCurrentTime(); // for trace messages
// Manually grow line array exponentially
- int arraysize = 500;
+ UINT arraysize = 500;
m_aLines.SetSize(arraysize);
// preveol must be initialized for empty files
Modified: trunk/Src/locality.cpp
===================================================================
--- trunk/Src/locality.cpp 2006-09-16 07:14:04 UTC (rev 3570)
+++ trunk/Src/locality.cpp 2006-09-16 07:38:48 UTC (rev 3571)
@@ -63,8 +63,11 @@
*
* NB: We are not converting digits from ASCII via LOCALE_SNATIVEDIGITS
* So we always use ASCII digits, instead of, eg, the Chinese digits
+ *
+ * @param [in] n Number to convert.
+ * @return Converted string.
*/
-CString NumToLocaleStr(UINT n)
+CString NumToLocaleStr(int n)
{
TCHAR numbuff[34];
_ltot(n, numbuff, 10);
@@ -72,6 +75,22 @@
}
/**
+ * @brief Print an integer into a CString, in appropriate fashion for locale & user preferences
+ *
+ * NB: We are not converting digits from ASCII via LOCALE_SNATIVEDIGITS
+ * So we always use ASCII digits, instead of, eg, the Chinese digits
+ *
+ * @param [in] n Number to convert.
+ * @return Converted string.
+ */
+CString NumToLocaleStr(__int64 n)
+{
+ TCHAR numbuff[34];
+ _i64tot(n, numbuff, 10);
+ return GetLocaleStr(numbuff);
+}
+
+/**
* @brief Insert commas (or periods) into string, as appropriate for locale & preferences
*
* NB: We are not converting digits from ASCII via LOCALE_SNATIVEDIGITS
Modified: trunk/Src/locality.h
===================================================================
--- trunk/Src/locality.h 2006-09-16 07:14:04 UTC (rev 3570)
+++ trunk/Src/locality.h 2006-09-16 07:38:48 UTC (rev 3571)
@@ -11,7 +11,8 @@
namespace locality {
-CString NumToLocaleStr(UINT n);
+CString NumToLocaleStr(int n);
+CString NumToLocaleStr(__int64 n);
CString GetLocaleStr(const CString & str, int decimalDigits = 0);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|