提交 e18a1564 编写于 作者: K Khaled Al-Hassanieh

Fixed multiple warnings - 3

上级 46f46522
...@@ -152,7 +152,7 @@ void test_action::test_cf_action() { ...@@ -152,7 +152,7 @@ void test_action::test_cf_action() {
publication_time(); publication_time();
eosio_assert( false, "system_api should not be allowed" ); eosio_assert( false, "system_api should not be allowed" );
} else if ( cfa.payload == 210 ) { } else if ( cfa.payload == 210 ) {
send_inline( "hello", 6 ); send_inline( (char*)"hello", 6 );
eosio_assert( false, "transaction_api should not be allowed" ); eosio_assert( false, "transaction_api should not be allowed" );
} else if ( cfa.payload == 211 ) { } else if ( cfa.payload == 211 ) {
send_deferred( N(testapi), N(testapi), "hello", 6 ); send_deferred( N(testapi), N(testapi), "hello", 6 );
......
...@@ -74,13 +74,13 @@ void test_datastream::test_basic() ...@@ -74,13 +74,13 @@ void test_datastream::test_basic()
int a[2]; int a[2];
bool operator==(const StaticArray &o) const { return a[0] == o.a[0] && a[1] == o.a[1]; } bool operator==(const StaticArray &o) const { return a[0] == o.a[0] && a[1] == o.a[1]; }
}; };
testtype<StaticArray>::run({10,20}, "StaticArray"); testtype<StaticArray>::run({{10,20}}, "StaticArray");
testtype<std::string>::run("hello", "string"); testtype<std::string>::run("hello", "string");
testtype<std::vector<int> >::run({10,20,30}, "vector"); testtype<std::vector<int> >::run({10,20,30}, "vector");
testtype<std::vector<int> >::run({}, "empty vector"); testtype<std::vector<int> >::run({}, "empty vector");
testtype<std::array<int, 3> >::run({10,20,30}, "std::array<T,N>"); testtype<std::array<int, 3> >::run({{10,20,30}}, "std::array<T,N>");
testtype<std::map<int, std::string> >::run({{1,"apple"}, {2,"cat"}, {3,"panda"}}, "map"); testtype<std::map<int, std::string> >::run({{1,"apple"}, {2,"cat"}, {3,"panda"}}, "map");
testtype<std::tuple<int, std::string, double> >::run({1, "abc", 3.3333}, "tuple"); testtype<std::tuple<int, std::string, double> >::run({1, "abc", 3.3333}, "tuple");
} }
......
...@@ -536,6 +536,9 @@ void test_db::idx_double_nan_lookup_fail(uint64_t receiver, uint64_t, uint64_t) ...@@ -536,6 +536,9 @@ void test_db::idx_double_nan_lookup_fail(uint64_t receiver, uint64_t, uint64_t)
} }
} }
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
void test_db::misaligned_secondary_key256_tests(uint64_t /* receiver */, uint64_t, uint64_t) { void test_db::misaligned_secondary_key256_tests(uint64_t /* receiver */, uint64_t, uint64_t) {
auto key = eosio::key256::make_from_word_sequence<uint64_t>(0ULL, 0ULL, 0ULL, 42ULL); auto key = eosio::key256::make_from_word_sequence<uint64_t>(0ULL, 0ULL, 0ULL, 42ULL);
char* ptr = (char*)(&key); char* ptr = (char*)(&key);
...@@ -545,3 +548,5 @@ void test_db::misaligned_secondary_key256_tests(uint64_t /* receiver */, uint64_ ...@@ -545,3 +548,5 @@ void test_db::misaligned_secondary_key256_tests(uint64_t /* receiver */, uint64_
// test that find_primary doesn't crash on unaligned data // test that find_primary doesn't crash on unaligned data
db_idx256_find_primary( N(testapi), N(testtable), N(testapi), (eosio::key256*)(ptr), 2, 0); db_idx256_find_primary( N(testapi), N(testtable), N(testapi), (eosio::key256*)(ptr), 2, 0);
} }
#pragma clang diagnostic pop
...@@ -657,7 +657,7 @@ namespace fc ...@@ -657,7 +657,7 @@ namespace fc
return; return;
} }
default: default:
FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + v.get_type() ); FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + std::to_string( v.get_type() ) );
} }
} }
......
...@@ -34,7 +34,7 @@ CFDictionaryRef CopyOurKeyInfo() { ...@@ -34,7 +34,7 @@ CFDictionaryRef CopyOurKeyInfo() {
CFDictionaryRef keyAttrDic = CFDictionaryCreate(nullptr, keyAttrKeys, keyAttrValues, sizeof(keyAttrKeys)/sizeof(keyAttrKeys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionaryRef keyAttrDic = CFDictionaryCreate(nullptr, keyAttrKeys, keyAttrValues, sizeof(keyAttrKeys)/sizeof(keyAttrKeys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionaryRef attributes = nullptr; CFDictionaryRef attributes = nullptr;
OSStatus ret = SecItemCopyMatching(keyAttrDic, (CFTypeRef*)&attributes); SecItemCopyMatching(keyAttrDic, (CFTypeRef*)&attributes);
CFRelease(keyAttrDic); CFRelease(keyAttrDic);
return attributes; return attributes;
...@@ -296,4 +296,4 @@ int main(int argc, char* argv[]) { ...@@ -296,4 +296,4 @@ int main(int argc, char* argv[]) {
cout << all_desc << endl; cout << all_desc << endl;
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册