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
1ab4acf9
Commit
1ab4acf9
authored
Mar 14, 2014
by
Tomasz Wasilczyk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -Wcast-align warnings when compiled with clang
parent
2976be86
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
protobuf-c/protobuf-c.c
protobuf-c/protobuf-c.c
+8
-8
No files found.
protobuf-c/protobuf-c.c
View file @
1ab4acf9
...
@@ -878,7 +878,7 @@ static size_t
...
@@ -878,7 +878,7 @@ static size_t
repeated_field_pack
(
const
ProtobufCFieldDescriptor
*
field
,
repeated_field_pack
(
const
ProtobufCFieldDescriptor
*
field
,
size_t
count
,
const
void
*
member
,
uint8_t
*
out
)
size_t
count
,
const
void
*
member
,
uint8_t
*
out
)
{
{
char
*
array
=
*
(
char
*
const
*
)
member
;
void
*
array
=
*
(
void
*
const
*
)
member
;
unsigned
i
;
unsigned
i
;
if
(
field
->
packed
)
{
if
(
field
->
packed
)
{
...
@@ -973,7 +973,7 @@ repeated_field_pack(const ProtobufCFieldDescriptor *field,
...
@@ -973,7 +973,7 @@ repeated_field_pack(const ProtobufCFieldDescriptor *field,
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
rv
+=
required_field_pack
(
field
,
array
,
out
+
rv
);
rv
+=
required_field_pack
(
field
,
array
,
out
+
rv
);
array
+=
siz
;
array
=
(
char
*
)
array
+
siz
;
}
}
return
rv
;
return
rv
;
}
}
...
@@ -2016,7 +2016,7 @@ parse_packed_repeated_member(ScannedMember *scanned_member,
...
@@ -2016,7 +2016,7 @@ parse_packed_repeated_member(ScannedMember *scanned_member,
const
ProtobufCFieldDescriptor
*
field
=
scanned_member
->
field
;
const
ProtobufCFieldDescriptor
*
field
=
scanned_member
->
field
;
size_t
*
p_n
=
STRUCT_MEMBER_PTR
(
size_t
,
message
,
field
->
quantifier_offset
);
size_t
*
p_n
=
STRUCT_MEMBER_PTR
(
size_t
,
message
,
field
->
quantifier_offset
);
size_t
siz
=
sizeof_elt_in_repeated_array
(
field
->
type
);
size_t
siz
=
sizeof_elt_in_repeated_array
(
field
->
type
);
char
*
array
=
*
(
char
**
)
member
+
siz
*
(
*
p_n
);
void
*
array
=
*
(
void
**
)
member
+
siz
*
(
*
p_n
);
const
uint8_t
*
at
=
scanned_member
->
data
+
scanned_member
->
length_prefix_len
;
const
uint8_t
*
at
=
scanned_member
->
data
+
scanned_member
->
length_prefix_len
;
size_t
rem
=
scanned_member
->
len
-
scanned_member
->
length_prefix_len
;
size_t
rem
=
scanned_member
->
len
-
scanned_member
->
length_prefix_len
;
size_t
count
=
0
;
size_t
count
=
0
;
...
@@ -2649,21 +2649,21 @@ protobuf_c_message_check(const ProtobufCMessage *message)
...
@@ -2649,21 +2649,21 @@ protobuf_c_message_check(const ProtobufCMessage *message)
unsigned
offset
=
message
->
descriptor
->
fields
[
f
].
offset
;
unsigned
offset
=
message
->
descriptor
->
fields
[
f
].
offset
;
if
(
label
==
PROTOBUF_C_LABEL_REQUIRED
)
{
if
(
label
==
PROTOBUF_C_LABEL_REQUIRED
)
{
ProtobufCMessage
*
sub
=
*
(
ProtobufCMessage
**
)
ProtobufCMessage
*
sub
=
*
(
ProtobufCMessage
**
)
((
char
*
)
message
+
offset
);
(
void
*
)(
(
char
*
)
message
+
offset
);
if
(
sub
==
NULL
)
if
(
sub
==
NULL
)
return
FALSE
;
return
FALSE
;
if
(
!
protobuf_c_message_check
(
sub
))
if
(
!
protobuf_c_message_check
(
sub
))
return
FALSE
;
return
FALSE
;
}
else
if
(
label
==
PROTOBUF_C_LABEL_OPTIONAL
)
{
}
else
if
(
label
==
PROTOBUF_C_LABEL_OPTIONAL
)
{
ProtobufCMessage
*
sub
=
*
(
ProtobufCMessage
**
)
ProtobufCMessage
*
sub
=
*
(
ProtobufCMessage
**
)
((
char
*
)
message
+
offset
);
(
void
*
)(
(
char
*
)
message
+
offset
);
if
(
sub
!=
NULL
&&
!
protobuf_c_message_check
(
sub
))
if
(
sub
!=
NULL
&&
!
protobuf_c_message_check
(
sub
))
return
FALSE
;
return
FALSE
;
}
else
if
(
label
==
PROTOBUF_C_LABEL_REPEATED
)
{
}
else
if
(
label
==
PROTOBUF_C_LABEL_REPEATED
)
{
unsigned
n
=
*
(
unsigned
*
)
((
char
*
)
message
+
unsigned
n
=
*
(
unsigned
*
)
(
void
*
)
((
char
*
)
message
+
message
->
descriptor
->
fields
[
f
].
quantifier_offset
);
message
->
descriptor
->
fields
[
f
].
quantifier_offset
);
ProtobufCMessage
**
subs
=
*
(
ProtobufCMessage
***
)
ProtobufCMessage
**
subs
=
*
(
ProtobufCMessage
***
)
((
char
*
)
message
+
offset
);
(
void
*
)(
(
char
*
)
message
+
offset
);
unsigned
i
;
unsigned
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
if
(
!
protobuf_c_message_check
(
subs
[
i
]))
if
(
!
protobuf_c_message_check
(
subs
[
i
]))
...
@@ -2671,7 +2671,7 @@ protobuf_c_message_check(const ProtobufCMessage *message)
...
@@ -2671,7 +2671,7 @@ protobuf_c_message_check(const ProtobufCMessage *message)
}
}
}
else
if
(
type
==
PROTOBUF_C_TYPE_STRING
)
{
}
else
if
(
type
==
PROTOBUF_C_TYPE_STRING
)
{
if
(
label
==
PROTOBUF_C_LABEL_REQUIRED
)
{
if
(
label
==
PROTOBUF_C_LABEL_REQUIRED
)
{
char
*
str
=
*
(
char
**
)
((
char
*
)
char
*
str
=
*
(
char
**
)
(
void
*
)
((
char
*
)
message
+
message
->
descriptor
->
fields
[
f
].
offset
);
message
+
message
->
descriptor
->
fields
[
f
].
offset
);
if
(
str
==
NULL
)
if
(
str
==
NULL
)
return
FALSE
;
return
FALSE
;
...
...
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