Commit Graph

49 Commits

Author SHA1 Message Date
itohy 7daefc5a5a Passing "char" values to ctype(3) functions is problematic.
If an argument of a ctype function is outside "unsigned char"
and if it is not EOF, the behavior is undefined.

The isascii(3) is the sole exception of above and it was used to
be used to check a value was valid for other ctype functions in
ancient systems.  On modern systems, the ctype functions take
all values of "unsigned char", and this check is obsolete and
even wrong for non-ASCII systems.  However, we leave the isascii()
untouched for now, so as not to change the current behavior.
2000-07-07 08:03:36 +00:00
mycroft 605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
kleink c46d95a329 The previous assertion change was incorrect: the preg argument is permitted to
be NULL (part of the interface definition!) unless errcode is REG_ATOI, which
is a non-portable extension.

Also, remove assertions from the local regatoi() function, as they are either
redundant or will never fail due to the buffer allocation for that argument in
regerror().
1999-09-17 09:33:34 +00:00
lukem b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
christos c927d63f09 Avoid overflow when adding a 64 bit quantity to a 32 bit pointer on 32 bit
machines.
1999-01-20 12:58:21 +00:00
drochner b6581ead5f Minor size_t!=int related cleanup, only effective on the alpha.
btw: the maximum length of an RE is limited by the "int" range, also
on the alpha. "sopno" is "int", and "int"s are used as counters within
the code, so it would need some work to change this. I only don't know
how one could test it...
1998-12-13 12:21:46 +00:00
drochner 7cd4c14e82 regoff_t is used like size_t within the code, it should be defined
so instead of off_t. This makes some casts unnecessary.
We can't change the definition now due to binary compatibility, so
prepare for the next libc major version.
1998-12-08 14:00:24 +00:00
drochner 64a8986fc2 Change some function arguments to appropriate types. This makes lint
happy without casts.
1998-12-08 13:52:48 +00:00
drochner 25804e11c9 remove another unneeded cast 1998-12-08 13:49:46 +00:00
drochner 285638718a correct a comment, minor formatting 1998-12-08 13:48:06 +00:00
drochner c300f8f462 Back out part of the last change. This broke on the alpha (or wherever
sizeof(u_int32_t) != sizeof(*)), at least in cases with re->re_g->nstates
between 32 and 64.
Primary reason for the breakage was that the "states1" definition didn't
work as expected. (It didn't work before either, but this was not noticed
due to sizeof(long)==sizeof(*).)
The alpha can handle larger problems with the "small" state machine model
if a "long" is used as state variable, so it is better to keep the old
definition here. (u_int32_t is left for the "operator" variables.)
Use "int" as "sopno" - this is used as index into the states field, there
is no point in using a fized-size type.
1998-12-08 13:41:42 +00:00
christos 4523c05fa8 Delint:
- we don't need to use longs; convert to use int32_t.
	- remove break statements after returns.
	- cast things properly.
1998-11-14 16:43:49 +00:00
lukem ce83c69e00 first pass at fixing up capitalization of function names and
arguments; ensure that each is correct with respect to the
implementation, rather than being correct as per english.
1998-08-29 08:32:32 +00:00
mycroft 392dcacb66 const poisoning. 1998-07-26 12:17:51 +00:00
mycroft 9ad899cc18 constify some tables. 1998-07-26 11:24:14 +00:00
mycroft 44436bf77f constify some tables. 1998-07-26 11:11:07 +00:00
perry 6982982f8d macroize BSD, NetBSD, FreeBSD and misc cleanup 1998-02-06 05:39:31 +00:00
perry 312aca536f add LIBRARY section to man page 1998-02-05 18:45:17 +00:00
perry dc1e66a8e4 remove illegal quotes from .Dd directives 1998-02-05 07:28:01 +00:00
perry c8bafd6265 remove obsolete register declarations 1998-02-03 18:38:12 +00:00
kleink acb9e4216c Enhance readability by converting to use -mdoc macros. 1998-01-18 20:59:26 +00:00
mrg 4e252e8c4d add missing .Nm entries. from spz@serpens.swb.de. 1997-11-14 02:04:36 +00:00
lukem d0e23d974a - use CPPFLAGS instead of CFLAGS
- use ${COMPILE.C} ... instead of ${CC} ${CFLAGS} -c ...
1997-10-22 23:14:04 +00:00
jtc 43fa6fe319 If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore.  The library will use those
names internally.  Weak aliases are used to provide the original names
to the API.

