Skip to content

Commit

Permalink
Merge pull request EOSIO#150 from EOSIO/fix/quick_fixes
Browse files Browse the repository at this point in the history
quick fixes
  • Loading branch information
larryk85 authored Oct 11, 2018
2 parents 10e40ff + c1bbc63 commit d86775e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eosio_llvm
Submodule eosio_llvm updated 1 files
+1 −1 tools/clang
8 changes: 5 additions & 3 deletions examples/abigen_test/abitest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ namespace test {
};

struct testb {
float field;
void printll() { print("testb"); }
};

// mark this struct as an action and specify the name explicitly
struct [[ eosio::action("testc") ]] test_c : testb {
struct [[ using eosio: action("testc"), contract("abitest") ]] test_c : testb {
uint64_t num;
};
}
Expand All @@ -32,6 +33,7 @@ CONTRACT abitest : public eosio::contract {
[[ eosio::action("testacta") ]]
void testact_a( name user, const std::string& s, std::vector<int>& c, std::vector<std::string> sv ) {
print( "Hello, ", name{user} );
symbol sym("TEST", 4);
}

// mark this method as an action
Expand Down Expand Up @@ -59,6 +61,6 @@ typedef eosio::multi_index< "testtab"_n, abitest::testtable > testtable_t;
typedef eosio::multi_index< "testtaba"_n, abitest::testtable > testtable_a_t;
typedef eosio::multi_index< "testtab2"_n, abitest::test_table2 > testtable2_t;

// NOTE THIS IS A TEST CONTRACT AND WILL NOT WORK CORRECTLY, the action `testa` will not be in the dispatcher of this macro
extern "C"
void apply(uint64_t, uint64_t, uint64_t){}
void apply(uint64_t, uint64_t, uint64_t){
}
4 changes: 4 additions & 0 deletions libraries/eosiolib/symbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ namespace eosio {
: value( (sc.raw() << 8) | static_cast<uint64_t>(precision) )
{}

constexpr symbol( std::string_view ss, uint8_t precision )
: value( (symbol_code(ss).raw() << 8) | static_cast<uint64_t>(precision) )
{}

/**
* Is this symbol valid
*/
Expand Down
2 changes: 1 addition & 1 deletion libraries/libc++/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET(SRC_FILENAMES algorithm.cpp any.cpp bind.cpp condition_variable.cpp functional.cpp
future.cpp ios.cpp iostream.cpp locale.cpp memory.cpp mutex.cpp new.cpp optional.cpp
regex.cpp stdexcept.cpp string.cpp strstream.cpp system_error.cpp
regex.cpp stdexcept.cpp string.cpp strstream.cpp system_error.cpp exception.cpp
typeinfo.cpp utility.cpp valarray.cpp variant.cpp vector.cpp eosio.cpp)

SET(SRC_FILES "")
Expand Down
2 changes: 1 addition & 1 deletion libraries/libc++/libcxx

0 comments on commit d86775e

Please sign in to comment.