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,
* 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
*/
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
* 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);
* 2: Valid
*/
int VSL_Next(struct VSL_cursor *c);
int VSL_Next(const struct VSL_cursor *c);
/*
* Return raw pointer to next VSL record.
*
......@@ -333,7 +333,7 @@ int VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c,
* -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
* 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);
* -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
* 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)
}
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;
......@@ -436,7 +436,7 @@ VSL_Write(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
}
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;
......
......@@ -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_bitclr(int bit, void *priv);
typedef void vslc_delete_f(struct VSL_cursor *);
typedef int vslc_next_f(struct VSL_cursor *);
typedef int vslc_reset_f(struct VSL_cursor *);
typedef void vslc_delete_f(const struct VSL_cursor *);
typedef int vslc_next_f(const 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 *);
struct vslc_tbl {
......
......@@ -64,7 +64,7 @@ struct vslc_vsm {
};
static void
vslc_vsm_delete(struct VSL_cursor *cursor)
vslc_vsm_delete(const struct VSL_cursor *cursor)
{
struct vslc_vsm *c;
......@@ -114,7 +114,7 @@ vslc_vsm_check(const struct VSL_cursor *cursor, const struct VSLC_ptr *ptr)
}
static int
vslc_vsm_next(struct VSL_cursor *cursor)
vslc_vsm_next(const struct VSL_cursor *cursor)
{
struct vslc_vsm *c;
int i;
......@@ -189,7 +189,7 @@ vslc_vsm_next(struct VSL_cursor *cursor)
}
static int
vslc_vsm_reset(struct VSL_cursor *cursor)
vslc_vsm_reset(const struct VSL_cursor *cursor)
{
struct vslc_vsm *c;
unsigned segment;
......@@ -290,7 +290,7 @@ struct vslc_file {
};
static void
vslc_file_delete(struct VSL_cursor *cursor)
vslc_file_delete(const struct VSL_cursor *cursor)
{
struct vslc_file *c;
......@@ -320,7 +320,7 @@ vslc_file_readn(int fd, void *buf, size_t n)
}
static int
vslc_file_next(struct VSL_cursor *cursor)
vslc_file_next(const struct VSL_cursor *cursor)
{
struct vslc_file *c;
ssize_t i;
......@@ -363,7 +363,7 @@ vslc_file_next(struct VSL_cursor *cursor)
}
static int
vslc_file_reset(struct VSL_cursor *cursor)
vslc_file_reset(const struct VSL_cursor *cursor)
{
(void)cursor;
/* XXX: Implement me */
......@@ -439,7 +439,7 @@ VSL_CursorFile(struct VSL_data *vsl, const char *name, unsigned options)
}
void
VSL_DeleteCursor(struct VSL_cursor *cursor)
VSL_DeleteCursor(const struct VSL_cursor *cursor)
{
const struct vslc_tbl *tbl;
......@@ -450,7 +450,7 @@ VSL_DeleteCursor(struct VSL_cursor *cursor)
}
int
VSL_ResetCursor(struct VSL_cursor *cursor)
VSL_ResetCursor(const struct VSL_cursor *cursor)
{
const struct vslc_tbl *tbl;
......@@ -461,7 +461,7 @@ VSL_ResetCursor(struct VSL_cursor *cursor)
}
int
VSL_Next(struct VSL_cursor *cursor)
VSL_Next(const struct VSL_cursor *cursor)
{
const struct vslc_tbl *tbl;
......
......@@ -209,7 +209,7 @@ VRB_PROTOTYPE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
VRB_GENERATE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
static int
vslc_raw_next(struct VSL_cursor *cursor)
vslc_raw_next(const struct VSL_cursor *cursor)
{
struct vslc_raw *c;
......@@ -227,7 +227,7 @@ vslc_raw_next(struct VSL_cursor *cursor)
}
static int
vslc_raw_reset(struct VSL_cursor *cursor)
vslc_raw_reset(const struct VSL_cursor *cursor)
{
struct vslc_raw *c;
......@@ -249,7 +249,7 @@ static const struct vslc_tbl vslc_raw_tbl = {
};
static int
vslc_vtx_next(struct VSL_cursor *cursor)
vslc_vtx_next(const struct VSL_cursor *cursor)
{
struct vslc_vtx *c;
const uint32_t *ptr;
......@@ -300,7 +300,7 @@ vslc_vtx_next(struct VSL_cursor *cursor)
}
static int
vslc_vtx_reset(struct VSL_cursor *cursor)
vslc_vtx_reset(const struct VSL_cursor *cursor)
{
struct vslc_vtx *c;
......@@ -573,7 +573,7 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx)
/* Lookup a vtx by vxid from the managed list */
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 *vtx;
......
......@@ -44,7 +44,7 @@ cb(int tag, void *priv)
}
int
main(int argc, char *argv[])
main(int argc, char * const *argv)
{
int i;
......
......@@ -53,7 +53,8 @@ vxp_ErrToken(const struct vxp *vxp, const struct token *t)
}
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;
......@@ -68,7 +69,7 @@ vxp_Pos(struct vxp *vxp, struct vsb *vsb, const struct token *t, int tokoff)
}
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;
char c;
......
......@@ -50,7 +50,7 @@
static void vxp_expr_or(struct vxp *vxp, struct vex **pvex);
static struct vex *
vex_alloc(struct vxp *vxp)
vex_alloc(const struct vxp *vxp)
{
struct vex *vex;
......
......@@ -17,7 +17,7 @@ usage(void)
}
int
main(int argc, char **argv)
main(int argc, char * const *argv)
{
struct vsb *vsb;
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