This is only the first part of this change.  It is most of the functions
which are implemented in C for all NetBSD ports.  Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
1997-07-21 14:06:24 +00:00
christos c7d2bdf50e Remove unused variable
Fix RCSID's
1997-07-13 20:06:26 +00:00
christos 5f61e3e292 Fix RCSID's
Remove unused variable
1997-07-13 20:06:00 +00:00
christos 05e3795ec8 Add braces in initializers.
Fix RCSID's
Remove unused variables
1997-07-13 20:05:37 +00:00
christos 3127e6a7cf Fix RCSID's
Fix gcc warnings.
Add missing prototypes
#if 0 unused functions
1997-07-13 20:04:32 +00:00
christos 9cdb67bbd0 Add missing return NULL; 1997-07-13 20:03:30 +00:00
christos a654524992 Add missing braces in initializers. 1997-07-13 20:02:50 +00:00
cgd c765a5a975 qualify opcode constants with long, so that bad things don't happen when long
!= 32 bits.  This might need a bit more thought (i.e. why use long here to
begin with, when int32_t might be a better choice), but for now it's good
enough.  From Ross Harvey in PR 3450, extended by me to cover the rest of
the opcode constants and masks.
1997-04-06 19:29:14 +00:00
mrg 9cd5492c02 - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
1997-01-23 14:01:45 +00:00
cgd eea7e63f50 fix a slight bogon (found by lint) introduced in rev 1.5 (by me, no less!).
Don't cast 'INC()'s argument's type, since it's an lvalue and cast
variables aren't lvalues.
1996-12-19 06:35:52 +00:00
mycroft 4c34be6b52 Clean up deleted files. 1995-03-01 00:00:00 +00:00
cgd 2c84ad3a41 add unintrusive Ids 1995-02-27 13:22:58 +00:00
cgd da1fb002e9 make these safe for a 64-bit world. 1995-02-10 17:47:26 +00:00
cgd 6c4c74998b fix man page specs, per bug 788 from John Smerdon. 1995-02-08 13:48:24 +00:00
mycroft 8d6f89d5bd Clean up deleted files. 1995-01-30 12:19:29 +00:00
cgd 7c6ed81dae clean up import; kill old cruft. 1995-01-30 12:19:13 +00:00
cgd 0e14985799 regex code from lite. same as we're using, but slightly cleaner. 1995-01-30 12:16:51 +00:00
cgd ae9172d6cd specify man pages the new way. 1994-12-22 09:57:51 +00:00
cgd dd7a2bfae8 re_format name fixes from Mark Weaver 1994-04-01 08:46:28 +00:00
jtc b7744e07bd Upgrade regex routines to alpha3.4. 1994-03-22 00:39:48 +00:00
mycroft 93a691920e Clean up deleted files. 1994-02-23 21:20:45 +00:00
jtc 3ed83140b4 Upgrade regex routines to alpha3.3. 1994-02-23 21:17:36 +00:00
jtc 38a3e9d21d Update to Henry's Nov 11 release -- no code changes, only the addition of
a copyright file.  I'm checking it in now, rather than waiting for the
next "real" release, since the rest of the files do not have their own
copyright notices.
1993-11-16 00:04:20 +00:00
jtc 6931099e77 Update to Henry's Nov 2, 1993 alpha3.2 release. 1993-11-11 02:02:57 +00:00
jtc b90ff8310a Henry Spencer's POSIX.2 compatibile regular expression matching routines. 1993-11-10 23:34:55 +00:00