[Libreoffice-commits] .: 3 commits - vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Jun 3 05:41:21 PDT 2011
vcl/source/fontsubset/cff.cxx | 13 +++++++------
vcl/source/fontsubset/sft.cxx | 10 ++++++----
vcl/unx/generic/app/saldata.cxx | 2 +-
vcl/unx/generic/app/sm.cxx | 2 +-
vcl/unx/headless/svpinst.cxx | 3 +--
5 files changed, 16 insertions(+), 14 deletions(-)
New commits:
commit 80f6716d845178cc2aa6b2f2a29cf698d267f991
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 3 13:29:23 2011 +0100
WaE: various warnings
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4dac025..e5a51bb 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -112,7 +112,7 @@ typedef struct {
typedef struct {
FILE *o;
char buffer[HFORMAT_LINELEN];
- int bufpos;
+ size_t bufpos;
int total;
} HexFmt;
@@ -435,15 +435,17 @@ static HexFmt *HexFmtNew(FILE *outf)
return res;
}
-static void HexFmtFlush(HexFmt *_this)
+static bool HexFmtFlush(HexFmt *_this)
{
+ bool bRet = true;
if (_this->bufpos) {
- fwrite(_this->buffer, 1, _this->bufpos, _this->o);
+ size_t nWritten = fwrite(_this->buffer, 1, _this->bufpos, _this->o);
+ bRet = nWritten == _this->bufpos;
_this->bufpos = 0;
}
+ return bRet;
}
-
_inline void HexFmtOpenString(HexFmt *_this)
{
fputs("<\n", _this->o);
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index bc494d0..a68f983 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -801,7 +801,7 @@ void SalXLib::Yield( bool bWait, bool bHandleAllCurrentEvents )
void SalXLib::Wakeup()
{
- write (m_pTimeoutFDS[1], "", 1);
+ OSL_VERIFY(write (m_pTimeoutFDS[1], "", 1) == 1);
}
void SalXLib::PostUserEvent()
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 3539673..300bd7e 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -657,7 +657,7 @@ void ICEConnectionObserver::deactivate()
void ICEConnectionObserver::wakeup()
{
char cChar = 'w';
- write( nWakeupFiles[1], &cChar, 1 );
+ OSL_VERIFY(write( nWakeupFiles[1], &cChar, 1 ) == 1);
}
void ICEConnectionWorker( void* )
commit a6b3041ccbcef70cebe90147872ffad48e23c4fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 3 12:47:34 2011 +0100
propogate amount written up a level
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 27e790e..150acc7 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1873,12 +1873,12 @@ public:
/*virtual*/ ~Type1Emitter( void);
void setSubsetName( const char* );
- void emitRawData( const char* pData, int nLength) const;
+ size_t emitRawData( const char* pData, size_t nLength) const;
void emitAllRaw( void);
void emitAllHex( void);
void emitAllCrypted( void);
int tellPos( void) const;
- void updateLen( int nTellPos, int nLength);
+ size_t updateLen( int nTellPos, size_t nLength);
void emitValVector( const char* pLineHead, const char* pLineTail, const ValVector&);
private:
FILE* mpFileOut;
@@ -1951,7 +1951,7 @@ int Type1Emitter::tellPos( void) const
// --------------------------------------------------------------------
-void Type1Emitter::updateLen( int nTellPos, int nLength)
+size_t Type1Emitter::updateLen( int nTellPos, size_t nLength)
{
// update PFB segment header length
U8 cData[4];
@@ -1961,15 +1961,16 @@ void Type1Emitter::updateLen( int nTellPos, int nLength)
cData[3] = static_cast<U8>(nLength >> 24);
const int nCurrPos = ftell( mpFileOut);
fseek( mpFileOut, nTellPos, SEEK_SET);
- fwrite( cData, 1, sizeof(cData), mpFileOut);
+ size_t nWrote = fwrite( cData, 1, sizeof(cData), mpFileOut);
fseek( mpFileOut, nCurrPos, SEEK_SET);
+ return nWrote;
}
// --------------------------------------------------------------------
-inline void Type1Emitter::emitRawData( const char* pData, int nLength) const
+inline size_t Type1Emitter::emitRawData(const char* pData, size_t nLength) const
{
- fwrite( pData, 1, nLength, mpFileOut);
+ return fwrite( pData, 1, nLength, mpFileOut);
}
// --------------------------------------------------------------------
commit 15e06bd81883c42107a500d97859816aae2cfa46
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 3 12:41:22 2011 +0100
silence warning for unchecked write
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index 7ecb628..8b21584 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -185,10 +185,9 @@ void SvpSalInstance::deregisterFrame( SalFrame* pFrame )
void SvpSalInstance::Wakeup()
{
- write (m_pTimeoutFDS[1], "", 1);
+ OSL_VERIFY(write (m_pTimeoutFDS[1], "", 1) == 1);
}
-
// -=-= timeval =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
inline int operator >= ( const timeval &t1, const timeval &t2 )
{
More information about the Libreoffice-commits
mailing list