[BACK]Return to buf.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/buf.c between version 1.3 and 1.4

version 1.3, 1996/06/26 05:36:25 version 1.4, 1996/11/30 21:08:50
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*      $NetBSD: buf.c,v 1.7 1996/03/29 02:17:13 jtc Exp $      */  /*      $NetBSD: buf.c,v 1.8 1996/11/06 17:59:00 christos Exp $ */
   
 /*  /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.   * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Line 41 
Line 41 
   
 #ifndef lint  #ifndef lint
 #if 0  #if 0
 static char sccsid[] = "@(#)buf.c       5.5 (Berkeley) 12/28/90";  static char sccsid[] = "@(#)buf.c       8.1 (Berkeley) 6/6/93";
 #else  #else
 static char rcsid[] = "$OpenBSD$";  static char rcsid[] = "$OpenBSD$";
 #endif  #endif
Line 131 
Line 131 
 Buf_AddBytes (bp, numBytes, bytesPtr)  Buf_AddBytes (bp, numBytes, bytesPtr)
     register Buffer bp;      register Buffer bp;
     int     numBytes;      int     numBytes;
     Byte    *bytesPtr;      const Byte *bytesPtr;
 {  {
   
     BufExpand (bp, numBytes);      BufExpand (bp, numBytes);
Line 293 
Line 293 
     int     numBytes;      int     numBytes;
     Byte    *bytesPtr;      Byte    *bytesPtr;
 {  {
   
     if (bp->inPtr - bp->outPtr < numBytes) {      if (bp->inPtr - bp->outPtr < numBytes) {
         numBytes = bp->inPtr - bp->outPtr;          numBytes = bp->inPtr - bp->outPtr;
     }      }
Line 330 
Line 330 
     if (numBytesPtr != (int *)NULL) {      if (numBytesPtr != (int *)NULL) {
         *numBytesPtr = bp->inPtr - bp->outPtr;          *numBytesPtr = bp->inPtr - bp->outPtr;
     }      }
   
     return (bp->outPtr);      return (bp->outPtr);
 }  }
   
Line 343 
Line 343 
  *      None.   *      None.
  *   *
  * Side Effects:   * Side Effects:
  *      The bytes are discarded.   *      The bytes are discarded.
  *   *
  *-----------------------------------------------------------------------   *-----------------------------------------------------------------------
  */   */
Line 435 
Line 435 
     Buffer  buf;        /* Buffer to destroy */      Buffer  buf;        /* Buffer to destroy */
     Boolean freeData;   /* TRUE if the data should be destroyed as well */      Boolean freeData;   /* TRUE if the data should be destroyed as well */
 {  {
   
     if (freeData) {      if (freeData) {
         free ((char *)buf->buffer);          free ((char *)buf->buffer);
     }      }
     free ((char *)buf);      free ((char *)buf);
   }
   
   /*-
    *-----------------------------------------------------------------------
    * Buf_ReplaceLastByte --
    *     Replace the last byte in a buffer.
    *
    * Results:
    *     None.
    *
    * Side Effects:
    *     If the buffer was empty intially, then a new byte will be added.
    *     Otherwise, the last byte is overwritten.
    *
    *-----------------------------------------------------------------------
    */
   void
   Buf_ReplaceLastByte (buf, byte)
       Buffer buf; /* buffer to augment */
       Byte byte;  /* byte to be written */
   {
       if (buf->inPtr == buf->outPtr)
           Buf_AddByte(buf, byte);
       else
           *(buf->inPtr - 1) = byte;
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4