Use typedef for GetEntryFunc function pointer.

Change-Id: I58d4be7783656eb712cb32cd17075b4f35886693
This commit is contained in:
Peter Johnson
2015-07-13 22:45:35 -07:00
parent a5713252dc
commit 8fdaf61ef1
2 changed files with 5 additions and 4 deletions

View File

@@ -14,8 +14,8 @@ static constexpr unsigned long kClearAllMagic = 0xD06CB27Aul;
using namespace ntimpl;
bool Message::Read(WireDecoder& decoder,
NT_Type (*get_entry_type)(unsigned int id), Message* msg) {
bool Message::Read(WireDecoder& decoder, GetEntryTypeFunc get_entry_type,
Message* msg) {
unsigned int msg_type;
if (!decoder.Read8(&msg_type)) return false;
*msg = Message(static_cast<MsgType>(msg_type));

View File

@@ -35,6 +35,7 @@ class Message {
kExecuteRpc = 0x20,
kRpcResponse = 0x21
};
typedef NT_Type (*GetEntryTypeFunc)(unsigned int id);
Message() : m_type(kUnknown), m_id(0), m_flags(0), m_seq_num_uid(0) {}
@@ -43,8 +44,8 @@ class Message {
// Read and write from wire representation
void Write(WireEncoder& encoder) const;
static bool Read(WireDecoder& decoder,
NT_Type (*get_entry_type)(unsigned int id), Message* msg);
static bool Read(WireDecoder& decoder, GetEntryTypeFunc get_entry_type,
Message* msg);
// Create messages without data
static Message KeepAlive() { return Message(kKeepAlive); }