Commit 97b6aa36 authored by Robert Edmonds's avatar Robert Edmonds

use double underscores in the MAGIC identifiers

these magic constants aren't intended for use by client code. add a
double underscore to indicate this.
parent d0cadf1a
......@@ -75,16 +75,16 @@
/* Assertions for magic numbers. */
#define ASSERT_IS_ENUM_DESCRIPTOR(desc) \
assert((desc)->magic == PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC)
assert((desc)->magic == PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC)
#define ASSERT_IS_MESSAGE_DESCRIPTOR(desc) \
assert((desc)->magic == PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC)
assert((desc)->magic == PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC)
#define ASSERT_IS_MESSAGE(message) \
ASSERT_IS_MESSAGE_DESCRIPTOR((message)->descriptor)
#define ASSERT_IS_SERVICE_DESCRIPTOR(desc) \
assert((desc)->magic == PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC)
assert((desc)->magic == PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC)
/* --- version --- */
......@@ -2661,7 +2661,7 @@ protobuf_c_message_check(const ProtobufCMessage *message)
{
if (!message ||
!message->descriptor ||
message->descriptor->magic != PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC)
message->descriptor->magic != PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC)
{
return FALSE;
}
......
......@@ -505,9 +505,9 @@ do { \
/* ====== private ====== */
#define PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC 0x14159bc3
#define PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9
#define PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC 0x114315af
#define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3
#define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9
#define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af
/*
* A little enum helper macro: this will ensure that your enum's size is
......
......@@ -272,7 +272,7 @@ void EnumGenerator::GenerateEnumDescriptor(io::Printer* printer) {
printer->Print(vars,
"const ProtobufCEnumDescriptor $lcclassname$__descriptor =\n"
"{\n"
" PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,\n"
" PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,\n"
" \"$fullname$\",\n"
" \"$shortname$\",\n"
" \"$cname$\",\n"
......
......@@ -467,7 +467,7 @@ GenerateMessageDescriptor(io::Printer* printer) {
printer->Print(vars,
"const ProtobufCMessageDescriptor $lcclassname$__descriptor =\n"
"{\n"
" PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,\n"
" PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,\n"
" \"$fullname$\",\n"
" \"$shortname$\",\n"
" \"$classname$\",\n"
......
......@@ -226,7 +226,7 @@ void ServiceGenerator::GenerateServiceDescriptor(io::Printer* printer)
printer->Print(vars_, "const ProtobufCServiceDescriptor $lcfullname$__descriptor =\n"
"{\n"
" PROTOBUF_C_SERVICE_DESCRIPTOR_MAGIC,\n"
" PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC,\n"
" \"$fullname$\",\n"
" \"$name$\",\n"
" \"$cname$\",\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment