1
0
Fork 0
mirror of https://github.com/KingDuckZ/incredis synced 2025-08-11 13:09:48 +00:00

Replace long long with RedisInt typedef.

This commit is contained in:
King_DuckZ 2016-12-02 14:15:04 +00:00
parent 0da5c0de3c
commit 68a73d3eb6
5 changed files with 21 additions and 20 deletions

View file

@ -20,9 +20,9 @@
#include <boost/variant/get.hpp>
namespace redis {
const long long& get_integer (const Reply& parReply) {
const RedisInt& get_integer (const Reply& parReply) {
assert(parReply.is_integer());
return boost::get<long long>(parReply);
return boost::get<RedisInt>(parReply);
}
const std::string& get_string (const Reply& parReply) {
@ -34,7 +34,7 @@ namespace redis {
return boost::get<std::string>(parReply);
}
long long get_integer_autoconv_if_str (const Reply &parReply) {
RedisInt get_integer_autoconv_if_str (const Reply &parReply) {
using dhandy::lexical_cast;
const auto type = parReply.which();
@ -42,7 +42,7 @@ namespace redis {
case RedisVariantType_Integer:
return get_integer(parReply);
case RedisVariantType_String:
return lexical_cast<long long>(get_string(parReply));
return lexical_cast<RedisInt>(get_string(parReply));
default:
assert(false);
return 0;
@ -70,7 +70,7 @@ namespace redis {
}
template <>
const long long& get<long long> (const Reply& parReply) {
const RedisInt& get<RedisInt> (const Reply& parReply) {
return get_integer(parReply);
}
@ -92,7 +92,7 @@ namespace redis {
template const std::string& get<std::string> ( const Reply& parReply );
template const std::vector<Reply>& get<std::vector<Reply>> ( const Reply& parReply );
template const long long& get<long long> ( const Reply& parReply );
template const RedisInt& get<RedisInt> ( const Reply& parReply );
template const ErrorString& get<ErrorString> ( const Reply& parReply );
template const StatusString& get<StatusString> ( const Reply& parReply );

View file

@ -41,7 +41,7 @@ namespace redis {
return m_command and m_command->is_connected();
}
Reply ScanIteratorBaseClass::run (const char* parCommand, long long parScanContext, std::size_t parCount) {
Reply ScanIteratorBaseClass::run (const char* parCommand, RedisInt parScanContext, std::size_t parCount) {
const auto scan_context = dhandy::lexical_cast<std::string>(parScanContext);
const auto count_hint = dhandy::lexical_cast<std::string>(parCount);
if (m_match_pattern.empty())
@ -50,7 +50,7 @@ namespace redis {
return m_command->run(parCommand, scan_context, "MATCH", m_match_pattern, "COUNT", count_hint);
}
Reply ScanIteratorBaseClass::run (const char* parCommand, const boost::string_ref& parParameter, long long parScanContext, std::size_t parCount) {
Reply ScanIteratorBaseClass::run (const char* parCommand, const boost::string_ref& parParameter, RedisInt parScanContext, std::size_t parCount) {
const auto scan_context = dhandy::lexical_cast<std::string>(parScanContext);
const auto count_hint = dhandy::lexical_cast<std::string>(parCount);
if (m_match_pattern.empty())