Code Review
/
apps
/
agl-service-can-low-level.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix warning on clang.
[apps/agl-service-can-low-level.git]
/
pb_decode.h
diff --git
a/pb_decode.h
b/pb_decode.h
index
e9f8ced
..
35de0a2
100644
(file)
--- a/
pb_decode.h
+++ b/
pb_decode.h
@@
-32,7
+32,16
@@
extern "C" {
*/
struct _pb_istream_t
{
*/
struct _pb_istream_t
{
+#ifdef PB_BUFFER_ONLY
+ /* Callback pointer is not used in buffer-only configuration.
+ * Having an int pointer here allows binary compatibility but
+ * gives an error if someone tries to assign callback function.
+ */
+ int *callback;
+#else
bool (*callback)(pb_istream_t *stream, uint8_t *buf, size_t count);
bool (*callback)(pb_istream_t *stream, uint8_t *buf, size_t count);
+#endif
+
void *state; /* Free field for use by callback implementation */
size_t bytes_left;
void *state; /* Free field for use by callback implementation */
size_t bytes_left;