diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-27 15:21:15 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-27 15:21:15 -0400 |
| commit | 42732e05a9a97a18f496eb559a77062a1b4b420e (patch) | |
| tree | 03c8b87c2b26cb43b7b241f5ab0db6583c4b5a30 /lib/stream.c | |
| parent | 056d8355967b372566a98432f07e4cff66ab17b0 (diff) | |
| parent | 2d6e6d36d7e847b997f29097268dc529bd154d10 (diff) | |
Merge branch 'master' into stylechecker
Diffstat (limited to 'lib/stream.c')
| -rw-r--r-- | lib/stream.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/stream.c b/lib/stream.c index 0eb790b753..3c08d4454b 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -65,19 +65,19 @@ DEFINE_MTYPE_STATIC(LIB, STREAM_FIFO, "Stream FIFO") assert(ENDP_VALID(S, (S)->endp)); \ } while (0) -#define STREAM_BOUND_WARN(S, WHAT) \ - do { \ - zlog_warn("%s: Attempt to %s out of bounds", __func__, \ - (WHAT)); \ - STREAM_WARN_OFFSETS(S); \ - assert(0); \ +#define STREAM_BOUND_WARN(S, WHAT) \ + do { \ + zlog_warn("%s: Attempt to %s out of bounds", __func__, \ + (WHAT)); \ + STREAM_WARN_OFFSETS(S); \ + assert(0); \ } while (0) -#define STREAM_BOUND_WARN2(S, WHAT) \ - do { \ - zlog_warn("%s: Attempt to %s out of bounds", __func__, \ - (WHAT)); \ - STREAM_WARN_OFFSETS(S); \ +#define STREAM_BOUND_WARN2(S, WHAT) \ + do { \ + zlog_warn("%s: Attempt to %s out of bounds", __func__, \ + (WHAT)); \ + STREAM_WARN_OFFSETS(S); \ } while (0) /* XXX: Deprecated macro: do not use */ @@ -353,7 +353,7 @@ inline bool stream_getw2(struct stream *s, uint16_t *word) return false; } - *word = s->data[s->getp++] << 8; + *word = s->data[s->getp++] << 8; *word |= s->data[s->getp++]; return true; @@ -474,13 +474,12 @@ inline bool stream_getl2(struct stream *s, uint32_t *l) return false; } - *l = (unsigned int)(s->data[s->getp++]) << 24; + *l = (unsigned int)(s->data[s->getp++]) << 24; *l |= s->data[s->getp++] << 16; *l |= s->data[s->getp++] << 8; *l |= s->data[s->getp++]; return true; - } u_int32_t stream_getl(struct stream *s) |
