未验证 提交 d12c9ca1 编写于 作者: D Daniel Larimer 提交者: GitHub

Merge pull request #634 from andriantolie/db-api-fix

Fix inconsistent name of function in db api
......@@ -385,7 +385,7 @@ struct table_impl<sizeof(uint64_t),0> {
*
* @return the number of bytes read or -1 if no record found
*/
static int32_t next( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
static int32_t next_primary( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
return next_i64( scope, code, table_n, data, len );
}
......@@ -398,7 +398,7 @@ struct table_impl<sizeof(uint64_t),0> {
*
* @return the number of bytes read or -1 if no record found
*/
static int32_t previous( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
static int32_t previous_primary( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
return previous_i64( scope, code, table_n, data, len );
}
......@@ -411,7 +411,7 @@ struct table_impl<sizeof(uint64_t),0> {
*
* @return the number of bytes read or -1 if no record found
*/
static int32_t lower_bound( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
static int32_t lower_bound_primary( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
return lower_bound_i64( scope, code, table_n, data, len );
}
......@@ -424,8 +424,9 @@ struct table_impl<sizeof(uint64_t),0> {
*
* @return the number of bytes read or -1 if no record found
*/
static int32_t upper_bound( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
return upper_bound_i64( scope, code, table_n, data, len );
static int32_t upper_bound_primary( uint64_t scope, uint64_t code, uint64_t table_n, void* data, uint32_t len ) {
return upper_bound_i64(scope, code, table_n, data, len);
}
/**
......@@ -918,7 +919,8 @@ struct table<scope,code,table_n,Record,PrimaryType,void> {
* @return true if successfully retrieved the record.
*/
static bool lower_bound( const PrimaryType& p, Record& r ) {
return impl::lower_bound_primary( scope, code, table_n, &p &r, sizeof(Record) ) == sizeof(Record);
*reinterpret_cast<PrimaryType*>(&r) = p;
return impl::lower_bound_primary( scope, code, table_n, &r, sizeof(Record) ) == sizeof(Record);
}
/**
......@@ -927,7 +929,8 @@ struct table<scope,code,table_n,Record,PrimaryType,void> {
* @return true if successfully retrieved the record.
*/
static bool upper_bound( const PrimaryType& p, Record& r ) {
return impl::upper_bound_primary( scope, code, table_n, &p &r, sizeof(Record) ) == sizeof(Record);
*reinterpret_cast<PrimaryType*>(&r) = p;
return impl::upper_bound_primary( scope, code, table_n, &r, sizeof(Record) ) == sizeof(Record);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册