clean up some formatting issues w/ standard type PR, etc.
This commit is contained in:
parent
c9e32170ba
commit
15dfea4d85
|
@ -104,7 +104,7 @@ typedef struct {
|
|||
haval_word count[2]; /* number of bits in a message */
|
||||
haval_word fingerprint[8]; /* current state of fingerprint */
|
||||
haval_word block[32]; /* buffer for a 32-word block */
|
||||
uint8_t remainder[32*4]; /* unhashed chars (No.<128) */
|
||||
uint8_t remainder[32*4]; /* unhashed chars (No.<128) */
|
||||
} haval_state;
|
||||
|
||||
/* Do not remove this line. Protyping depends on it!
|
||||
|
|
|
@ -194,7 +194,7 @@ cBlockFile::Block* cBlockFile::GetBlock(int blockNum) //throw (eArchive)
|
|||
#endif
|
||||
d.TraceNever("\tBlock %d was not in memory; paging it in\n", blockNum);
|
||||
|
||||
uint32_t earliestTime = mvPagedBlocks[0].GetTimestamp();
|
||||
uint32_t earliestTime = mvPagedBlocks[0].GetTimestamp();
|
||||
BlockVector::iterator it = mvPagedBlocks.begin();
|
||||
BlockVector::iterator earliestIter = it;
|
||||
++it; // since we don't want to check the first one
|
||||
|
|
|
@ -113,7 +113,7 @@ private:
|
|||
|
||||
int mNumPages;
|
||||
int mNumBlocks; // the total number of blocks in the archive.
|
||||
uint32_t mTimer; // keeps track of the current "time"
|
||||
uint32_t mTimer; // keeps track of the current "time"
|
||||
cBidirArchive* mpArchive; // note: I always own the deletion of the archive
|
||||
BlockVector mvPagedBlocks;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ void cFCOSpecAttr::Read(iSerializer* pSerializer, int32_t version)
|
|||
pSerializer->ReadString(mName);
|
||||
pSerializer->ReadInt32(mSeverity);
|
||||
|
||||
int32_t size;
|
||||
int32_t size;
|
||||
TSTRING str;
|
||||
pSerializer->ReadInt32(size);
|
||||
mEmailAddrs.clear();
|
||||
|
|
|
@ -103,6 +103,7 @@ void cFCOSpecList::Add(iFCOSpec* pSpec, cFCOSpecAttr* pAttr)
|
|||
pAttr = new cFCOSpecAttr;
|
||||
else
|
||||
pAttr->AddRef();
|
||||
|
||||
for (itr = mCanonicalList.begin();; ++itr)
|
||||
{
|
||||
if (itr == mCanonicalList.end() || iFCOSpecUtil::FCOSpecLessThan(*pSpec, *itr->first))
|
||||
|
@ -118,18 +119,22 @@ iFCOSpec* cFCOSpecList::Lookup(iFCOSpec* pSpec) const
|
|||
{
|
||||
std::list<PairType>::iterator itr;
|
||||
for (itr = mCanonicalList.begin(); itr != mCanonicalList.end(); ++itr)
|
||||
{
|
||||
if (itr->first == pSpec)
|
||||
{
|
||||
pSpec->AddRef();
|
||||
return itr->first;
|
||||
}
|
||||
}
|
||||
|
||||
for (itr = mCanonicalList.begin(); itr != mCanonicalList.end(); ++itr)
|
||||
{
|
||||
if (iFCOSpecUtil::FCOSpecEqual(*pSpec, *itr->first))
|
||||
{
|
||||
itr->first->AddRef();
|
||||
return itr->first;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -141,11 +146,10 @@ void cFCOSpecList::Read(iSerializer* pSerializer, int32_t version)
|
|||
|
||||
Clear();
|
||||
|
||||
int i;
|
||||
int32_t size;
|
||||
pSerializer->ReadInt32(size);
|
||||
|
||||
for (i = 0; i < size; ++i)
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
iFCOSpec* pReadInSpec = static_cast<iFCOSpec*>(pSerializer->ReadObjectDynCreate());
|
||||
cFCOSpecAttr* pSpecAttr = static_cast<cFCOSpecAttr*>(pSerializer->ReadObjectDynCreate());
|
||||
|
|
|
@ -110,7 +110,7 @@ void cArchiveSigGen::CalculateSignatures(cArchive& a)
|
|||
uint8_t abBuf[iSignature::SUGGESTED_BLOCK_SIZE * 2];
|
||||
int cbRead;
|
||||
container_type::size_type i;
|
||||
uint8_t* pBuf = abBuf;
|
||||
uint8_t* pBuf = abBuf;
|
||||
|
||||
if (s_direct)
|
||||
{
|
||||
|
|
|
@ -128,10 +128,10 @@ private:
|
|||
|
||||
typedef std::map<int64_t, TSTRING> INT64_TO_STRING_MAP;
|
||||
|
||||
bool GetUsername( const int64_t& i64uid, TSTRING& tstrUsername) const;
|
||||
bool GetGroupname( const int64_t& i64uid, TSTRING& tstrGroupname) const;
|
||||
bool AddUsernameMapping( const int64_t& i64ID, const TSTRING& tstrUsername);
|
||||
bool AddGroupnameMapping( const int64_t& i64ID, const TSTRING& tstrGroupname);
|
||||
bool GetUsername(const int64_t& i64uid, TSTRING& tstrUsername) const;
|
||||
bool GetGroupname(const int64_t& i64uid, TSTRING& tstrGroupname) const;
|
||||
bool AddUsernameMapping(const int64_t& i64ID, const TSTRING& tstrUsername);
|
||||
bool AddGroupnameMapping(const int64_t& i64ID, const TSTRING& tstrGroupname);
|
||||
|
||||
// storage for conversion stuff
|
||||
INT64_TO_STRING_MAP uidToUsername;
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
const iFCOPropDisplayer* GetPropDisplayer() const;
|
||||
|
||||
void SetObjectsScanned(int32_t);
|
||||
int32_t GetObjectsScanned() const;
|
||||
int32_t GetObjectsScanned() const;
|
||||
|
||||
// iSerializable interface
|
||||
virtual void Read(iSerializer* pSerializer, int32_t version = 0); // throw (eSerializer, eArchive)
|
||||
|
@ -130,7 +130,7 @@ private:
|
|||
cGenreHeaderInfo& operator=(cGenreHeaderInfo&);
|
||||
|
||||
iFCOPropDisplayer* mpPropDisplayer;
|
||||
int32_t i32_ObjectsScanned;
|
||||
int32_t i32_ObjectsScanned;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
// these methods get and set the executable's working directory ... it is asserted
|
||||
// that SetExeDir() has been called when GetExeDir() is called.
|
||||
|
||||
static int64_t GetExeStartTime();
|
||||
static int64_t GetExeStartTime();
|
||||
static void SetExeStartTime(const int64_t& time);
|
||||
// Get and set the approximate time (time_t format) which the excecutable was started.
|
||||
// This will be used for all times having to do with this run of the executable.
|
||||
|
|
|
@ -46,8 +46,8 @@ struct tGK
|
|||
{
|
||||
bool doneFlag;
|
||||
int retValue;
|
||||
int8_t* passphrase;
|
||||
int32_t passphraseLen;
|
||||
int8_t* passphrase;
|
||||
int32_t passphraseLen;
|
||||
const TCHAR* keyPath;
|
||||
|
||||
enum ReturnValue
|
||||
|
|
|
@ -2062,10 +2062,10 @@ static bool ChangePassphrase(const TCHAR* keyPath, wc16_string passphraseOld, wc
|
|||
// we must allocate a BIGENDIAN copy
|
||||
// and delete it before we return.
|
||||
// auto_ptr does not help (won't work with arrays).
|
||||
size_t passphraseLenOld = passphraseOld.length() * sizeof(WCHAR16);
|
||||
size_t passphraseLen = passphrase.length() * sizeof(WCHAR16);
|
||||
int8_t* passphraseCopyOld = new int8_t[passphraseLenOld];
|
||||
int8_t* passphraseCopy = new int8_t[passphraseLen];
|
||||
size_t passphraseLenOld = passphraseOld.length() * sizeof(WCHAR16);
|
||||
size_t passphraseLen = passphrase.length() * sizeof(WCHAR16);
|
||||
int8_t* passphraseCopyOld = new int8_t[passphraseLenOld];
|
||||
int8_t* passphraseCopy = new int8_t[passphraseLen];
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
memcpy(passphraseCopyOld, passphraseOld.data(), passphraseLenOld);
|
||||
memcpy(passphraseCopy, passphrase.data(), passphraseLen);
|
||||
|
|
|
@ -343,7 +343,7 @@ void cKeyFile::WriteMem(int8_t* pMem) const // throw eKeyFile()
|
|||
memcpy(pMem, mpPrivateKeyMem, mPrivateKeyMemLen);
|
||||
}
|
||||
|
||||
int32_t cKeyFile::GetWriteLen() // throw eKeyFile()
|
||||
int cKeyFile::GetWriteLen() // throw eKeyFile()
|
||||
{
|
||||
if (!KeysLoaded())
|
||||
{
|
||||
|
@ -359,7 +359,7 @@ int32_t cKeyFile::GetWriteLen() // throw eKeyFile()
|
|||
mPrivateKeyMemLen; // the private key
|
||||
}
|
||||
|
||||
void cKeyFile::ProtectKeys(int8_t* passphrase, int32_t passphraseLen) // throw eKeyFile()
|
||||
void cKeyFile::ProtectKeys(int8_t* passphrase, int passphraseLen) // throw eKeyFile()
|
||||
{
|
||||
int i;
|
||||
int16_t i16;
|
||||
|
@ -470,7 +470,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
ASSERT(des.GetBlockSizeCipher() == des.GetBlockSizePlain());
|
||||
|
||||
// get a copy of the ciphertext and decrypt it
|
||||
uint8_t* plainPrivateKeyMem = new uint8_t[mPrivateKeyMemLen];
|
||||
int8_t* plainPrivateKeyMem = new int8_t[mPrivateKeyMemLen];
|
||||
memcpy(plainPrivateKeyMem, mpPrivateKeyMem, mPrivateKeyMemLen);
|
||||
|
||||
ASSERT(mPrivateKeyMemLen % des.GetBlockSizePlain() == 0);
|
||||
|
@ -486,7 +486,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
|
||||
if (len + cHashedKey128::GetWriteLen() + sizeof(int16_t) > (unsigned int)mPrivateKeyMemLen)
|
||||
{
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
return 0;
|
||||
|
@ -498,7 +498,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
if (memcmp(plainPrivateKeyMem, privateHash.GetKey(), cHashedKey128::GetWriteLen()) != 0)
|
||||
{
|
||||
// passphrase didn't do the job
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
return 0;
|
||||
|
@ -506,7 +506,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
|
||||
mpPrivateKey = new cElGamalSigPrivateKey(plainPrivateKeyMem + cHashedKey128::GetWriteLen() + sizeof(int16_t));
|
||||
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
void ReadMem(const int8_t* pMem); // throw eKeyFile()
|
||||
void WriteMem(int8_t* pMem) const; // throw eKeyFile()
|
||||
int GetWriteLen(); // throw eKeyFile()
|
||||
int GetWriteLen(); // throw eKeyFile()
|
||||
// Functions to read and write the key to memory. GetWriteLen() will throw an
|
||||
// exception if keys are not currently loaded.
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ void TestItoa()
|
|||
//
|
||||
// setup
|
||||
//
|
||||
int32_t n = 123456;
|
||||
int32_t n = 123456;
|
||||
TSTRING str;
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue