Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

(WIP)cpp-ethereum#4598 1)Switch to C++17 style byte. 2)Fixed all compiler … #4672

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ghost
Copy link

@ghost ghost commented Dec 1, 2017

This PR:

  1. Switch to C++17 style byte.
  2. Fixed all compiler errors in libdevcore directory.

According to a C++ 17 doc,

  1. std::byte is not an integer and not a character.
  2. std::byte is storage of bits.

So, I have to define all operators for the new byte. It looks a little messy, but I can gradually change all functions so that those crypto functions don’t require int, char and bigint to interact with byte. In this way, the code should be much nicer~

@gumb0
Copy link
Member

gumb0 commented Dec 5, 2017

Please fix CI build failures, for example

In file included from /home/travis/build/ethereum/cpp-ethereum/libdevcore/OverlayDB.cpp:23:0:
/home/travis/build/ethereum/cpp-ethereum/libdevcore/TrieDB.h: In member function ‘void dev::GenericTrieDB<_DB>::iterator::Node::incrementChild()’:
/home/travis/build/ethereum/cpp-ethereum/libdevcore/TrieDB.h:144:83: error: operands to ?: have different types ‘int’ and ‘dev::byte’
    void incrementChild() { child = child == 16 ? 0 : child == 15 ? 17 : (child + 1); }
                                                                                   ^
C:\projects\cpp-ethereum\libdevcore\CommonJS.cpp(73): error C2593: 'operator ==' is ambiguous [C:\projects\cpp-ethereum\build\libdevcore\devcore.vcxproj]

@ghost ghost changed the title cpp-ethereum#4598 1)Switch to C++17 style byte. 2)Fixed all compiler … (WIP)cpp-ethereum#4598 1)Switch to C++17 style byte. 2)Fixed all compiler … Dec 19, 2017
@chfast chfast changed the base branch from develop to master August 2, 2018 08:39
Copy link

@chamajcpradel chamajcpradel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sirs. I agree to these changes. kindly do the needful to fix conflicts. I cannot merge branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants