diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-30 09:04:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-30 11:48:57 +0100 |
commit | dea94c8899842dd687777e99ca2efb1a6a21d7a2 (patch) | |
tree | 3d0f71dae83e5cd38d12bd01b1c5005c358c0bf4 | |
parent | 7a211e834fc271d3f28d7f8c49197c925242d862 (diff) |
coverity#706008 Unintended sign extension
Change-Id: I60f3404ae87aa0d1088110715d0ba1dd32fab09d
-rw-r--r-- | hwpfilter/source/hiodev.cxx | 4 | ||||
-rw-r--r-- | hwpfilter/source/hiodev.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index 577b5f854c9a..d5f993d500c2 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -201,7 +201,7 @@ int HStreamIODev::read2b() } -long HStreamIODev::read4b() +int HStreamIODev::read4b() { int res = (compressed) ? GZREAD(rBuf, 4) : _stream.readBytes(rBuf, 4); @@ -318,7 +318,7 @@ int HMemIODev::read2b() } -long HMemIODev::read4b() +int HMemIODev::read4b() { pos += 4; if (pos <= length) diff --git a/hwpfilter/source/hiodev.h b/hwpfilter/source/hiodev.h index bc8a82b7f107..40783f5f9cf3 100644 --- a/hwpfilter/source/hiodev.h +++ b/hwpfilter/source/hiodev.h @@ -53,7 +53,7 @@ class DLLEXPORT HIODev virtual int read1b() = 0; virtual int read2b() = 0; - virtual long read4b() = 0; + virtual int read4b() = 0; virtual int readBlock( void *ptr, int size ) = 0; virtual int skipBlock( int size ) = 0; @@ -113,7 +113,7 @@ class HStreamIODev : public HIODev * Read 4 bytes from stream */ using HIODev::read4b; - virtual long read4b() SAL_OVERRIDE; + virtual int read4b() SAL_OVERRIDE; /** * Read some bytes from stream to given pointer as amount of size */ @@ -153,7 +153,7 @@ class HMemIODev : public HIODev using HIODev::read2b; virtual int read2b() SAL_OVERRIDE; using HIODev::read4b; - virtual long read4b() SAL_OVERRIDE; + virtual int read4b() SAL_OVERRIDE; virtual int readBlock( void *ptr, int size ) SAL_OVERRIDE; virtual int skipBlock( int size ) SAL_OVERRIDE; protected: |