[Box Backup-dev] COMMIT r364 - in box/chris/win32/vc2005-compile-fixes: bin/bbackupctl bin/bbackupd lib/backupclient lib/common lib/server lib/win32 test/win32
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Fri Feb 3 19:59:07 GMT 2006
Author: chris
Date: 2006-02-03 19:58:38 +0000 (Fri, 03 Feb 2006)
New Revision: 364
Modified:
box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp
box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp
box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp
box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h
box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h
box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h
box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h
box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h
box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/Test.h
box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp
box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp
box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp
box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h
box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp
box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp
box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp
Log:
* test/win32/testlibwin32.cpp
- Include emulation header
- Rename _chdir back to chdir, since emu.h #defines the new to the old
* lib/win32/emu.cpp
- Moved '#include <process.h>' to sit next to unistd.h
- Improved comment formatting
- Renamed tTimer to Timer_t
* lib/backupclient/BackupClientRestore.cpp
* lib/backupclient/BackupStoreFileDiff.cpp
* lib/backupclient/BackupClientFileAttributes.cpp
* lib/backupclient/BackupStoreFileEncodeStream.cpp
* lib/backupclient/BackupStoreDirectory.h
* lib/backupclient/BackupStoreFileCombine.cpp
* lib/backupclient/BackupStoreFile.cpp
* lib/backupclient/BackupStoreFilename.cpp
* lib/backupclient/BackupStoreFilenameClear.cpp
* lib/backupclient/BackupStoreFileCmbDiff.cpp
* lib/backupclient/BackupStoreDirectory.cpp
* lib/backupclient/BackupStoreFileCmbIdx.cpp
* lib/backupclient/BackupStoreFile.h
* lib/backupclient/BackupStoreFileRevDiff.cpp
* lib/server/Protocol.cpp
* lib/server/SocketStream.cpp
* lib/server/Protocol.h
* lib/server/SocketStreamTLS.cpp
* lib/common/ReadGatherStream.cpp
* lib/common/IOStreamGetLine.cpp
* lib/common/FdGetLine.cpp
* lib/common/MemBlockStream.h
* lib/common/WaitForEvent.cpp
* lib/common/CollectInBufferStream.cpp
* lib/common/StreamableMemBlock.cpp
* lib/common/Utils.cpp
* lib/common/MemBlockStream.cpp
* lib/common/CollectInBufferStream.h
* lib/common/ExcludeList.h
* lib/common/BoxTimeToUnix.h
* bin/bbackupctl/bbackupctl.cpp
* bin/bbackupd/BackupClientDirectoryRecord.cpp
* bin/bbackupd/BackupDaemon.cpp
- Undo type changes and type casts
- Undo formatting changes to reduce white space noise
* lib/common/Test.h
* lib/common/Guards.h
- Remove #included "Box.h" from header file as requested by Ben
Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/bin/bbackupctl/bbackupctl.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -215,7 +215,7 @@
// No? Just send the command given plus a quit command.
std::string cmd(argv[0]);
cmd += "\nquit\n";
- connection.Write(cmd.c_str(), (int)cmd.size());
+ connection.Write(cmd.c_str(), cmd.size());
}
// Read the response
Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupClientDirectoryRecord.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -260,7 +260,7 @@
checksum_info.mAttributeModificationTime = FileAttrModificationTime(st);
checksum_info.mSize = st.st_size;
currentStateChecksum.Add(&checksum_info, sizeof(checksum_info));
- currentStateChecksum.Add(en->d_name, (int)strlen(en->d_name));
+ currentStateChecksum.Add(en->d_name, strlen(en->d_name));
// If the file has been modified madly into the future, download the
// directory record anyway to ensure that it doesn't get uploaded
Modified: box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/bin/bbackupd/BackupDaemon.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -265,7 +265,7 @@
conf.GetKeyValueInt("MaxUploadWait"),
mState);
- mpCommandSocketInfo->mListeningSocket.Write(summary, (int)summarySize);
+ mpCommandSocketInfo->mListeningSocket.Write(summary, summarySize);
mpCommandSocketInfo->mListeningSocket.Write("ping\n", 5);
IOStreamGetLine readLine(mpCommandSocketInfo->mListeningSocket);
@@ -320,7 +320,7 @@
{
const char* response = sendOK ? "ok\n" : "error\n";
mpCommandSocketInfo->mListeningSocket.Write(
- response, (int)strlen(response));
+ response, strlen(response));
}
if (disconnect)
@@ -523,7 +523,7 @@
{
// No command socket or connection, just do a normal sleep
time_t sleepSeconds = BoxTimeToSeconds(requiredDelay);
- ::sleep((unsigned int)((sleepSeconds <= 0)?1:sleepSeconds));
+ ::sleep((sleepSeconds <= 0)?1:sleepSeconds);
}
}
@@ -678,8 +678,7 @@
}
// Calculate when the next sync run should be
- nextSyncTime = currentSyncStartTime + updateStoreInterval +
- Random::RandomInt((uint32_t)updateStoreInterval >> SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY);
+ nextSyncTime = currentSyncStartTime + updateStoreInterval + Random::RandomInt(updateStoreInterval >> SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY);
// Commit the ID Maps
CommitIDMapsAfterSync();
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientFileAttributes.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -632,7 +632,7 @@
}
#endif
- xattrOffset += (int)std::strlen(reinterpret_cast<char*>(pattr+1))+1;
+ xattrOffset += std::strlen(reinterpret_cast<char*>(pattr+1))+1;
}
// If working as root, set user IDs
@@ -986,7 +986,7 @@
MD5Digest digest;
digest.Add(&hashData, sizeof(hashData));
digest.Add(xattr.GetBuffer(), xattr.GetSize());
- digest.Add(leafname.c_str(), (int)leafname.size());
+ digest.Add(leafname.c_str(), leafname.size());
digest.Add(sAttributeHashSecret, sAttributeHashSecretLength);
digest.Finish();
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupClientRestore.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -104,9 +104,9 @@
// ID
rWrite.Write(&mNextLevelID, sizeof(mNextLevelID));
// Name string
- std::string::size_type nsize = mNextLevelLocalName.size();
+ int32_t nsize = mNextLevelLocalName.size();
rWrite.Write(&nsize, sizeof(nsize));
- rWrite.Write(mNextLevelLocalName.c_str(), (int)nsize);
+ rWrite.Write(mNextLevelLocalName.c_str(), nsize);
// And then the level itself
mpNextLevel->SaveLevel(rWrite);
}
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -192,7 +192,7 @@
void BackupStoreDirectory::WriteToStream(IOStream &rStream, int16_t FlagsMustBeSet, int16_t FlagsNotToBeSet, bool StreamAttributes, bool StreamDependencyInfo) const
{
// Get count of entries
- std::vector<Entry*>::size_type count = mEntries.size();
+ int32_t count = mEntries.size();
if(FlagsMustBeSet != Entry::Flags_INCLUDE_EVERYTHING || FlagsNotToBeSet != Entry::Flags_EXCLUDE_NOTHING)
{
// Need to count the entries
@@ -230,7 +230,7 @@
// Build header
dir_StreamFormat hdr;
hdr.mMagicValue = htonl(OBJECTMAGIC_DIR_MAGIC_VALUE);
- hdr.mNumEntries = htonl((u_long)count);
+ hdr.mNumEntries = htonl(count);
hdr.mObjectID = box_hton64(mObjectID);
hdr.mContainerID = box_hton64(mContainerID);
hdr.mAttributesModTime = box_hton64(mAttributesModTime);
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreDirectory.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -146,8 +146,7 @@
int64_t GetRevisionID() const {return mRevisionID;}
void SetRevisionID(int64_t RevisionID) {mRevisionID = RevisionID;}
- unsigned int GetNumberOfEntries() const
- {return (unsigned int)mEntries.size();}
+ unsigned int GetNumberOfEntries() const {return mEntries.size();}
// User info -- not serialised into streams
int64_t GetUserInfo1_SizeInBlocks() const {return mUserInfo1;}
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -522,22 +522,21 @@
if(mNumBlocks > 0)
{
// Find the maximum encoded data size
- uint64_t maxEncodedDataSize = 0;
+ int32_t maxEncodedDataSize = 0;
const file_BlockIndexEntry *entry = (file_BlockIndexEntry *)mpBlockIndex;
ASSERT(entry != 0);
for(int64_t e = 0; e < mNumBlocks; e++)
{
// Get the clear and encoded size
- uint64_t encodedSize = box_ntoh64(entry[e].mEncodedSize);
+ int32_t encodedSize = box_ntoh64(entry[e].mEncodedSize);
ASSERT(encodedSize > 0);
// Larger?
- if(encodedSize > maxEncodedDataSize)
- maxEncodedDataSize = encodedSize;
+ if(encodedSize > maxEncodedDataSize) maxEncodedDataSize = encodedSize;
}
// Allocate those blocks!
- mpEncodedData = (uint8_t*)BackupStoreFile::CodingChunkAlloc((int)maxEncodedDataSize + 32);
+ mpEncodedData = (uint8_t*)BackupStoreFile::CodingChunkAlloc(maxEncodedDataSize + 32);
// Allocate the block for the clear data, using the hint from the header.
// If this is wrong, things will exception neatly later on, so it can't be used
@@ -605,15 +604,14 @@
int64_t indexSize = sizeof(file_BlockIndexEntry) * mNumBlocks;
// Allocate some memory
- mpBlockIndex = ::malloc((size_t)indexSize);
+ mpBlockIndex = ::malloc(indexSize);
if(mpBlockIndex == 0)
{
throw std::bad_alloc();
}
// Read it in
- if(!mrEncodedFile.ReadFullBuffer(mpBlockIndex, (int)indexSize,
- 0 /* not interested in bytes read if this fails */, mTimeout))
+ if(!mrEncodedFile.ReadFullBuffer(mpBlockIndex, indexSize, 0 /* not interested in bytes read if this fails */, mTimeout))
{
// Couldn't read header
THROW_EXCEPTION(BackupStoreException, WhenDecodingExpectedToReadButCouldnt)
@@ -680,7 +678,7 @@
// Get the size from the block index
const file_BlockIndexEntry *entry = (file_BlockIndexEntry *)mpBlockIndex;
- uint64_t encodedSize = box_ntoh64(entry[mCurrentBlock].mEncodedSize);
+ int32_t encodedSize = box_ntoh64(entry[mCurrentBlock].mEncodedSize);
if(encodedSize <= 0)
{
// The caller is attempting to decode a file which is the direct result of a diff
@@ -690,16 +688,14 @@
}
// Load in next block
- if(!mrEncodedFile.ReadFullBuffer(mpEncodedData, (int)encodedSize,
- 0 /* not interested in bytes read if this fails */, mTimeout))
+ if(!mrEncodedFile.ReadFullBuffer(mpEncodedData, encodedSize, 0 /* not interested in bytes read if this fails */, mTimeout))
{
// Couldn't read header
THROW_EXCEPTION(BackupStoreException, WhenDecodingExpectedToReadButCouldnt)
}
// Decode the data
- mCurrentBlockClearSize = BackupStoreFile::DecodeChunk(mpEncodedData,
- (int)encodedSize, mpClearData, mClearDataSize);
+ mCurrentBlockClearSize = BackupStoreFile::DecodeChunk(mpEncodedData, encodedSize, mpClearData, mClearDataSize);
// Calculate IV for this entry
uint64_t iv = mEntryIVBase;
@@ -938,7 +934,7 @@
}
// Check alignment of the block
- ASSERT((((long long)rOutput.mpBuffer) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
+ ASSERT((((uint32_t)(long)rOutput.mpBuffer) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
// Want to compress it?
bool compressChunk = (ChunkSize >= BACKUP_FILE_MIN_COMPRESSED_CHUNK_SIZE);
@@ -1026,7 +1022,7 @@
int BackupStoreFile::DecodeChunk(const void *Encoded, int EncodedSize, void *Output, int OutputSize)
{
// Check alignment of the encoded block
- ASSERT((((long long)Encoded) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
+ ASSERT((((uint32_t)(long)Encoded) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
// First check
if(EncodedSize < 1)
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFile.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -125,7 +125,7 @@
// Align to main block size
ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size
uint8_t adjustment = BACKUPSTOREFILE_CODING_BLOCKSIZE
- - (uint8_t)(((unsigned long long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE);
+ - (uint8_t)(((unsigned long)a) % BACKUPSTOREFILE_CODING_BLOCKSIZE);
uint8_t *b = (a + adjustment);
// Store adjustment
*b = adjustment;
@@ -136,7 +136,7 @@
{
// Check alignment is as expected
ASSERT(sizeof(unsigned long) >= sizeof(void*)); // make sure casting the right pointer size
- ASSERT((uint8_t)(((unsigned long long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
+ ASSERT((uint8_t)(((unsigned long)Block) % BACKUPSTOREFILE_CODING_BLOCKSIZE) == BACKUPSTOREFILE_CODING_OFFSET);
uint8_t *a = (uint8_t*)Block;
a -= BACKUPSTOREFILE_CODING_OFFSET;
// Adjust downwards...
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbDiff.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -79,7 +79,7 @@
}
int64_t diff1NumBlocks = box_ntoh64(diff1IdxHdr.mNumBlocks);
// Allocate some memory
- int64_t *diff1BlockStartPositions = (int64_t*)::malloc(((size_t)diff1NumBlocks + 1) * sizeof(int64_t));
+ int64_t *diff1BlockStartPositions = (int64_t*)::malloc((diff1NumBlocks + 1) * sizeof(int64_t));
if(diff1BlockStartPositions == 0)
{
throw std::bad_alloc();
@@ -201,14 +201,14 @@
// Block is in the old diff file, copy it across
copyBlock = true;
copyFrom = diff1BlockStartPositions[blockIndex];
- int nb = (int)blockIndex + 1;
+ int nb = blockIndex + 1;
while(diff1BlockStartPositions[nb] <= 0)
{
// This is safe, because the last entry will terminate it properly!
++nb;
ASSERT(nb <= diff1NumBlocks);
}
- copySize = (int)(diff1BlockStartPositions[nb] - copyFrom);
+ copySize = diff1BlockStartPositions[nb] - copyFrom;
fromFileDiff1 = true;
}
}
@@ -284,7 +284,7 @@
if(diff1BlockStartPositions[blockIndex] > 0)
{
// Block is in the first diff file, stick in size
- int nb = (int)blockIndex + 1;
+ int nb = blockIndex + 1;
while(diff1BlockStartPositions[nb] <= 0)
{
// This is safe, because the last entry will terminate it properly!
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCmbIdx.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -174,7 +174,7 @@
// Then... allocate memory for the list of sizes
mNumEntriesInFromFile = box_ntoh64(fromHdr.mNumBlocks);
- mFromBlockSizes = (int64_t*)::malloc((size_t)mNumEntriesInFromFile * sizeof(int64_t));
+ mFromBlockSizes = (int64_t*)::malloc(mNumEntriesInFromFile * sizeof(int64_t));
if(mFromBlockSizes == 0)
{
throw std::bad_alloc();
@@ -241,7 +241,7 @@
int entriesToWrite = NBytes / sizeof(file_BlockIndexEntry);
if(entriesToWrite > mNumEntriesToGo)
{
- entriesToWrite = (int)mNumEntriesToGo;
+ entriesToWrite = mNumEntriesToGo;
}
// Setup ready to go
@@ -256,7 +256,7 @@
}
// Does this need adjusting?
- int s = (int)box_ntoh64(poutput[b].mEncodedSize);
+ int s = box_ntoh64(poutput[b].mEncodedSize);
if(s <= 0)
{
// A reference to a block in the from file
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileCombine.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -96,7 +96,7 @@
// Allocate memory for the block index of the From file
int64_t fromNumBlocks = box_ntoh64(fromHdr.mNumBlocks);
// NOTE: An extra entry is required so that the length of the last block can be calculated
- FromIndexEntry *pFromIndex = (FromIndexEntry*)::malloc(((int)fromNumBlocks+1) * sizeof(FromIndexEntry));
+ FromIndexEntry *pFromIndex = (FromIndexEntry*)::malloc((fromNumBlocks+1) * sizeof(FromIndexEntry));
if(pFromIndex == 0)
{
throw std::bad_alloc();
@@ -252,7 +252,7 @@
if(encodedSize > 0)
{
// The block is actually in the diff file
- blockSize = (int32_t)encodedSize;
+ blockSize = encodedSize;
}
else
{
@@ -264,9 +264,7 @@
THROW_EXCEPTION(BackupStoreException, BadBackupStoreFile)
}
// Calculate size. This operation is safe because of the extra entry at the end
- blockSize = (int32_t)(
- pFromIndex[blockIdx + 1].mFilePosition -
- pFromIndex[blockIdx].mFilePosition );
+ blockSize = pFromIndex[blockIdx + 1].mFilePosition - pFromIndex[blockIdx].mFilePosition;
}
ASSERT(blockSize > 0);
@@ -396,9 +394,7 @@
THROW_EXCEPTION(BackupStoreException, BadBackupStoreFile)
}
// Calculate size. This operation is safe because of the extra entry at the end
- int32_t blockSize = (int32_t)(
- pFromIndex[blockIdx + 1].mFilePosition -
- pFromIndex[blockIdx].mFilePosition );
+ int32_t blockSize = pFromIndex[blockIdx + 1].mFilePosition - pFromIndex[blockIdx].mFilePosition;
// Then replace entry
en.mEncodedSize = box_hton64(((uint64_t)blockSize));
}
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileDiff.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -317,7 +317,7 @@
//TODO: Verify that these sizes look reasonable
// Allocate space for the index
- BlocksAvailableEntry *pindex = (BlocksAvailableEntry*)::malloc(sizeof(BlocksAvailableEntry) * (size_t)numBlocks);
+ BlocksAvailableEntry *pindex = (BlocksAvailableEntry*)::malloc(sizeof(BlocksAvailableEntry) * numBlocks);
if(pindex == 0)
{
throw std::bad_alloc();
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileEncodeStream.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -270,7 +270,7 @@
} while(rBlockSizeOut <= BACKUP_FILE_MAX_BLOCK_SIZE && rNumBlocksOut > BACKUP_FILE_INCREASE_BLOCK_SIZE_AFTER);
// Last block size
- rLastBlockSizeOut = (int32_t)(DataSize - ((rNumBlocksOut - 1) * rBlockSizeOut));
+ rLastBlockSizeOut = DataSize - ((rNumBlocksOut - 1) * rBlockSizeOut);
// Avoid small blocks?
if(rLastBlockSizeOut < BACKUP_FILE_AVOID_BLOCKS_LESS_THAN
@@ -451,7 +451,7 @@
}
// Index of the first block in old file (being diffed from)
- int firstIndex = (int)mpRecipe->BlockPtrToIndex((*mpRecipe)[mInstructionNumber].mpStartBlock);
+ int firstIndex = mpRecipe->BlockPtrToIndex((*mpRecipe)[mInstructionNumber].mpStartBlock);
int64_t sizeToSkip = 0;
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFileRevDiff.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -60,7 +60,7 @@
// For each block in the from file, we want to know it's index in the
// diff file. Allocate memory for this information.
int64_t fromNumBlocks = box_ntoh64(hdr.mNumBlocks);
- int64_t *pfromIndexInfo = (int64_t*)::malloc((size_t)fromNumBlocks * sizeof(int64_t));
+ int64_t *pfromIndexInfo = (int64_t*)::malloc(fromNumBlocks * sizeof(int64_t));
if(pfromIndexInfo == 0)
{
throw std::bad_alloc();
@@ -176,21 +176,21 @@
bufferSize = 0;
}
// Allocate new block
- buffer = ::malloc((size_t)blockSize);
+ buffer = ::malloc(blockSize);
if(buffer == 0)
{
throw std::bad_alloc();
}
- bufferSize = (int)blockSize;
+ bufferSize = blockSize;
}
ASSERT(bufferSize >= blockSize);
// Copy the block
- if(!rFrom.ReadFullBuffer(buffer, (int)blockSize, 0))
+ if(!rFrom.ReadFullBuffer(buffer, blockSize, 0))
{
THROW_EXCEPTION(BackupStoreException, FailedToReadBlockOnCombine)
}
- rOut.Write(buffer, (int)blockSize);
+ rOut.Write(buffer, blockSize);
// Store the size
pfromIndexInfo[b] = blockSize;
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilename.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -141,7 +141,7 @@
{
CheckValid();
- rProtocol.Write(c_str(), (int)size());
+ rProtocol.Write(c_str(), size());
}
// --------------------------------------------------------------------------
@@ -216,7 +216,7 @@
{
CheckValid();
- rStream.Write(c_str(), (int)size());
+ rStream.Write(c_str(), size());
}
// --------------------------------------------------------------------------
Modified: box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/backupclient/BackupStoreFilenameClear.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -218,7 +218,7 @@
void BackupStoreFilenameClear::EncryptClear(const std::string &rToEncode, CipherContext &rCipherContext, int StoreAsEncoding)
{
// Work out max size
- int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize((int)rToEncode.size()) + 4;
+ int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize(rToEncode.size()) + 4;
// Make sure encode/decode buffer has enough space
if(sEncDecBufferSize < maxOutSize)
@@ -235,7 +235,7 @@
MEMLEAKFINDER_NOT_A_LEAK(buffer);
// Encode -- do entire block in one go
- int encSize = rCipherContext.TransformBlock(buffer + 2, sEncDecBufferSize - 2, rToEncode.c_str(), (int)rToEncode.size());
+ int encSize = rCipherContext.TransformBlock(buffer + 2, sEncDecBufferSize - 2, rToEncode.c_str(), rToEncode.size());
// and add in header size
encSize += 2;
@@ -258,7 +258,7 @@
void BackupStoreFilenameClear::DecryptEncoded(CipherContext &rCipherContext) const
{
// Work out max size
- int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize((int)size()) + 4;
+ int maxOutSize = rCipherContext.MaxOutSizeForInBufferSize(size()) + 4;
// Make sure encode/decode buffer has enough space
if(sEncDecBufferSize < maxOutSize)
@@ -276,7 +276,7 @@
// Decrypt
const char *str = c_str() + 2;
- int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, (int)size() - 2);
+ int sizeOut = rCipherContext.TransformBlock(buffer, sEncDecBufferSize, str, size() - 2);
// Assign to this
mClearFilename.assign((char*)buffer, sizeOut);
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/BoxTimeToUnix.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -26,7 +26,7 @@
inline void BoxTimeToTimespec(box_time_t Time, struct timespec &tv)
{
- tv.tv_sec = (long)(Time / MICRO_SEC_IN_SEC_LL);
+ tv.tv_sec = (time_t)(Time / MICRO_SEC_IN_SEC_LL);
tv.tv_nsec = ((long)(Time % MICRO_SEC_IN_SEC_LL)) * NANO_SEC_IN_USEC;
}
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -63,7 +63,7 @@
// Adjust to number of bytes left
if(NBytes > (mBytesInBuffer - mReadPosition))
{
- NBytes = (int)(mBytesInBuffer - mReadPosition);
+ NBytes = (mBytesInBuffer - mReadPosition);
}
ASSERT(NBytes >= 0);
if(NBytes <= 0) return 0; // careful now
@@ -157,7 +157,7 @@
{
if(mInWritePhase != false) { THROW_EXCEPTION(CommonException, CollectInBufferStreamNotInCorrectPhase) }
- pos_type newPos = 0;
+ int newPos = 0;
switch(SeekType)
{
case IOStream::SeekType_Absolute:
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/CollectInBufferStream.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -52,7 +52,7 @@
MemoryBlockGuard<char*> mBuffer;
int mBufferSize;
int mBytesInBuffer;
- pos_type mReadPosition;
+ int mReadPosition;
bool mInWritePhase;
};
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/ExcludeList.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -43,11 +43,10 @@
bool IsExcluded(const std::string &rTest) const;
// Mainly for tests
- unsigned int SizeOfDefiniteList() const
- {return (unsigned int)mDefinite.size();}
+ unsigned int SizeOfDefiniteList() const {return mDefinite.size();}
unsigned int SizeOfRegexList() const
#ifdef HAVE_REGEX_H
- {return (unsigned int)mRegex.size();}
+ {return mRegex.size();}
#else
{return 0;}
#endif
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/FdGetLine.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -154,8 +154,8 @@
else
{
// Check for comment char, but char before must be whitespace
- int end = 0; // can be negative
- std::string::size_type size = r.size();
+ int end = 0;
+ int size = r.size();
while(end < size)
{
if(r[end] == '#' && (end == 0 || (iw(r[end-1]))))
@@ -166,7 +166,7 @@
}
// Remove whitespace
- int begin = 0; // should be positive, but compared with "end"
+ int begin = 0;
while(begin < size && iw(r[begin]))
{
begin++;
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/Guards.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -11,8 +11,6 @@
#ifndef GUARDS__H
#define GUARDS__H
-#include "Box.h"
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/IOStreamGetLine.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -151,8 +151,8 @@
else
{
// Check for comment char, but char before must be whitespace
- std::string::size_type end = 0;
- std::string::size_type size = r.size();
+ int end = 0;
+ int size = r.size();
while(end < size)
{
if(r[end] == '#' && (end == 0 || (iw(r[end-1]))))
@@ -163,7 +163,7 @@
}
// Remove whitespace
- std::string::size_type begin = 0;
+ int begin = 0;
while(begin < size && iw(r[begin]))
{
begin++;
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -113,7 +113,7 @@
// Adjust to number of bytes left
if(NBytes > (mBytesInBuffer - mReadPosition))
{
- NBytes = (int)(mBytesInBuffer - mReadPosition);
+ NBytes = (mBytesInBuffer - mReadPosition);
}
ASSERT(NBytes >= 0);
if(NBytes <= 0) return 0; // careful now
@@ -175,7 +175,7 @@
// --------------------------------------------------------------------------
void MemBlockStream::Seek(pos_type Offset, int SeekType)
{
- pos_type newPos = 0;
+ int newPos = 0;
switch(SeekType)
{
case IOStream::SeekType_Absolute:
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/MemBlockStream.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -45,7 +45,7 @@
private:
const char *mpBuffer;
int mBytesInBuffer;
- pos_type mReadPosition;
+ int mReadPosition;
};
#endif // MEMBLOCKSTREAM__H
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/ReadGatherStream.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -69,7 +69,7 @@
ASSERT(pStream != 0);
// Just add the component to the list, returning it's index.
- int index = (int)mComponents.size();
+ int index = mComponents.size();
mComponents.push_back(pStream);
return index;
}
@@ -145,8 +145,7 @@
if(mPositionInCurrentBlock < mBlocks[mCurrentBlock].mLength)
{
// Read!
- int s = (int)(mBlocks[mCurrentBlock].mLength -
- mPositionInCurrentBlock);
+ int s = mBlocks[mCurrentBlock].mLength - mPositionInCurrentBlock;
if(s > bytesToRead) s = bytesToRead;
int r = mComponents[mBlocks[mCurrentBlock].mComponent]->Read(buffer, s, Timeout);
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/StreamableMemBlock.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -115,7 +115,7 @@
}
// Allocate a new block (this way to be exception safe)
- char *pblock = (char*)malloc((size_t)size);
+ char *pblock = (char*)malloc(size);
if(pblock == 0)
{
throw std::bad_alloc();
@@ -124,7 +124,7 @@
try
{
// Read in
- if(!rStream.ReadFullBuffer(pblock, (int)size, 0 /* not interested in bytes read if this fails */))
+ if(!rStream.ReadFullBuffer(pblock, size, 0 /* not interested in bytes read if this fails */))
{
THROW_EXCEPTION(CommonException, StreamableMemBlockIncompleteRead)
}
@@ -141,7 +141,7 @@
// store...
ASSERT(mpBuffer == 0);
mpBuffer = pblock;
- mSize = (int)size;
+ mSize = size;
}
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Test.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/Test.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/Test.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -10,8 +10,6 @@
#ifndef TEST__H
#define TEST__H
-#include "Box.h"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/Utils.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -39,7 +39,7 @@
while(e = String.find_first_of(SplitOn, b), e != String.npos)
{
// Get this string
- std::string::size_type len = e - b;
+ unsigned int len = e - b;
if(len >= 1)
{
rOutput.push_back(String.substr(b, len));
Modified: box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/common/WaitForEvent.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -163,7 +163,7 @@
}
// Poll!
- switch(::poll(mpPollInfo, (unsigned int)mItems.size(), mTimeout))
+ switch(::poll(mpPollInfo, mItems.size(), mTimeout))
{
case -1:
// Interrupted system calls aren't an error, just equivalent to a timeout
Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -638,7 +638,7 @@
Write((int32_t)(rValue.size()));
WRITE_ENSURE_BYTES_AVAILABLE(rValue.size())
- Write(rValue.c_str(), (int)rValue.size());
+ Write(rValue.c_str(), rValue.size());
}
// --------------------------------------------------------------------------
@@ -706,11 +706,11 @@
}
// Inform sub class
- InformStreamSending((u_int32_t)streamSize);
+ InformStreamSending(streamSize);
// Make header
PW_ObjectHeader objHeader;
- objHeader.mObjSize = htonl((u_long)(uncertainSize?(ProtocolStream_SizeUncertain):streamSize));
+ objHeader.mObjSize = htonl(uncertainSize?(ProtocolStream_SizeUncertain):streamSize);
objHeader.mObjType = htonl(SPECIAL_STREAM_OBJECT_TYPE);
// Write header
Modified: box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/server/Protocol.h 2006-02-03 19:58:38 UTC (rev 364)
@@ -94,7 +94,7 @@
void Read(int32_t &rOut);
void Read(int16_t &rOut);
void Read(int8_t &rOut);
- void Read(bool &rOut) {bool read; Read(read); rOut = (read == true);}
+ void Read(bool &rOut) {int8_t read; Read(read); rOut = (read == true);}
void Read(std::string &rOut);
template<typename type>
void Read(type &rOut)
Modified: box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/server/SocketStream.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -70,7 +70,7 @@
//
// --------------------------------------------------------------------------
SocketStream::SocketStream(const SocketStream &rToCopy)
- : mSocketHandle(::dup((int)rToCopy.mSocketHandle)),
+ : mSocketHandle(::dup(rToCopy.mSocketHandle)),
mReadClosed(rToCopy.mReadClosed),
mWriteClosed(rToCopy.mWriteClosed)
Modified: box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/server/SocketStreamTLS.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -125,7 +125,7 @@
}
tOSSocketHandle socket = GetSocketHandle();
- BIO_set_fd(mpBIO, (int)socket, BIO_NOCLOSE);
+ BIO_set_fd(mpBIO, socket, BIO_NOCLOSE);
// Then the SSL object
mpSSL = ::SSL_new(rContext.GetRawContext());
Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -16,17 +16,16 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_PROCESS_H
+ #include <process.h>
+#endif
#include <string>
#include <list>
-#ifdef HAVE_PROCESS_H
- #include <process.h>
-#endif
+// our implementation for a timer, based on a
+// simple thread which sleeps for a period of time
-//our implimentation for a timer
-//based on a simple thread which sleeps for a
-//period of time
static bool gFinishTimer;
static CRITICAL_SECTION gLock;
@@ -35,9 +34,9 @@
int countDown;
int interval;
}
-tTimer;
+Timer_t;
-std::list<tTimer> gTimerList;
+std::list<Timer_t> gTimerList;
static void (__cdecl *gTimerFunc) (int) = NULL;
int setitimer(int type , struct itimerval *timeout, int)
@@ -53,7 +52,7 @@
}
else
{
- tTimer ourTimer;
+ Timer_t ourTimer;
ourTimer.countDown = timeout->it_value.tv_sec;
ourTimer.interval = timeout->it_interval.tv_sec;
gTimerList.push_back(ourTimer);
@@ -71,12 +70,12 @@
while (!gFinishTimer)
{
- std::list<tTimer>::iterator it;
+ std::list<Timer_t>::iterator it;
EnterCriticalSection(&gLock);
for (it = gTimerList.begin(); it != gTimerList.end(); it++)
{
- tTimer& rTimer(*it);
+ Timer_t& rTimer(*it);
rTimer.countDown --;
if (rTimer.countDown == 0)
@@ -99,7 +98,7 @@
for (it = gTimerList.begin(); it != gTimerList.end(); it++)
{
- tTimer& rTimer(*it);
+ Timer_t& rTimer(*it);
if (rTimer.countDown == -1)
{
Modified: box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp 2006-02-03 10:26:29 UTC (rev 363)
+++ box/chris/win32/vc2005-compile-fixes/test/win32/testlibwin32.cpp 2006-02-03 19:58:38 UTC (rev 364)
@@ -8,11 +8,11 @@
#include "../../bin/bbackupd/BackupDaemon.h"
#include "BoxPortsAndFiles.h"
+#include "emu.h"
-
int main(int argc, char* argv[])
{
- _chdir("c:\\tmp");
+ chdir("c:\\tmp");
openfile("test", O_CREAT, 0);
struct stat ourfs;
//test our opendir, readdir and closedir
More information about the Boxbackup-dev
mailing list