Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
242fd55a
Commit
242fd55a
authored
Aug 09, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protobuf: Support showing bool datatype
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
3ef8d138
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
protobuf.c
protobuf.c
+14
-1
No files found.
protobuf.c
View file @
242fd55a
...
...
@@ -204,6 +204,16 @@ static void show_enum(void *msg, pb_pr_ctl_t *ctl)
pr_msg
(
"%d"
,
val
);
}
static
void
show_bool
(
void
*
msg
,
pb_pr_ctl_t
*
ctl
)
{
protobuf_c_boolean
val
=
*
(
protobuf_c_boolean
*
)
msg
;
if
(
val
)
pr_msg
(
"True"
);
else
pr_msg
(
"False"
);
}
static
void
pb_show_field
(
const
ProtobufCFieldDescriptor
*
fd
,
void
*
where
,
unsigned
long
nr_fields
,
pb_pr_ctl_t
*
ctl
)
{
...
...
@@ -247,9 +257,12 @@ static void pb_show_field(const ProtobufCFieldDescriptor *fd, void *where,
ctl
->
arg
=
(
void
*
)
fd
->
descriptor
;
fsize
=
4
;
break
;
case
PROTOBUF_C_TYPE_BOOL
:
show
=
show_bool
;
fsize
=
4
;
break
;
case
PROTOBUF_C_TYPE_FLOAT
:
case
PROTOBUF_C_TYPE_DOUBLE
:
case
PROTOBUF_C_TYPE_BOOL
:
case
PROTOBUF_C_TYPE_BYTES
:
default:
show
=
pb_msg_unk
;
...
...
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