Commit Graph

37 Commits

Author SHA1 Message Date
Roman Divacky
3f8760e331 Remove inlining of functions that are used mostly in different object files.
This gets rid of gnu89 style inlining. Also silence gcc by assigning two
variables NULL. This lets use to remove NO_WERROR.

Approved by:	kib (mentor)
Approved by:	harti
2009-01-20 17:15:12 +00:00
Hartmut Brandt
3814743160 Move the Boolean and ReturnStatus stuff from sprite.h to util.h and
get rid of sprite.h.

Obtained from:	DragonFlyBSD
2005-05-13 08:53:00 +00:00
Hartmut Brandt
ae6bff540a Move the MAX macro to a util.h so it becomes usable in other modules.
Suggested by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-31 11:12:45 +00:00
Hartmut Brandt
9668c011e9 Two new functions: Buf_Data() returns a reference to the data in
the buffer and Buf_AppendBuf() appends a copy of one buffer to another
buffer.

Patch:		7.146,7.147

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:42:51 +00:00
Hartmut Brandt
3509f4d713 Create a new function Buf_Peel that returns the string from inside
a Buffer and frees the Buffer.
2005-03-08 13:15:18 +00:00
Hartmut Brandt
46ca434737 Introduce Buf_StripNewLines() and use it where appropriate.
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-07 11:27:47 +00:00
Hartmut Brandt
ae9eed1281 Invent a Buf_AppendRange function that appends a non-NUL-terminated string
given by a pointer to the start of the string and a pointer one behind
the end.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-07 07:54:23 +00:00
Hartmut Brandt
d01d6678ad Invent a Buf_Append function to append a NUL-terminated string
and use it thoughout the code.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-07 07:49:16 +00:00
Hartmut Brandt
f4dd241033 Rewrite of the buf code:
- convert Buf_AddByte from a macro to a function
- move #define's into the header file
- remove unused field in struct Buffer
- remove size fields - they can be easily computed
- inline Buf_OvAddByte

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-04 16:48:35 +00:00
Hartmut Brandt
b8900c134b None of the users of Buf_Discard used it to get rid of only a part of
the buffer. So replace Buf_Discard by Buf_Clear which just gets rid
of the entire contents.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-04 13:34:16 +00:00
Hartmut Brandt
6f8d22e416 Remove a couple of unused buffer functions.
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-02 11:21:26 +00:00
Hartmut Brandt
ab9e1eb050 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>
2005-02-02 07:36:18 +00:00
Hartmut Brandt
7a2029bac2 Clean up include files and file including. Split nonints.h into pieces
that get included just where they are needed. All headers include the
headers that they need to compile (just with an empty .c file). Sort
includes alphabetically where apropriate and fix some duplicate commenting
for struct Job, struct GNode and struct Shell by removing one version and
inlining the comments into the structure declaration (the comments have been
somewhat outdated).

This patch does not contain functional changes (checked with md5).

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-01 10:50:37 +00:00
Hartmut Brandt
e97977d265 Remove an extra space.
Submitted by:	ru
2004-12-03 13:03:16 +00:00
Hartmut Brandt
2d3d282892 Put macro arguments in paranthesis.
Submitted by:	johan
2004-12-03 12:02:14 +00:00
Hartmut Brandt
b6899024a6 Make sizes to be of type size_t and correct function arguments that
should be Byte (as the numerous casts to Byte in the function calls show).
2004-12-03 11:59:30 +00:00
Hartmut Brandt
002c565593 Style: fix indentation, protect macro with do { } while (0).
Checked with: diff on object file.
2004-12-03 08:43:07 +00:00
Hartmut Brandt
d21474cec4 Style: remove a lot of unnecessary casts, add some and spell the null
pointer constant as NULL.

Checked by: diff -r on the object files before and after
2004-12-01 10:29:20 +00:00
Hartmut Brandt
e6417f6fe2 Stylification: missing spaces, extra space after function names, casts
and the sizeof operator, missing empty lines, void casts, extra empty lines.

Checked by: diff on make *.o lst.lib/*.o

Submitted by:	Max Okumoto <okumoto@soe.ucsd.edu> (partly)
2004-11-30 17:46:29 +00:00
Juli Mallett
4526ed6ffb Convert make(1) to use ANSI style function declarations. Variable
documentation already adequatedly existed in the description in most
cases.  Where it did not, it was added.  If no documentation existed
beforehand, then none was added.  Some unused dummies for use in the
traversal functions were marked as __unused during the conversion.
Occasionally, local style fixes were applied to lines already being
modified or influenced.

Now make(1) should always build with WARNS=3.
2002-10-09 03:42:10 +00:00
Juli Mallett
37721c8309 #define<space> -> #define<tab> 2002-09-17 21:29:06 +00:00
Juli Mallett
a446b510a4 Avoid classy use of a variable one time with a constant value. 2002-06-13 08:57:53 +00:00
David E. O'Brien
9b24805230 Fix copyrights, and undo SCS ID damage. 2002-04-13 10:57:56 +00:00
David E. O'Brien
4d1f4209a6 Update SCM ID method. 2002-04-13 10:17:18 +00:00
David E. O'Brien
a59e308cd7 De'register. 2002-04-13 10:05:30 +00:00
Wilfredo Sanchez
023944f435 Use __RCSID() 2000-07-09 02:54:54 +00:00
Tim Vanderhoek
06b1dcf182 Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde) 1999-09-11 13:08:02 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Tim Vanderhoek
9bd2d6eee4 Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).
Obtained from:	OpenBSD, sometimes indirected from NetBSD; myself
1999-08-17 00:39:26 +00:00
Peter Wemm
53faa0dade Revert $FreeBSD$ to $Id$ 1997-02-22 19:29:21 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Steve Price
5d55a64610 O' to be bitten by CVS. Cleanup after import
of Christos' version of make(1) and add Id's.

Set straight by: Bruce Evans and Peter Wemm :)
1996-10-08 04:07:59 +00:00
Steve Price
c0d06fe463 Merge in NetBSD's changes to make(1). Changes include:
- Add the .PHONY, .PARALLEL, and .WAIT directives
	- Added the -B and -m commandline flags
	- misc. man page cleanups
	- numerous job-related enhancements
	- removed unused header file (bit.h)
	- add util.c for functions not found in other envs.
	- and a few coordinated whitespace changes

Special thanks to Christos Zoulas <christos@netbsd.org>
for help in the merge.  A 'diff -ur' between Net and
FreeBSD now only contains sccsid-related diffs. :)

Obtained from: NetBSD, christos@netbsd.org, and me
1996-10-06 02:35:38 +00:00
Steve Price
6bf3beb134 Fix for PR# 1095, make's continuation line handling buggy
when used with .elif.  Additional fixes include:

    - fix continuation line handling when using .for
    - plug up a memory leak
1996-09-22 02:28:36 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Jordan K. Hubbard
9f574f9a90 Bring in a number of changes from NetBSD's make, fixing quite a few
problems in the process:

1. Quoting should work properly now.  In particular, Chet's reported bash
   make problem has gone away.
2. A lot of memory that just wasn't being free'd after use is now freed.
   This should cause make to take up a LOT less memory when dealing with
   archive targets.
3. Give proper credit to Adam de Boor in a number of files.
Obtained from: NetBSD (and Adam de Boor)
1995-01-23 21:03:17 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00