### - remove paranthese warning

```- remove redundant double negation, as the type is already bool
- replaced inline condition with cast

closes #2491

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1270 fdac6126-5c0c-442c-9429-916003d36597```
parent e1a72035
 ... ... @@ -26,15 +26,14 @@ template <> struct binary< std::vector > for (idx=0; idx < N; ++idx) { bits = 0; bits = bits | (_v[idx+0] ? 1 : 0); bits = bits | ((_v[idx+1] ? 1 : 0) << 1); bits = bits | ((_v[idx+2] ? 1 : 0) << 2); bits = bits | ((_v[idx+3] ? 1 : 0) << 3); bits = bits | ((_v[idx+4] ? 1 : 0) << 4); bits = bits | ((_v[idx+5] ? 1 : 0) << 5); bits = bits | ((_v[idx+6] ? 1 : 0) << 6); bits = bits | ((_v[idx+7] ? 1 : 0) << 7); bits = static_cast(_v[idx]) | (static_cast(_v[idx+1]) << 1) | (static_cast(_v[idx+2]) << 2) | (static_cast(_v[idx+3]) << 3) | (static_cast(_v[idx+4]) << 4) | (static_cast(_v[idx+5]) << 5) | (static_cast(_v[idx+6]) << 6) | (static_cast(_v[idx+7]) << 7); _ostr << bits; } bytes = N; ... ... @@ -44,13 +43,13 @@ template <> struct binary< std::vector > bits = 0; switch(R) { case 7: bits = bits | ((_v[idx+6] ? 1 : 0) << 6); case 6: bits = bits | ((_v[idx+5] ? 1 : 0) << 5); case 5: bits = bits | ((_v[idx+4] ? 1 : 0) << 4); case 4: bits = bits | ((_v[idx+3] ? 1 : 0) << 3); case 3: bits = bits | ((_v[idx+2] ? 1 : 0) << 2); case 2: bits = bits | ((_v[idx+1] ? 1 : 0) << 1); case 1: bits = bits | (_v[idx+0] ? 1 : 0); case 7: bits |= (static_cast(_v[idx+6]) << 6); case 6: bits |= (static_cast(_v[idx+5]) << 5); case 5: bits |= (static_cast(_v[idx+4]) << 4); case 4: bits |= (static_cast(_v[idx+3]) << 3); case 3: bits |= (static_cast(_v[idx+2]) << 2); case 2: bits |= (static_cast(_v[idx+1]) << 1); case 1: bits |= static_cast(_v[idx+0]); } _ostr << bits; ++bytes; ... ...
 ... ... @@ -278,14 +278,14 @@ public: for (bidx=idx=0; idx < N; ++idx, bidx+=8) { bits = !!data_[bidx] | (!!data_[bidx+1] << 1) | (!!data_[bidx+2] << 2) | (!!data_[bidx+3] << 3) | (!!data_[bidx+4] << 4) | (!!data_[bidx+5] << 5) | (!!data_[bidx+6] << 6) | (!!data_[bidx+7] << 7); bits = static_cast(data_[bidx]) | (static_cast(data_[bidx+1]) << 1) | (static_cast(data_[bidx+2]) << 2) | (static_cast(data_[bidx+3]) << 3) | (static_cast(data_[bidx+4]) << 4) | (static_cast(data_[bidx+5]) << 5) | (static_cast(data_[bidx+6]) << 6) | (static_cast(data_[bidx+7]) << 7); _ostr << bits; } bytes = N; ... ... @@ -320,14 +320,14 @@ public: for (bidx=idx=0; idx < N; ++idx, bidx+=8) { _istr >> bits; data_[bidx+0] = !!(bits & 0x01); data_[bidx+1] = !!(bits & 0x02); data_[bidx+2] = !!(bits & 0x04); data_[bidx+3] = !!(bits & 0x08); data_[bidx+4] = !!(bits & 0x10); data_[bidx+5] = !!(bits & 0x20); data_[bidx+6] = !!(bits & 0x40); data_[bidx+7] = !!(bits & 0x80); data_[bidx+0] = (bits & 0x01) != 0; data_[bidx+1] = (bits & 0x02) != 0; data_[bidx+2] = (bits & 0x04) != 0; data_[bidx+3] = (bits & 0x08) != 0; data_[bidx+4] = (bits & 0x10) != 0; data_[bidx+5] = (bits & 0x20) != 0; data_[bidx+6] = (bits & 0x40) != 0; data_[bidx+7] = (bits & 0x80) != 0; } bytes = N; ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
{"ft_lang_label":"__label__en","ft_lang_prob":0.63064396,"math_prob":0.99981016,"size":310,"snap":"2022-05-2022-21","text_gpt3_token_len":89,"char_repetition_ratio":0.039215688,"word_repetition_ratio":0.0,"special_character_ratio":0.30645162,"punctuation_ratio":0.09615385,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99965405,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-25T20:29:19Z\",\"WARC-Record-ID\":\"<urn:uuid:b2a2cb3e-187c-45de-b34c-fc94ce479431>\",\"Content-Length\":\"253941\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c5386d36-21d9-47f4-a5d1-18a8b81d1c62>\",\"WARC-Concurrent-To\":\"<urn:uuid:00ab0256-ca6d-4780-ae86-039cdc59d8f4>\",\"WARC-IP-Address\":\"137.226.35.172\",\"WARC-Target-URI\":\"https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/commit/ae7f75d8810bf63d3cac858d45baa908add1d437\",\"WARC-Payload-Digest\":\"sha1:RE2C5IHLZ333UM3VU6Y7AP5YFBCCGJHX\",\"WARC-Block-Digest\":\"sha1:BLRJOY36ZIOKRUCDUM52MIQDT7I6B5MD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662593428.63_warc_CC-MAIN-20220525182604-20220525212604-00646.warc.gz\"}"}