diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-03-02 11:00:43 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-03-02 11:00:43 -0800 |
commit | 6e67cb48ef6b4fceee29e5c1cce3d7939c10b02f (patch) | |
tree | 4694b4f578a4611ea1d2fb73000f8fe42ec01eaa /pbstruct.h | |
parent | 268bb50e8013469bb61eb0e3beeddce365eb7755 (diff) |
Fixed bugs that lint caught.
Diffstat (limited to 'pbstruct.h')
-rw-r--r-- | pbstruct.h | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -71,30 +71,30 @@ struct pbstruct* pbstruct_new(struct pbstruct_definition *definition); /* Deletes any sub-structs also. */ struct pbstruct* pbstruct_delete(struct pbstruct_definition *definition); -bool pbstruct_is_set(struct pbstruct *s, struct pbstruct_field *f) { +inline bool pbstruct_is_set(struct pbstruct *s, struct pbstruct_field *f) { return s->data[f->isset_byte_offset] & f->isset_byte_mask; } /* These do no existence checks or type checks. */ #define DEFINE_GETTERS(ctype, name) \ - ctype pbstruct_get_ ## name(struct pbstruct *s, struct pbstruct_field *f) { \ + inline ctype pbstruct_get_ ## name(struct pbstruct *s, struct pbstruct_field *f) { \ /* TODO: make sure the compiler knows this is an aligned access. */ \ return *(ctype*)(s->data + f->byte_offset); \ } \ - ctype *pbstruct_get_ ## name ## _array(struct pbstruct *s, \ + inline ctype *pbstruct_get_ ## name ## _array(struct pbstruct *s, \ struct pbstruct_field *f) { \ /* TODO: make sure the compiler knows this is an aligned access. */ \ return *(ctype**)(s->data + f->byte_offset); \ } -DEFINE_GETTERS(double, double); -DEFINE_GETTERS(float, float); -DEFINE_GETTERS(int32_t, int32); -DEFINE_GETTERS(int64_t, int64); -DEFINE_GETTERS(uint32_t, uint32); -DEFINE_GETTERS(uint64_t, uint64); -DEFINE_GETTERS(bool, bool); -DEFINE_GETTERS(struct pbstruct_delimited*, bytes); -DEFINE_GETTERS(struct pbstruct_delimited*, string); -DEFINE_GETTERS(struct pbstruct*, substruct); +DEFINE_GETTERS(double, double) +DEFINE_GETTERS(float, float) +DEFINE_GETTERS(int32_t, int32) +DEFINE_GETTERS(int64_t, int64) +DEFINE_GETTERS(uint32_t, uint32) +DEFINE_GETTERS(uint64_t, uint64) +DEFINE_GETTERS(bool, bool) +DEFINE_GETTERS(struct pbstruct_delimited*, bytes) +DEFINE_GETTERS(struct pbstruct_delimited*, string) +DEFINE_GETTERS(struct pbstruct*, substruct) |