Commit 82c77464 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Constification

parent 81564ae7
...@@ -245,12 +245,12 @@ struct VSL_cursor *VSL_CursorFile(struct VSL_data *vsl, const char *name, ...@@ -245,12 +245,12 @@ struct VSL_cursor *VSL_CursorFile(struct VSL_data *vsl, const char *name,
* NULL: Error, see VSL_Error * NULL: Error, see VSL_Error
*/ */
void VSL_DeleteCursor(struct VSL_cursor *c); void VSL_DeleteCursor(const struct VSL_cursor *c);
/* /*
* Delete the cursor pointed to by c * Delete the cursor pointed to by c
*/ */
int VSL_ResetCursor(struct VSL_cursor *c); int VSL_ResetCursor(const struct VSL_cursor *c);
/* /*
* Reset the cursor position to the head, so that the next call to * Reset the cursor position to the head, so that the next call to
* VSL_Next returns the first record. For VSM cursor, it will * VSL_Next returns the first record. For VSM cursor, it will
...@@ -273,7 +273,7 @@ int VSL_Check(const struct VSL_cursor *c, const struct VSLC_ptr *ptr); ...@@ -273,7 +273,7 @@ int VSL_Check(const struct VSL_cursor *c, const struct VSLC_ptr *ptr);
* 2: Valid * 2: Valid
*/ */
int VSL_Next(struct VSL_cursor *c); int VSL_Next(const struct VSL_cursor *c);
/* /*
* Return raw pointer to next VSL record. * Return raw pointer to next VSL record.
* *
...@@ -333,7 +333,7 @@ int VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, ...@@ -333,7 +333,7 @@ int VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c,
* -5: I/O write error - see errno * -5: I/O write error - see errno
*/ */
int VSL_PrintAll(struct VSL_data *vsl, struct VSL_cursor *c, void *fo); int VSL_PrintAll(struct VSL_data *vsl, const struct VSL_cursor *c, void *fo);
/* /*
* Calls VSL_Next on c until c is exhausted. In turn calls * Calls VSL_Next on c until c is exhausted. In turn calls
* VSL_Print on all records where VSL_Match returns true. * VSL_Print on all records where VSL_Match returns true.
...@@ -393,7 +393,7 @@ int VSL_Write(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo); ...@@ -393,7 +393,7 @@ int VSL_Write(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo);
* -5: I/O error - see VSL_Error * -5: I/O error - see VSL_Error
*/ */
int VSL_WriteAll(struct VSL_data *vsl, struct VSL_cursor *c, void *fo); int VSL_WriteAll(struct VSL_data *vsl, const struct VSL_cursor *c, void *fo);
/* /*
* Calls VSL_Next on c until c is exhausted. In turn calls * Calls VSL_Next on c until c is exhausted. In turn calls
* VSL_Write on all records where VSL_Match returns true. * VSL_Write on all records where VSL_Match returns true.
......
...@@ -302,7 +302,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo) ...@@ -302,7 +302,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
} }
int int
VSL_PrintAll(struct VSL_data *vsl, struct VSL_cursor *c, void *fo) VSL_PrintAll(struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
{ {
int i; int i;
...@@ -436,7 +436,7 @@ VSL_Write(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo) ...@@ -436,7 +436,7 @@ VSL_Write(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
} }
int int
VSL_WriteAll(struct VSL_data *vsl, struct VSL_cursor *c, void *fo) VSL_WriteAll(struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
{ {
int i; int i;
......
...@@ -42,9 +42,9 @@ int vsl_diag(struct VSL_data *vsl, const char *fmt, ...) ...@@ -42,9 +42,9 @@ int vsl_diag(struct VSL_data *vsl, const char *fmt, ...)
void vsl_vbm_bitset(int bit, void *priv); void vsl_vbm_bitset(int bit, void *priv);
void vsl_vbm_bitclr(int bit, void *priv); void vsl_vbm_bitclr(int bit, void *priv);
typedef void vslc_delete_f(struct VSL_cursor *); typedef void vslc_delete_f(const struct VSL_cursor *);
typedef int vslc_next_f(struct VSL_cursor *); typedef int vslc_next_f(const struct VSL_cursor *);
typedef int vslc_reset_f(struct VSL_cursor *); typedef int vslc_reset_f(const struct VSL_cursor *);
typedef int vslc_check_f(const struct VSL_cursor *, const struct VSLC_ptr *); typedef int vslc_check_f(const struct VSL_cursor *, const struct VSLC_ptr *);
struct vslc_tbl { struct vslc_tbl {
......
...@@ -64,7 +64,7 @@ struct vslc_vsm { ...@@ -64,7 +64,7 @@ struct vslc_vsm {
}; };
static void static void
vslc_vsm_delete(struct VSL_cursor *cursor) vslc_vsm_delete(const struct VSL_cursor *cursor)
{ {
struct vslc_vsm *c; struct vslc_vsm *c;
...@@ -114,7 +114,7 @@ vslc_vsm_check(const struct VSL_cursor *cursor, const struct VSLC_ptr *ptr) ...@@ -114,7 +114,7 @@ vslc_vsm_check(const struct VSL_cursor *cursor, const struct VSLC_ptr *ptr)
} }
static int static int
vslc_vsm_next(struct VSL_cursor *cursor) vslc_vsm_next(const struct VSL_cursor *cursor)
{ {
struct vslc_vsm *c; struct vslc_vsm *c;
int i; int i;
...@@ -189,7 +189,7 @@ vslc_vsm_next(struct VSL_cursor *cursor) ...@@ -189,7 +189,7 @@ vslc_vsm_next(struct VSL_cursor *cursor)
} }
static int static int
vslc_vsm_reset(struct VSL_cursor *cursor) vslc_vsm_reset(const struct VSL_cursor *cursor)
{ {
struct vslc_vsm *c; struct vslc_vsm *c;
unsigned segment; unsigned segment;
...@@ -290,7 +290,7 @@ struct vslc_file { ...@@ -290,7 +290,7 @@ struct vslc_file {
}; };
static void static void
vslc_file_delete(struct VSL_cursor *cursor) vslc_file_delete(const struct VSL_cursor *cursor)
{ {
struct vslc_file *c; struct vslc_file *c;
...@@ -320,7 +320,7 @@ vslc_file_readn(int fd, void *buf, size_t n) ...@@ -320,7 +320,7 @@ vslc_file_readn(int fd, void *buf, size_t n)
} }
static int static int
vslc_file_next(struct VSL_cursor *cursor) vslc_file_next(const struct VSL_cursor *cursor)
{ {
struct vslc_file *c; struct vslc_file *c;
ssize_t i; ssize_t i;
...@@ -363,7 +363,7 @@ vslc_file_next(struct VSL_cursor *cursor) ...@@ -363,7 +363,7 @@ vslc_file_next(struct VSL_cursor *cursor)
} }
static int static int
vslc_file_reset(struct VSL_cursor *cursor) vslc_file_reset(const struct VSL_cursor *cursor)
{ {
(void)cursor; (void)cursor;
/* XXX: Implement me */ /* XXX: Implement me */
...@@ -439,7 +439,7 @@ VSL_CursorFile(struct VSL_data *vsl, const char *name, unsigned options) ...@@ -439,7 +439,7 @@ VSL_CursorFile(struct VSL_data *vsl, const char *name, unsigned options)
} }
void void
VSL_DeleteCursor(struct VSL_cursor *cursor) VSL_DeleteCursor(const struct VSL_cursor *cursor)
{ {
const struct vslc_tbl *tbl; const struct vslc_tbl *tbl;
...@@ -450,7 +450,7 @@ VSL_DeleteCursor(struct VSL_cursor *cursor) ...@@ -450,7 +450,7 @@ VSL_DeleteCursor(struct VSL_cursor *cursor)
} }
int int
VSL_ResetCursor(struct VSL_cursor *cursor) VSL_ResetCursor(const struct VSL_cursor *cursor)
{ {
const struct vslc_tbl *tbl; const struct vslc_tbl *tbl;
...@@ -461,7 +461,7 @@ VSL_ResetCursor(struct VSL_cursor *cursor) ...@@ -461,7 +461,7 @@ VSL_ResetCursor(struct VSL_cursor *cursor)
} }
int int
VSL_Next(struct VSL_cursor *cursor) VSL_Next(const struct VSL_cursor *cursor)
{ {
const struct vslc_tbl *tbl; const struct vslc_tbl *tbl;
......
...@@ -209,7 +209,7 @@ VRB_PROTOTYPE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp) ...@@ -209,7 +209,7 @@ VRB_PROTOTYPE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
VRB_GENERATE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp) VRB_GENERATE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
static int static int
vslc_raw_next(struct VSL_cursor *cursor) vslc_raw_next(const struct VSL_cursor *cursor)
{ {
struct vslc_raw *c; struct vslc_raw *c;
...@@ -227,7 +227,7 @@ vslc_raw_next(struct VSL_cursor *cursor) ...@@ -227,7 +227,7 @@ vslc_raw_next(struct VSL_cursor *cursor)
} }
static int static int
vslc_raw_reset(struct VSL_cursor *cursor) vslc_raw_reset(const struct VSL_cursor *cursor)
{ {
struct vslc_raw *c; struct vslc_raw *c;
...@@ -249,7 +249,7 @@ static const struct vslc_tbl vslc_raw_tbl = { ...@@ -249,7 +249,7 @@ static const struct vslc_tbl vslc_raw_tbl = {
}; };
static int static int
vslc_vtx_next(struct VSL_cursor *cursor) vslc_vtx_next(const struct VSL_cursor *cursor)
{ {
struct vslc_vtx *c; struct vslc_vtx *c;
const uint32_t *ptr; const uint32_t *ptr;
...@@ -300,7 +300,7 @@ vslc_vtx_next(struct VSL_cursor *cursor) ...@@ -300,7 +300,7 @@ vslc_vtx_next(struct VSL_cursor *cursor)
} }
static int static int
vslc_vtx_reset(struct VSL_cursor *cursor) vslc_vtx_reset(const struct VSL_cursor *cursor)
{ {
struct vslc_vtx *c; struct vslc_vtx *c;
...@@ -573,7 +573,7 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx) ...@@ -573,7 +573,7 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx)
/* Lookup a vtx by vxid from the managed list */ /* Lookup a vtx by vxid from the managed list */
static struct vtx * static struct vtx *
vtx_lookup(struct VSLQ *vslq, unsigned vxid) vtx_lookup(const struct VSLQ *vslq, unsigned vxid)
{ {
struct vtx_key lkey, *key; struct vtx_key lkey, *key;
struct vtx *vtx; struct vtx *vtx;
......
...@@ -44,7 +44,7 @@ cb(int tag, void *priv) ...@@ -44,7 +44,7 @@ cb(int tag, void *priv)
} }
int int
main(int argc, char *argv[]) main(int argc, char * const *argv)
{ {
int i; int i;
......
...@@ -53,7 +53,8 @@ vxp_ErrToken(const struct vxp *vxp, const struct token *t) ...@@ -53,7 +53,8 @@ vxp_ErrToken(const struct vxp *vxp, const struct token *t)
} }
static void static void
vxp_Pos(struct vxp *vxp, struct vsb *vsb, const struct token *t, int tokoff) vxp_Pos(const struct vxp *vxp, struct vsb *vsb, const struct token *t,
int tokoff)
{ {
unsigned pos; unsigned pos;
...@@ -68,7 +69,7 @@ vxp_Pos(struct vxp *vxp, struct vsb *vsb, const struct token *t, int tokoff) ...@@ -68,7 +69,7 @@ vxp_Pos(struct vxp *vxp, struct vsb *vsb, const struct token *t, int tokoff)
} }
static void static void
vxp_quote(struct vxp *vxp, const char *b, const char *e, int tokoff) vxp_quote(const struct vxp *vxp, const char *b, const char *e, int tokoff)
{ {
const char *p; const char *p;
char c; char c;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
static void vxp_expr_or(struct vxp *vxp, struct vex **pvex); static void vxp_expr_or(struct vxp *vxp, struct vex **pvex);
static struct vex * static struct vex *
vex_alloc(struct vxp *vxp) vex_alloc(const struct vxp *vxp)
{ {
struct vex *vex; struct vex *vex;
......
...@@ -17,7 +17,7 @@ usage(void) ...@@ -17,7 +17,7 @@ usage(void)
} }
int int
main(int argc, char **argv) main(int argc, char * const *argv)
{ {
struct vsb *vsb; struct vsb *vsb;
struct vex *vex; struct vex *vex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment