Commit Graph

184 Commits

Author SHA1 Message Date
christos
3504287a90 fix bug in previous change (sz should be the size of the newly allocated
buffer).
2013-12-25 19:42:23 +00:00
christos
e73d0381b5 It's been many years since realloc(NULL, size) == malloc(size). Also don't
destroy pointers on allocation errors so someone can free them later.
2013-12-14 18:04:56 +00:00
christos
4008ee50a3 knf, reduce pointer gymnastics 2013-12-14 18:04:00 +00:00
christos
b605a13ba6 - centralize opening of regular and temp files to avoid code duplication
- don't cast malloc
- use malloc sizeof(*var) instead of sizeof(type)
2013-12-01 00:22:48 +00:00
christos
c64e72248f switch from circleq to tailq, from FreeBSD 2013-11-22 16:25:51 +00:00
ryoon
27e03817f7 Fix typos from FreeMiNT's db-1.86 patch. 2013-09-04 13:03:22 +00:00
njoly
b6d38f1490 Remove some more unneeded Pp macros. 2012-10-13 15:28:33 +00:00
christos
c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +00:00
joerg
82c56d333f libc passes the relaxed array boundary check in clang now. 2011-08-09 13:03:36 +00:00
christos
ab0103dee5 fix type punned warnings in debugging code. 2011-07-17 20:47:39 +00:00
christos
a26b732aad put back some compat code for systems that don't have O_CLOEXEC. 2011-06-26 22:27:14 +00:00
christos
dcc9c82156 - use sizeof(var) instead of sizeof(type)
- remove useless cast
2011-06-26 22:20:31 +00:00
christos
5589fc5ec0 - Fix bug copying only 1 byte instead of the whole page number. Broke nvi
joining lines that needed R_BIGDATA.
- Fix from FreeBSD for nrec IAFTER.
XXX: Should be pulled up to 5.x
2011-06-26 22:18:16 +00:00
christos
9ad6d70c15 use O_CLOEXEC 2011-06-26 22:16:46 +00:00
mrg
493d341048 various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
2011-06-20 09:11:16 +00:00
joerg
a216da57a6 Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
2011-05-26 12:56:24 +00:00
christos
4957358ed5 Correct check for snprintf() overflow via Maksymilian Arciemowicz from FreeBSD.
(the bt one was ok, but set errno and make it the same for consistency).
[to be pulled up]
2011-04-17 23:12:38 +00:00
jruoho
9f95187844 .Fn, offset indent, complete reference. 2010-12-16 12:08:16 +00:00
jruoho
fe6e1d361b Fix the references and -offset indent. 2010-12-16 11:57:20 +00:00
jruoho
c1a91d0bee Use .Fn. 2010-12-16 11:49:35 +00:00
jruoho
61d5c5bd31 Note the POSIX compliance (already since SUSv2, '97). 2010-05-05 06:55:57 +00:00
joerg
1c3412fa2f Use .In for header files instead of .Ar Pa and variations. 2010-03-22 19:30:53 +00:00
christos
3c2585b945 correct cast to size_t. 2009-04-23 22:09:23 +00:00
agc
9c3b1325df Cast the arg to an unsigned value to let this compile 2009-04-23 03:49:39 +00:00
njoly
41f89f9e08 Include string.h for memset prototype. 2009-04-22 21:52:59 +00:00
christos
0f03f83ae4 Avoid information leaks by zeroing memory, from FreeBSD (we had done some
already)
2009-04-22 18:44:06 +00:00
joerg
59ba3c43a4 -width needs an argument, so provide one. 2009-04-11 20:39:15 +00:00
lukem
c7201a0f39 fix -Wsign-compare issues 2009-02-12 06:35:54 +00:00
lukem
eb0de3bfe5 fix sign-compare issues 2009-02-12 06:33:13 +00:00
lukem
79becf98cb sign-compare fixes 2009-01-29 02:02:36 +00:00
tsutsui
61a62e59f7 unsigned int32_t -> uint32_t 2008-09-26 11:41:06 +00:00
joerg
d3595ddff7 Consistently include "nbtool_config.h" when cross-compiling. 2008-09-11 12:58:00 +00:00
joerg
65f930bc37 Remove one remaining sccsid. 2008-09-11 12:33:55 +00:00
joerg
52c4a82ef2 In preparation for providing a db fallback in libnbcompat, remove
sccsid and conditionals around __RCSID. lint understands __RCSID enough
to ignore it, undefining LIBC_SCCS is superseded by MKSTRIPIDENT.
No functional changes.
2008-09-10 17:52:35 +00:00
lukem
4e3bc9a2d6 Expand the description of bsize, and correct the description of the default. 2008-09-05 06:25:04 +00:00
joerg
dcb3546b5c Fix __log2 to not loop for 0x80000000 and higher. 2008-08-28 11:00:43 +00:00
joerg
40b37a3bf2 Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as
it is mostly about the wire format.

Patched libc.so is bit-identical.

OK matt@
2008-08-26 21:18:38 +00:00
joerg
8609f98c0c mpool.libtp seems to be an ancient copy of mpool.c, nuke it. 2008-08-25 21:24:07 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
christos
cb9daf8f10 cleanup:
- remove __P
	- remove unneeded casts
	- add _DIAGASSERT
	- add more diagnostics for integer overflow
	- fix size_t/int confusion
	- make debugging and statistics code compile
2007-02-03 23:46:09 +00:00
christos
95c7627c87 use FD_CLOEXEC instead of 1. 2006-11-03 20:18:49 +00:00
rtr
b3c940abb1 set close-on-exec flag for fd to database like type DB_HASH does
approved by christos@
2006-03-26 02:03:40 +00:00
rtr
8c8b6ee256 make __hash_open obey TMPDIR
resolves pr32565 and pr32454
2006-03-26 02:00:37 +00:00
rtr
03c7830389 retrun -> return 2006-03-19 03:36:28 +00:00
christos
8a45d1a675 Coverity CID 45: Don't try to deref NULL on error. 2006-03-19 02:30:52 +00:00
christos
854b420cd9 Coverity CID 518: Avoid NULL pointer deref. 2006-03-19 02:21:15 +00:00
christos
53cd70b68b Coverity CID 508: Avoid memory leak. 2006-03-19 02:09:44 +00:00
christos
096020da19 fix debugging memsets. 2006-01-24 17:37:05 +00:00
christos
a3ae551d7e simplify assertion. 2006-01-24 17:35:33 +00:00
christos
ec567cd38c appease lint and gcc. (compile with -DDEBUG) 2006-01-24 17:24:37 +00:00