Revision: 7487
http://winmerge.svn.sourceforge.net/winmerge/?rev=7487&view=rev
Author: gerundt
Date: 2010-12-30 16:52:47 +0000 (Thu, 30 Dec 2010)
Log Message:
-----------
Code style fixes and fix a warning
Modified Paths:
--------------
branches/R2_14/Src/DiffFileData.cpp
Modified: branches/R2_14/Src/DiffFileData.cpp
===================================================================
--- branches/R2_14/Src/DiffFileData.cpp 2010-12-30 16:34:31 UTC (rev 7486)
+++ branches/R2_14/Src/DiffFileData.cpp 2010-12-30 16:52:47 UTC (rev 7487)
@@ -5,7 +5,7 @@
*
* @date Created: 2003-08-22
*/
-// line follows -- this is updated by SVN
+// ID line follows -- this is updated by SVN
// $Id$
#include "stdafx.h"
@@ -31,13 +31,13 @@
DiffFileData::DiffFileData()
{
m_inf = new file_data[2];
- int i=0;
- for (i=0; i<2; ++i)
+ int i = 0;
+ for (i = 0; i < 2; ++i)
memset(&m_inf[i], 0, sizeof(m_inf[i]));
m_used = false;
Reset();
// Set default codepages
- for (i=0; i<sizeof(m_FileLocation)/sizeof(m_FileLocation[0]); ++i)
+ for (i = 0; i < countof(m_FileLocation); ++i)
{
m_FileLocation[i].encoding.SetCodepage(f_defcp);
}
@@ -80,7 +80,7 @@
{
Reset();
- for (int i=0; i<2; ++i)
+ for (int i = 0; i < 2; ++i)
{
// Fill in 8-bit versions of names for diffutils (WinMerge doesn't use these)
// Actual paths are m_FileLocation[i].filepath
@@ -130,7 +130,7 @@
}
// clean up any open file handles, and zero stuff out
// open file handles might be leftover from a failure in DiffFileData::OpenFiles
- for (int i=0; i<2; ++i)
+ for (int i = 0; i < 2; ++i)
{
if (m_inf[1].desc == m_inf[0].desc)
{
@@ -141,7 +141,7 @@
if (m_inf[i].desc > 0)
{
- close(m_inf[i].desc);
+ _close(m_inf[i].desc);
}
m_inf[i].desc = 0;
memset(&m_inf[i], 0, sizeof(m_inf[i]));
@@ -190,14 +190,16 @@
* return false if anything fails
* caller has to DeleteFile filepathTransformed, if it differs from filepath
*/
-bool DiffFileData::Filepath_Transform(FileLocation & fpenc, const String & filepath, String & filepathTransformed,
+bool DiffFileData::Filepath_Transform(FileLocation & fpenc,
+ const String & filepath, String & filepathTransformed,
LPCTSTR filteredFilenames, PrediffingInfo * infoPrediffer)
{
BOOL bMayOverwrite = FALSE; // temp variable set each time it is used
if (fpenc.encoding.m_unicoding && fpenc.encoding.m_unicoding != ucr::UCS2LE)
{
- // second step : normalize Unicode to OLECHAR (most of time, do nothing) (OLECHAR = UCS-2LE in Windows)
+ // second step : normalize Unicode to OLECHAR (most of time, do nothing)
+ // (OLECHAR = UCS-2LE in Windows)
bMayOverwrite = (filepathTransformed != filepath); // may overwrite if we've already copied to temp file
if (!FileTransform_NormalizeUnicode(filepathTransformed, bMayOverwrite))
return false;
@@ -236,7 +238,3 @@
}
return true;
}
-
-
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|