fix compiler warnings on osx 10.9

git-svn-id: http://encfs.googlecode.com/svn/branches/1.x@127 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
Valient Gough 2013-11-11 06:19:49 +00:00
parent 5fa5f02109
commit 96d21a4d54
11 changed files with 13 additions and 11 deletions

View File

@ -365,7 +365,7 @@ void BlockFileIO::padFile( off_t oldSize, off_t newSize, bool forceWrite )
MemoryPool::release( mb );
}
int BlockFileIO::truncate( off_t size, FileIO *base )
int BlockFileIO::truncateBase( off_t size, FileIO *base )
{
int partialBlock = size % _blockSize;
int res = 0;

View File

@ -46,7 +46,7 @@ public:
protected:
int truncate( off_t size, FileIO *base );
int truncateBase( off_t size, FileIO *base );
void padFile( off_t oldSize, off_t newSize, bool forceWrite );
// same as read(), except that the request.offset field is guarenteed to be

View File

@ -216,13 +216,12 @@ string Cipher::encodeAsString(const CipherKey &key,
unsigned char *keyBuf = new unsigned char[ encodedKeySize ];
// write the key, encoding it with itself.
this->writeKey( key, keyBuf, key );
this->writeKey( key, keyBuf, encodingKey );
int b64Len = B256ToB64Bytes( encodedKeySize );
unsigned char *b64Key = new unsigned char[ b64Len + 1 ];
changeBase2( keyBuf, encodedKeySize, 8, b64Key,
b64Len, 6 );
changeBase2( keyBuf, encodedKeySize, 8, b64Key, b64Len, 6 );
B64ToAscii( b64Key, b64Len );
b64Key[ b64Len - 1 ] = '\0';

View File

@ -406,7 +406,7 @@ int CipherFileIO::truncate( off_t size )
int res = 0;
if(!haveHeader)
{
res = BlockFileIO::truncate( size, base.get() );
res = BlockFileIO::truncateBase( size, base.get() );
} else
{
if(0 == fileIV)
@ -424,7 +424,7 @@ int CipherFileIO::truncate( off_t size )
// can't let BlockFileIO call base->truncate(), since it would be using
// the wrong size..
res = BlockFileIO::truncate( size, 0 );
res = BlockFileIO::truncateBase( size, 0 );
if(res == 0)
base->truncate( size + HEADER_SIZE );

View File

@ -78,7 +78,6 @@ private:
// if haveHeader is true, then we have a transparent file header which
// contains a 64 bit initialization vector.
bool haveHeader;
bool externalIVChaining;
uint64_t externalIV;
uint64_t fileIV;
int lastFlags;

View File

@ -38,7 +38,7 @@ enum ConfigType
Config_V6
};
class EncFS_Opts;
struct EncFS_Opts;
class Cipher;
class NameIO;

View File

@ -292,6 +292,7 @@ int FileNode::sync(bool datasync)
else
res = fsync( fh );
#else
(void)datasync;
// no fdatasync support
// TODO: use autoconfig to check for it..
res = fsync(fh);

View File

@ -292,7 +292,7 @@ int MACFileIO::truncate( off_t size )
int headerSize = macBytes + randBytes;
int bs = blockSize() + headerSize;
int res = BlockFileIO::truncate( size, 0 );
int res = BlockFileIO::truncateBase( size, 0 );
if(res == 0)
base->truncate( locWithHeader( size, bs, headerSize ) );

View File

@ -71,6 +71,7 @@ int NullNameIO::maxDecodedNameLen( int encodedNameLen ) const
int NullNameIO::encodeName( const char *plaintextName, int length,
uint64_t *iv, char *encodedName ) const
{
(void)iv;
memcpy( encodedName, plaintextName, length );
return length;
@ -79,6 +80,7 @@ int NullNameIO::encodeName( const char *plaintextName, int length,
int NullNameIO::decodeName( const char *encodedName, int length,
uint64_t *iv, char *plaintextName ) const
{
(void)iv;
memcpy( plaintextName, encodedName, length );
return length;

View File

@ -24,7 +24,7 @@
#include "Cipher.h"
#include "Interface.h"
struct SSLKey;
class SSLKey;
#ifndef EVP_CIPHER
struct evp_cipher_st;
typedef struct evp_cipher_st EVP_CIPHER;

View File

@ -297,6 +297,7 @@ static RootPtr initRootInfo(const char* crootDir)
static int cmd_showKey( int argc, char **argv )
{
(void)argc;
RootPtr rootInfo = initRootInfo(argv[1]);
if(!rootInfo)