Skip to content

Commit

Permalink
将 GOOGLE_CHECK_NE 替换成 CHECK_NE (#2349)
Browse files Browse the repository at this point in the history
* replace GOOGLE_CHECK_NE with CHECK_NE
  • Loading branch information
gulu-goolu authored Aug 8, 2023
1 parent cb4ed16 commit e783f83
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/brpc/esp_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <google/protobuf/reflection_ops.h> // ReflectionOps::Merge
#include <google/protobuf/wire_format.h> // WireFormatLite::GetTagWireType

#include "butil/logging.h"

namespace brpc {

EspMessage::EspMessage()
Expand Down Expand Up @@ -92,7 +94,7 @@ int EspMessage::ByteSize() const {
}

void EspMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const EspMessage* source = dynamic_cast<const EspMessage*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
Expand All @@ -102,7 +104,7 @@ void EspMessage::MergeFrom(const ::google::protobuf::Message& from) {
}

void EspMessage::MergeFrom(const EspMessage& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
head = from.head;
body = from.body;
}
Expand Down
8 changes: 4 additions & 4 deletions src/brpc/memcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int MemcacheRequest::ByteSize() const {
}

void MemcacheRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const MemcacheRequest* source = dynamic_cast<const MemcacheRequest*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
Expand All @@ -144,7 +144,7 @@ void MemcacheRequest::MergeFrom(const ::google::protobuf::Message& from) {
}

void MemcacheRequest::MergeFrom(const MemcacheRequest& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
_buf.append(from._buf);
_pipelined_count += from._pipelined_count;
}
Expand Down Expand Up @@ -262,7 +262,7 @@ int MemcacheResponse::ByteSize() const {
}

void MemcacheResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const MemcacheResponse* source = dynamic_cast<const MemcacheResponse*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
Expand All @@ -272,7 +272,7 @@ void MemcacheResponse::MergeFrom(const ::google::protobuf::Message& from) {
}

void MemcacheResponse::MergeFrom(const MemcacheResponse& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
_err = from._err;
// responses of memcached according to their binary layout, should be
// directly concatenatible.
Expand Down
4 changes: 2 additions & 2 deletions src/brpc/nshead_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int NsheadMessage::ByteSize() const {
}

void NsheadMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const NsheadMessage* source = dynamic_cast<const NsheadMessage*>(&from);
if (source == NULL) {
LOG(ERROR) << "Can only merge from NsheadMessage";
Expand All @@ -104,7 +104,7 @@ void NsheadMessage::MergeFrom(const ::google::protobuf::Message& from) {
}

void NsheadMessage::MergeFrom(const NsheadMessage& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
// No way to merge two nshead messages, just overwrite.
head = from.head;
body = from.body;
Expand Down
8 changes: 4 additions & 4 deletions src/brpc/redis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int RedisRequest::ByteSize() const {
}

void RedisRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const RedisRequest* source = dynamic_cast<const RedisRequest*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
Expand All @@ -104,7 +104,7 @@ void RedisRequest::MergeFrom(const ::google::protobuf::Message& from) {
}

void RedisRequest::MergeFrom(const RedisRequest& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
_has_error = _has_error || from._has_error;
_buf.append(from._buf);
_ncommand += from._ncommand;
Expand Down Expand Up @@ -312,7 +312,7 @@ int RedisResponse::ByteSize() const {
}

void RedisResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
const RedisResponse* source = dynamic_cast<const RedisResponse*>(&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
Expand All @@ -322,7 +322,7 @@ void RedisResponse::MergeFrom(const ::google::protobuf::Message& from) {
}

void RedisResponse::MergeFrom(const RedisResponse& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
if (from._nreply == 0) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/brpc/thrift_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ int ThriftFramedMessage::ByteSize() const {
}

void ThriftFramedMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
LOG(ERROR) << "ThriftFramedMessage does not support MergeFrom";
}

void ThriftFramedMessage::MergeFrom(const ThriftFramedMessage& from) {
GOOGLE_CHECK_NE(&from, this);
CHECK_NE(&from, this);
LOG(ERROR) << "ThriftFramedMessage does not support MergeFrom";
}

Expand Down

0 comments on commit e783f83

Please sign in to comment.