Replace spaces after #defines with tabs; this makes all #defines
consistent in their adherence with style(9).
This commit is contained in:
parent
13725ff1d5
commit
779fa7fcc3
@ -49,35 +49,35 @@
|
||||
|
||||
#ifdef _KERNEL
|
||||
MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers");
|
||||
#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK)
|
||||
#define SBFREE(buf) free(buf, M_SBUF)
|
||||
#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK)
|
||||
#define SBFREE(buf) free(buf, M_SBUF)
|
||||
#else /* _KERNEL */
|
||||
#define KASSERT(e, m)
|
||||
#define SBMALLOC(size) malloc(size)
|
||||
#define SBFREE(buf) free(buf)
|
||||
#define min(x,y) MIN(x,y)
|
||||
#define KASSERT(e, m)
|
||||
#define SBMALLOC(size) malloc(size)
|
||||
#define SBFREE(buf) free(buf)
|
||||
#define min(x,y) MIN(x,y)
|
||||
#endif /* _KERNEL */
|
||||
|
||||
/*
|
||||
* Predicates
|
||||
*/
|
||||
#define SBUF_ISDYNAMIC(s) ((s)->s_flags & SBUF_DYNAMIC)
|
||||
#define SBUF_ISDYNSTRUCT(s) ((s)->s_flags & SBUF_DYNSTRUCT)
|
||||
#define SBUF_ISFINISHED(s) ((s)->s_flags & SBUF_FINISHED)
|
||||
#define SBUF_HASOVERFLOWED(s) ((s)->s_flags & SBUF_OVERFLOWED)
|
||||
#define SBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1)
|
||||
#define SBUF_ISDYNAMIC(s) ((s)->s_flags & SBUF_DYNAMIC)
|
||||
#define SBUF_ISDYNSTRUCT(s) ((s)->s_flags & SBUF_DYNSTRUCT)
|
||||
#define SBUF_ISFINISHED(s) ((s)->s_flags & SBUF_FINISHED)
|
||||
#define SBUF_HASOVERFLOWED(s) ((s)->s_flags & SBUF_OVERFLOWED)
|
||||
#define SBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1)
|
||||
#define SBUF_FREESPACE(s) ((s)->s_size - (s)->s_len - 1)
|
||||
#define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND)
|
||||
|
||||
/*
|
||||
* Set / clear flags
|
||||
*/
|
||||
#define SBUF_SETFLAG(s, f) do { (s)->s_flags |= (f); } while (0)
|
||||
#define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0)
|
||||
#define SBUF_SETFLAG(s, f) do { (s)->s_flags |= (f); } while (0)
|
||||
#define SBUF_CLEARFLAG(s, f) do { (s)->s_flags &= ~(f); } while (0)
|
||||
|
||||
#define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */
|
||||
#define SBUF_MAXEXTENDSIZE PAGE_SIZE
|
||||
#define SBUF_MAXEXTENDINCR PAGE_SIZE
|
||||
#define SBUF_MINEXTENDSIZE 16 /* Should be power of 2. */
|
||||
#define SBUF_MAXEXTENDSIZE PAGE_SIZE
|
||||
#define SBUF_MAXEXTENDINCR PAGE_SIZE
|
||||
|
||||
/*
|
||||
* Debugging support
|
||||
@ -101,11 +101,11 @@ _assert_sbuf_state(char *fun, struct sbuf *s, int state)
|
||||
("%s called with %sfinished or corrupt sbuf", fun,
|
||||
(state ? "un" : "")));
|
||||
}
|
||||
#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__func__, (s))
|
||||
#define assert_sbuf_state(s, i) _assert_sbuf_state(__func__, (s), (i))
|
||||
#define assert_sbuf_integrity(s) _assert_sbuf_integrity(__func__, (s))
|
||||
#define assert_sbuf_state(s, i) _assert_sbuf_state(__func__, (s), (i))
|
||||
#else /* _KERNEL && INVARIANTS */
|
||||
#define assert_sbuf_integrity(s) do { } while (0)
|
||||
#define assert_sbuf_state(s, i) do { } while (0)
|
||||
#define assert_sbuf_integrity(s) do { } while (0)
|
||||
#define assert_sbuf_state(s, i) do { } while (0)
|
||||
#endif /* _KERNEL && INVARIANTS */
|
||||
|
||||
static int
|
||||
|
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _SYS_SBUF_H_
|
||||
#define _SYS_SBUF_H_
|
||||
#define _SYS_SBUF_H_
|
||||
|
||||
#include <machine/ansi.h>
|
||||
|
||||
@ -42,12 +42,12 @@ struct sbuf {
|
||||
int s_size; /* size of storage buffer */
|
||||
int s_len; /* current length of string */
|
||||
#define SBUF_FIXEDLEN 0x00000000 /* fixed length buffer (default) */
|
||||
#define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */
|
||||
#define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */
|
||||
#define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */
|
||||
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
|
||||
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */
|
||||
#define SBUF_OVERFLOWED 0x00040000 /* sbuf overflowed */
|
||||
#define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */
|
||||
#define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */
|
||||
#define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */
|
||||
#define SBUF_OVERFLOWED 0x00040000 /* sbuf overflowed */
|
||||
#define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */
|
||||
int s_flags; /* flags */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user