Commit Graph

187 Commits

Author SHA1 Message Date
joerg
1ffe43311f Do not depend on failing malloc to set errno 2012-05-04 16:45:05 +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
tnozaki
2f142eb3e0 don't use __link_set_* stuff for locale implementation.
patch reviewed by matt@, thanks.
2012-03-04 21:14:55 +00:00
wiz
6234e98d3f Remove unused variables. From cppcheck via Henning Petersen in PR 45997. 2012-02-12 13:51:29 +00:00
tnozaki
1c5f19ca24 add comment about r1.6 -> r1.7 change. 2011-11-20 07:43:52 +00:00
tnozaki
7119b42a87 fix memory leak, pointed by nonaka-san(again^3). 2011-11-19 18:48:39 +00:00
tnozaki
c0a2d6e78c remove useless free(), pointed by nonaka-san(again^2). 2011-11-19 18:43:40 +00:00
tnozaki
25c06e6322 return EINVAL when module validation failed, pointed by nonaka-san(again). 2011-11-19 18:34:21 +00:00
tnozaki
a750734d28 remove unused variable, pointed by nonaka-san, thanks. 2011-11-19 18:20:13 +00:00
wiz
60025aa86f Use boolean AND instead of bitwise one in _DIAGASSERT.
From Henning Petersen in PR 45518.
2011-10-30 21:48:27 +00:00
christos
9292cfb210 close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
  fopen(db, "re")
2011-10-15 23:00:01 +00:00
tnozaki
6b58a1b843 revert r1.21, still problem exists for posix2008 mbsnrtowcs(not yet commited),
but i have no time to investigate t_mbrtowc failure.
2011-10-10 22:45:45 +00:00
tnozaki
9f0b22ed7d update string pointer when input is partial escape sequence or multibyte. 2011-10-07 18:59:13 +00:00
joerg
998c5d780f Make intermediate size variable size_t like the rest to avoid
unnecessary casting.
2011-05-23 14:53:46 +00:00
joerg
04d16b5c6d Use C99-style init in _CITRUS_PROP_HINT_END to avoid warnings for
uninitialised type field.
2011-05-23 14:52:32 +00:00
joerg
939ab48f97 Actually return something deterministic 2011-05-23 14:45:44 +00:00
jruoho
29a43bf561 From Henning Petersen in PR # 44641: C99 primitive type 'bool' used
as a variable name. Also small KNF, as in FreeBSD.
2011-03-30 08:22:01 +00:00
joerg
e325eedcc1 Remove tautology. 2010-12-07 22:01:45 +00:00
joerg
aaf356760f Mark function as static and give it an explicit return type. 2010-12-07 22:01:22 +00:00
tnozaki
3cc4120729 1. refactoring new locale-db(RuneCT10) loading method with mmap(2).
2. remove unused field from _RuneLocale.
3. localeio(CITRUS=no) can read new locale-db(RuneCT10) now.
2010-06-19 13:26:51 +00:00
tnozaki
2a7af30c36 1. split runetype_local.h -> runetype_file.h
and remove renameing _Rune* -> _NBRune* namespace protection.

   FreeBSD traditionaly exposes struct _Rune* in runetype.h
   which included by ctype.h. it may cause conflicting type error
   in our cross build process, former we use renaming namespace
   to avoid this problem, now i reworked more resonable way.

2. merge rune_local.h to runetype_local.h, and remove it.
3. split bsdctype.h -> bsdctype_{file,local}.h
2010-06-13 04:14:56 +00:00
tnozaki
9efec5bce3 1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
   so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
   prepareing for next libc major crunk.
4. bump libc minor version.
2010-06-07 13:52:28 +00:00
tnozaki
9a35d7972b more split ctype.h -> sys/ctype_inline.h, sys/ctype_bits.h 2010-06-01 13:52:07 +00:00
tnozaki
cd71bcf609 1. fix build problem CITRUS=no
2. make CITRUS={yes,no} knob friendly with libc/compat.
2010-05-30 08:28:53 +00:00
tnozaki
32cc8c2e5f rune.h is not public, so merge with rune_local.h. 2010-05-22 08:13:18 +00:00
tnozaki
5ad520e6d1 _locale_cache_t: change ldata and items to pointer for future binary compatibility. 2010-03-27 15:25:21 +00:00
tnozaki
56bf19aaea fix byte order mark related bug introduced by previous commit,
reported by Sverre Froyen via current-user, thanks!
2010-03-20 18:15:32 +00:00
tnozaki
36a8b8869c 1. fix wrong byte order mark of utf-16, reported by NARUSE Yui -san.
patch provided by tshiozak@ -san.

