Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
protobuf-c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
protobuf-c
Commits
d0cadf1a
Commit
d0cadf1a
authored
Jun 04, 2014
by
Robert Edmonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PROTOBUF_C_ASSERT -> assert
assert() conforms to the C89 standard, just call it directly.
parent
29806689
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
protobuf-c/protobuf-c.c
protobuf-c/protobuf-c.c
+1
-1
protobuf-c/protobuf-c.h
protobuf-c/protobuf-c.h
+0
-2
protoc-c/c_message.cc
protoc-c/c_message.cc
+4
-4
protoc-c/c_service.cc
protoc-c/c_service.cc
+1
-1
No files found.
protobuf-c/protobuf-c.c
View file @
d0cadf1a
...
...
@@ -2727,7 +2727,7 @@ protobuf_c_service_invoke_internal(ProtobufCService *service,
* likely invoking a newly added method on an old service. (Although
* other memory corruption bugs can cause this assertion too.)
*/
PROTOBUF_C_ASSERT
(
method_index
<
service
->
descriptor
->
n_methods
);
assert
(
method_index
<
service
->
descriptor
->
n_methods
);
/*
* Get the array of virtual methods (which are enumerated by the
...
...
protobuf-c/protobuf-c.h
View file @
d0cadf1a
...
...
@@ -45,8 +45,6 @@
# define PROTOBUF_C_END_DECLS
#endif
#define PROTOBUF_C_ASSERT(condition) assert(condition)
#if !defined(PROTOBUF_C_NO_DEPRECATED)
# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
# define PROTOBUF_C_DEPRECATED __attribute__((__deprecated__))
...
...
protoc-c/c_message.cc
View file @
d0cadf1a
...
...
@@ -276,21 +276,21 @@ GenerateHelperFunctionDefinitions(io::Printer* printer, bool is_submessage)
"size_t $lcclassname$__get_packed_size
\n
"
" (const $classname$ *message)
\n
"
"{
\n
"
"
PROTOBUF_C_ASSERT
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
"
assert
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
" return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
\n
"
"}
\n
"
"size_t $lcclassname$__pack
\n
"
" (const $classname$ *message,
\n
"
" uint8_t *out)
\n
"
"{
\n
"
"
PROTOBUF_C_ASSERT
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
"
assert
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
" return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
\n
"
"}
\n
"
"size_t $lcclassname$__pack_to_buffer
\n
"
" (const $classname$ *message,
\n
"
" ProtobufCBuffer *buffer)
\n
"
"{
\n
"
"
PROTOBUF_C_ASSERT
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
"
assert
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
" return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
\n
"
"}
\n
"
"$classname$ *
\n
"
...
...
@@ -307,7 +307,7 @@ GenerateHelperFunctionDefinitions(io::Printer* printer, bool is_submessage)
" ($classname$ *message,
\n
"
" ProtobufCAllocator *allocator)
\n
"
"{
\n
"
"
PROTOBUF_C_ASSERT
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
"
assert
(message->base.descriptor == &$lcclassname$__descriptor);
\n
"
" protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
\n
"
"}
\n
"
);
...
...
protoc-c/c_service.cc
View file @
d0cadf1a
...
...
@@ -258,7 +258,7 @@ void ServiceGenerator::GenerateCallersImplementations(io::Printer* printer)
" $padddddddddddddddddd$ $output_typename$_Closure closure,
\n
"
" $padddddddddddddddddd$ void *closure_data)
\n
"
"{
\n
"
"
PROTOBUF_C_ASSERT
(service->descriptor == &$lcfullname$__descriptor);
\n
"
"
assert
(service->descriptor == &$lcfullname$__descriptor);
\n
"
" service->invoke(service, $index$, (const ProtobufCMessage *) input, (ProtobufCClosure) closure, closure_data);
\n
"
"}
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment