- djm@cvs.openbsd.org 2010/02/09 03:56:28

[buffer.c buffer.h]
     constify the arguments to buffer_len, buffer_ptr and buffer_dump
This commit is contained in:
Damien Miller 2010-02-12 09:23:40 +11:00
parent 86cbb44d47
commit 8922106fe9
3 changed files with 11 additions and 8 deletions

View File

@ -24,6 +24,9 @@
- djm@cvs.openbsd.org 2010/02/09 00:50:59
[ssh-keygen.c]
fix -Wall
- djm@cvs.openbsd.org 2010/02/09 03:56:28
[buffer.c buffer.h]
constify the arguments to buffer_len, buffer_ptr and buffer_dump
20100210
- (djm) add -lselinux to LIBS before calling AC_CHECK_FUNCS for

View File

@ -1,4 +1,4 @@
/* $OpenBSD: buffer.c,v 1.31 2006/08/03 03:34:41 deraadt Exp $ */
/* $OpenBSD: buffer.c,v 1.32 2010/02/09 03:56:28 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -160,7 +160,7 @@ buffer_check_alloc(Buffer *buffer, u_int len)
/* Returns the number of bytes of data in the buffer. */
u_int
buffer_len(Buffer *buffer)
buffer_len(const Buffer *buffer)
{
return buffer->end - buffer->offset;
}
@ -228,7 +228,7 @@ buffer_consume_end(Buffer *buffer, u_int bytes)
/* Returns a pointer to the first used byte in the buffer. */
void *
buffer_ptr(Buffer *buffer)
buffer_ptr(const Buffer *buffer)
{
return buffer->buf + buffer->offset;
}
@ -236,7 +236,7 @@ buffer_ptr(Buffer *buffer)
/* Dumps the contents of the buffer to stderr. */
void
buffer_dump(Buffer *buffer)
buffer_dump(const Buffer *buffer)
{
u_int i;
u_char *ucp = buffer->buf;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: buffer.h,v 1.18 2010/01/12 01:36:08 djm Exp $ */
/* $OpenBSD: buffer.h,v 1.19 2010/02/09 03:56:28 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@ -27,8 +27,8 @@ void buffer_init(Buffer *);
void buffer_clear(Buffer *);
void buffer_free(Buffer *);
u_int buffer_len(Buffer *);
void *buffer_ptr(Buffer *);
u_int buffer_len(const Buffer *);
void *buffer_ptr(const Buffer *);
void buffer_append(Buffer *, const void *, u_int);
void *buffer_append_space(Buffer *, u_int);
@ -40,7 +40,7 @@ void buffer_get(Buffer *, void *, u_int);
void buffer_consume(Buffer *, u_int);
void buffer_consume_end(Buffer *, u_int);
void buffer_dump(Buffer *);
void buffer_dump(const Buffer *);
int buffer_get_ret(Buffer *, void *, u_int);
int buffer_consume_ret(Buffer *, u_int);