2. don't eat 0xfeff/0xfffe if they don't appear at the first of bytestream.
noticed y tshiozak@ -san, patch provied by me.

thanks a lot.
2010-03-15 15:00:58 +00:00
dholland
9af4cd75f3 Add parentheses around a misleading string constant concatenation,
from (my own, very old) PR 36064.
2009-09-05 06:44:27 +00:00
lukem
83f6c8b3a4 fix -Wcast-qual issue 2009-04-12 14:20:19 +00:00
tnozaki
5f8a9fb1ee fix typo, don't overwrite LC_TIME's t_fmt_ampm by t_fmt. 2009-02-09 14:39:48 +00:00
lukem
a99197aa1c sign-compare fix 2009-02-03 04:58:38 +00:00
tnozaki
db74109901 PR lib/40411, nuke wctrans_init(). lazy initialization is not good idea.
statically initialized _DefaultRuneLocale.rl_wctrans field.
so we can re-const-ify _DefaultRuneLocale.

pkgsrc/shells/standalone-tcsh should be rebuild,
because it's staticaly linked binary.
2009-01-18 22:03:19 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
dogcow
441204832d move nbtool_config.h include to top. 2009-01-05 03:10:02 +00:00
tnozaki
52ed7b035f Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
  new locale-db implementation using citrus_db backend,
  see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
  internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
  LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
    en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
    zh_CN.eucCN -> zh_CN.GB18030
    and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
  for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
  i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
2009-01-02 00:20:18 +00:00
christos
674681d3c0 fix gcc warnings from Alexander Shishkin 2008-07-25 14:05:25 +00:00
tnozaki
e1ee662664 remove unused include, locale.h. 2008-06-14 16:01:07 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tnozaki
7ed5b48246 add BOM to utf-16/32 stream in case that endian is not specified,
like other iconv implementation, GNU libiconv, glibc2 iconv, perl iconv.
2008-03-20 11:47:45 +00:00
junyoung
a81d5c256d __attribute__((__packed__)) -> __packed. 2008-02-10 05:58:22 +00:00
junyoung
f59892f81b u_intXX_t -> uintXX_t. 2008-02-09 14:56:20 +00:00
tnozaki
7e1ba00ce8 more PR/36938, restore internal-state if mbtowc() throw EILSEQ.
patch provided by Shiozaki-san, thanks.
2007-11-26 15:31:30 +00:00
tnozaki
fca38949e4 fix lib/37290
- don't call abort(3) when there's no suitable charset found.
- use iso-8859-1(or INIT1 if specified) for C1 control char.
2007-11-21 14:19:32 +00:00
tnozaki
561e0bd51b remove invalid range check. 2007-10-23 15:28:25 +00:00
tnozaki
0941b12b16 lib/36938 mbtowc misbehaving after invalid char sequence
- make sure to initialize mbtowc's internal state.
 - add regression test.
2007-09-18 15:12:07 +00:00
tnozaki
6a1c27dd91 fix typo. 2007-04-24 15:42:08 +00:00
tnozaki
fd2dd8ec0d add new encoding support to iconv(3):
- RISCOS-LATIN1
	- DEC-MCS
	- DEC-HANYU(libDECHanyu)
2007-04-01 18:52:28 +00:00
tnozaki
9f260693ac disallow illegal utf-8 byte sequence and surrogate chars (RFC3629).
5-6 byte sequence(0x110000 - 0x7FFFFFFF) are still available
for backward compatibility.
2007-03-06 16:13:58 +00:00
tnozaki
1bf1d71e3c iconv: add following CCS/CES support.
- CNS11643-[3-7] <-> UCS:BMP/SIP (EUC-TW, ISO-2022-CN-EXT)
- HKSCS <-> UCS:BMP/SIP (Big5-HKSCS)
- JISX0213-[1-2] <-> UCS:BMP/SIP (EUC-JIS-2004,Shift_JIS-2004,ISO-2022-JP-2004)
2007-03-05 16:57:06 +00:00