diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:26:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:22 +0200 |
commit | 691197bff74e4a53dcb8864d0770338b9f2af402 (patch) | |
tree | 4ecddb2564b6e49c227feacdcbe3922e738dc13f /hwpfilter | |
parent | 9b8dc2ad4d55a32c937b2e1410c6cfb908739449 (diff) |
loplugin:simplifybool
Change-Id: Ic42cf05f9eddb0cd7724d16cc73a8d6495c193f2
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/drawing.h | 4 | ||||
-rw-r--r-- | hwpfilter/source/hinfo.cxx | 6 | ||||
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h index 9a9e7b4b5fc1..42e84ec464aa 100644 --- a/hwpfilter/source/drawing.h +++ b/hwpfilter/source/drawing.h @@ -167,8 +167,8 @@ static int ReadSizeField(int size) static bool SkipUnusedField(void) { - return (SizeExpected < SizeRead) ? - hmem->skipBlock(SizeRead - SizeExpected) != 0 : true; + return (SizeExpected >= SizeRead) && + hmem->skipBlock(SizeRead - SizeExpected) != 0; } diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx index 4a8f35f6acd6..96de6d753d0b 100644 --- a/hwpfilter/source/hinfo.cxx +++ b/hwpfilter/source/hinfo.cxx @@ -32,7 +32,7 @@ static bool HWPReadInfoBlock(void *ptr, int len, HWPFile & hwpf) if (0 == len) return true; else - return hwpf.ReadBlock(ptr, len) ? true : false; + return hwpf.ReadBlock(ptr, len) != 0; } @@ -170,8 +170,8 @@ bool HWPInfo::Read(HWPFile & hwpf) } /* hwpf의 값을 재설정 한다. */ - hwpf.compressed = compressed ? true : false; - hwpf.encrypted = encrypted ? true : false; + hwpf.compressed = compressed != 0; + hwpf.encrypted = encrypted != 0; hwpf.info_block_len = info_block_len; hwpf.SetCompressed(hwpf.compressed); diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index b80f8c1fd05e..141fd7ff2f1e 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -140,7 +140,7 @@ int HWPFile::SetState(int errcode) bool HWPFile::Read1b(unsigned char &out) { - return hiodev ? hiodev->read1b(out) : false; + return hiodev && hiodev->read1b(out); } bool HWPFile::Read1b(char &out) @@ -154,12 +154,12 @@ bool HWPFile::Read1b(char &out) bool HWPFile::Read2b(unsigned short &out) { - return hiodev ? hiodev->read2b(out) : false; + return hiodev && hiodev->read2b(out); } bool HWPFile::Read4b(unsigned int &out) { - return hiodev ? hiodev->read4b(out) : false; + return hiodev && hiodev->read4b(out); } bool HWPFile::Read4b(int &out) @@ -202,7 +202,7 @@ size_t HWPFile::SkipBlock(size_t size) bool HWPFile::SetCompressed(bool flag) { - return hiodev ? hiodev->setCompressed(flag) : false; + return hiodev && hiodev->setCompressed(flag); } |