summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/buf.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-02-02 07:36:18 +0000
committerharti <harti@FreeBSD.org>2005-02-02 07:36:18 +0000
commite55f5e8b6f4c9cf6b01f539144a14d2f9680e575 (patch)
tree4825321dce7848eb1b15bd084d39df490dcc822d /usr.bin/make/buf.c
parent4130080e12ab49a659e616322a16e9db22726595 (diff)
downloadFreeBSD-src-e55f5e8b6f4c9cf6b01f539144a14d2f9680e575.zip
FreeBSD-src-e55f5e8b6f4c9cf6b01f539144a14d2f9680e575.tar.gz
Convert several typedefs from beeing pointers to structs to be the structs
itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/buf.c')
-rw-r--r--usr.bin/make/buf.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c
index 29ae06b..ae02ca2 100644
--- a/usr.bin/make/buf.c
+++ b/usr.bin/make/buf.c
@@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$");
*-----------------------------------------------------------------------
*/
void
-Buf_OvAddByte(Buffer bp, Byte byte)
+Buf_OvAddByte(Buffer *bp, Byte byte)
{
bp->left = 0;
@@ -125,7 +125,7 @@ Buf_OvAddByte(Buffer bp, Byte byte)
*-----------------------------------------------------------------------
*/
void
-Buf_AddBytes(Buffer bp, size_t numBytes, const Byte *bytesPtr)
+Buf_AddBytes(Buffer *bp, size_t numBytes, const Byte *bytesPtr)
{
BufExpand(bp, numBytes);
@@ -154,7 +154,7 @@ Buf_AddBytes(Buffer bp, size_t numBytes, const Byte *bytesPtr)
*-----------------------------------------------------------------------
*/
void
-Buf_UngetByte(Buffer bp, Byte byte)
+Buf_UngetByte(Buffer *bp, Byte byte)
{
if (bp->outPtr != bp->buffer) {
@@ -204,7 +204,7 @@ Buf_UngetByte(Buffer bp, Byte byte)
*-----------------------------------------------------------------------
*/
void
-Buf_UngetBytes(Buffer bp, size_t numBytes, Byte *bytesPtr)
+Buf_UngetBytes(Buffer *bp, size_t numBytes, Byte *bytesPtr)
{
if ((size_t)(bp->outPtr - bp->buffer) >= numBytes) {
@@ -246,7 +246,7 @@ Buf_UngetBytes(Buffer bp, size_t numBytes, Byte *bytesPtr)
*-----------------------------------------------------------------------
*/
int
-Buf_GetByte(Buffer bp)
+Buf_GetByte(Buffer *bp)
{
int res;
@@ -277,7 +277,7 @@ Buf_GetByte(Buffer bp)
*-----------------------------------------------------------------------
*/
int
-Buf_GetBytes(Buffer bp, size_t numBytes, Byte *bytesPtr)
+Buf_GetBytes(Buffer *bp, size_t numBytes, Byte *bytesPtr)
{
if ((size_t)(bp->inPtr - bp->outPtr) < numBytes)
@@ -308,7 +308,7 @@ Buf_GetBytes(Buffer bp, size_t numBytes, Byte *bytesPtr)
*-----------------------------------------------------------------------
*/
Byte *
-Buf_GetAll(Buffer bp, size_t *numBytesPtr)
+Buf_GetAll(Buffer *bp, size_t *numBytesPtr)
{
if (numBytesPtr != NULL)
@@ -331,7 +331,7 @@ Buf_GetAll(Buffer bp, size_t *numBytesPtr)
*-----------------------------------------------------------------------
*/
void
-Buf_Discard(Buffer bp, size_t numBytes)
+Buf_Discard(Buffer *bp, size_t numBytes)
{
if ((size_t)(bp->inPtr - bp->outPtr) <= numBytes) {
@@ -357,7 +357,7 @@ Buf_Discard(Buffer bp, size_t numBytes)
*-----------------------------------------------------------------------
*/
size_t
-Buf_Size(Buffer buf)
+Buf_Size(Buffer *buf)
{
return (buf->inPtr - buf->outPtr);
@@ -378,10 +378,10 @@ Buf_Size(Buffer buf)
*
*-----------------------------------------------------------------------
*/
-Buffer
+Buffer *
Buf_Init(size_t size)
{
- Buffer bp; /* New Buffer */
+ Buffer *bp; /* New Buffer */
bp = emalloc(sizeof(*bp));
@@ -410,7 +410,7 @@ Buf_Init(size_t size)
*-----------------------------------------------------------------------
*/
void
-Buf_Destroy(Buffer buf, Boolean freeData)
+Buf_Destroy(Buffer *buf, Boolean freeData)
{
if (freeData)
@@ -433,7 +433,7 @@ Buf_Destroy(Buffer buf, Boolean freeData)
*-----------------------------------------------------------------------
*/
void
-Buf_ReplaceLastByte(Buffer buf, Byte byte)
+Buf_ReplaceLastByte(Buffer *buf, Byte byte)
{
if (buf->inPtr == buf->outPtr)
Buf_AddByte(buf, byte);
OpenPOWER on IntegriCloud