Commit Graph

25 Commits

Author SHA1 Message Date
Joseph Sutton
1f88e8c919 wind: Fix code spelling
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-28 21:34:35 -05:00
Joseph Sutton
a3878d3e9d wind: Deny invalid UTF-8 encodings
Codepoints above U+10FFFF and overlong encodings are considered invalid.
Unpaired surrogates are not, as these are known to be generated on
occasion — by Windows, for example.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
bf25b38c0a wind: Support UTF-8–encoding non-BMP codepoints
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
ba63461cd4 wind: Support UTF-16–encoding non-BMP codepoints
View with ‘git show -b’.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
821fac3648 wind: Use portable integer types
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
db70a76074 wind: Do not perform arithmetic on a NULL pointer
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Joseph Sutton
ed798da1f2 wind: Fix documentation comment
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-08 14:58:21 -06:00
Daria Phoebe Brashear
133f517482 rewrite fallthrough to HEIM_FALLTHROUGH to deal with new Apple SDKs
Apple clang version 14.0.0 (clang-1400.0.17.3.1) fails the build
because stds.h defines `fallthrough` as a macro which is then
expanded when base.h evaluates

  # if __has_attribute(fallthrough) && __clang_major__ >= 5

The macOS SDK defines `DISPATCH_FALLTHROUGH` as the macro instead
of `fallthrough`.

This change replaces the use of `fallthrough` in the tree with
`HEIM_FALLTHROUGH` and updates the declaration in configure logic
to define `HEIM_FALLTHROUGH` based upon existing definitions
(if any) of `fallthrough` or `DISPATCH_FALLTHROUGH`.
2022-09-16 15:58:45 -04:00
Jeffrey Altman
04527412e3 Follow the Linux kernel's lead on "fallthrough"
The pseudo keyword 'fallthrough' is defined such that case statement
blocks must end with any of these keywords:
 * break;
 * fallthrough;
 * continue;
 * goto <label>;
 * return [expression];
 *
 *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes

The macro is defined either as

  __attribute__((__fallthrough__))

or as

  do {} while (0)  /* fallthrough */

not including the semicolon.

This change implements the Linux kernel style and updates several locations
where "/*fallthrough*/ and /* FALLTHROUGH */ were not previously replaced.

Externally imported code such as libedit, libtommath and sqlite are
restored to their unaltered state.

Change-Id: I69db8167b0d5884f55d96d72de3059a0235a1ba3
2022-01-21 10:39:47 -05:00
Nicolas Williams
c607135a03 Use fallthrough statement attribute (moar) 2022-01-14 16:53:34 -06:00
Nicolas Williams
ddc6113610 Use fallthrough statement attribute 2022-01-14 16:32:58 -06:00
Nicolas Williams
fdc13c4aac Fix switch fallthrough warnings/errors 2020-09-07 22:04:59 -05:00
Stefan Metzmacher
805304d3f8 lib/winbd: fix wind_ucs2write with WIND_RW_LE
Pair-Programmed-With: Arvid Requate <requate@univention.de>

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-11-16 19:42:44 -08:00
Stefan Metzmacher
dcd34e5967 lib/wind: fix wind_ucs4utf8() and wind_ucs2utf8()
Pair-Programmed-With: Arvid Requate <requate@univention.de>

metze

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-11-16 19:42:44 -08:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
9e4bc686d3 drop rcsid 2009-09-07 21:22:46 -07:00
Love Hörnquist Åstrand
80842059fc drop HAVE_CONFIG_H
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24358 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 00:31:00 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
a40cae4e15 Add utf8 <-> utf16 support.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23246 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-01 22:29:04 +00:00
Love Hörnquist Åstrand
599319bc4f Make wind_utf8ucs4_length() work again.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22572 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-05 20:22:39 +00:00
Love Hörnquist Åstrand
74782cc769 Fix overaggressive checks, fix comments.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22560 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-03 17:35:06 +00:00
Love Hörnquist Åstrand
a500df0977 UCS-2 read/write functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22559 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-03 16:35:07 +00:00
Love Hörnquist Åstrand
3ad1f2d308 Add and use com_err error codes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22556 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-01 16:38:46 +00:00
Love Hörnquist Åstrand
cd3110ea92 libwind from Assar. stringprep library supporting nameprep, saslprep and ldapprep
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22551 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-01 16:22:22 +00:00