From 96d21a4d548c690499c363352d94c78c450bf0bb Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Mon, 11 Nov 2013 06:19:49 +0000 Subject: [PATCH] fix compiler warnings on osx 10.9 git-svn-id: http://encfs.googlecode.com/svn/branches/1.x@127 db9cf616-1c43-0410-9cb8-a902689de0d6 --- encfs/BlockFileIO.cpp | 2 +- encfs/BlockFileIO.h | 2 +- encfs/Cipher.cpp | 5 ++--- encfs/CipherFileIO.cpp | 4 ++-- encfs/CipherFileIO.h | 1 - encfs/FSConfig.h | 2 +- encfs/FileNode.cpp | 1 + encfs/MACFileIO.cpp | 2 +- encfs/NullNameIO.cpp | 2 ++ encfs/SSL_Cipher.h | 2 +- encfs/encfsctl.cpp | 1 + 11 files changed, 13 insertions(+), 11 deletions(-) diff --git a/encfs/BlockFileIO.cpp b/encfs/BlockFileIO.cpp index 730750c..18744c0 100644 --- a/encfs/BlockFileIO.cpp +++ b/encfs/BlockFileIO.cpp @@ -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; diff --git a/encfs/BlockFileIO.h b/encfs/BlockFileIO.h index 2a76d78..8ce639c 100644 --- a/encfs/BlockFileIO.h +++ b/encfs/BlockFileIO.h @@ -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 diff --git a/encfs/Cipher.cpp b/encfs/Cipher.cpp index 5022724..592e842 100644 --- a/encfs/Cipher.cpp +++ b/encfs/Cipher.cpp @@ -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'; diff --git a/encfs/CipherFileIO.cpp b/encfs/CipherFileIO.cpp index 3aac6ca..2cb6eb6 100644 --- a/encfs/CipherFileIO.cpp +++ b/encfs/CipherFileIO.cpp @@ -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 ); diff --git a/encfs/CipherFileIO.h b/encfs/CipherFileIO.h index d8fd4bf..8771b99 100644 --- a/encfs/CipherFileIO.h +++ b/encfs/CipherFileIO.h @@ -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; diff --git a/encfs/FSConfig.h b/encfs/FSConfig.h index 6689330..c1a443b 100644 --- a/encfs/FSConfig.h +++ b/encfs/FSConfig.h @@ -38,7 +38,7 @@ enum ConfigType Config_V6 }; -class EncFS_Opts; +struct EncFS_Opts; class Cipher; class NameIO; diff --git a/encfs/FileNode.cpp b/encfs/FileNode.cpp index dabda8a..0fababd 100644 --- a/encfs/FileNode.cpp +++ b/encfs/FileNode.cpp @@ -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); diff --git a/encfs/MACFileIO.cpp b/encfs/MACFileIO.cpp index f7180fd..8903c22 100644 --- a/encfs/MACFileIO.cpp +++ b/encfs/MACFileIO.cpp @@ -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 ) ); diff --git a/encfs/NullNameIO.cpp b/encfs/NullNameIO.cpp index 240e616..e1da080 100644 --- a/encfs/NullNameIO.cpp +++ b/encfs/NullNameIO.cpp @@ -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; diff --git a/encfs/SSL_Cipher.h b/encfs/SSL_Cipher.h index 1adadc4..9c776fa 100644 --- a/encfs/SSL_Cipher.h +++ b/encfs/SSL_Cipher.h @@ -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; diff --git a/encfs/encfsctl.cpp b/encfs/encfsctl.cpp index 369c37a..dd2ceff 100644 --- a/encfs/encfsctl.cpp +++ b/encfs/encfsctl.cpp @@ -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)