diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
| commit | 1f35b46a2f35d59b86ed3ee557aa1c9fcf2fcac9 (patch) | |
| tree | 27de606b3510b126766ac7a0ac9eb8ddf4573ab0 /lib/stream.c | |
| parent | d47ae3db4cf14c72d8468d61113ac88e19235791 (diff) | |
| parent | c1a003878246ccc84ab5986558ca959f4545f738 (diff) | |
Merge branch 'master' into docuser
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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) |
