1. 17 8月, 2020 1 次提交
  2. 22 6月, 2016 1 次提交
  3. 16 6月, 2015 1 次提交
    • R
      byte-based C locale, phase 1: multibyte character handling functions · 1507ebf8
      Rich Felker 提交于
      this patch makes the functions which work directly on multibyte
      characters treat the high bytes as individual abstract code units
      rather than as multibyte sequences when MB_CUR_MAX is 1. since
      MB_CUR_MAX is presently defined as a constant 4, all of the new code
      added is dead code, and optimizing compilers' code generation should
      not be affected at all. a future commit will activate the new code.
      
      as abstract code units, bytes 0x80 to 0xff are represented by wchar_t
      values 0xdf80 to 0xdfff, at the end of the surrogates range. this
      ensures that they will never be misinterpreted as Unicode characters,
      and that all wctype functions return false for these "characters"
      without needing locale-specific logic. a high range outside of Unicode
      such as 0x7fffff80 to 0x7fffffff was also considered, but since C11's
      char16_t also needs to be able to represent conversions of these
      bytes, the surrogate range was the natural choice.
      1507ebf8
  4. 02 7月, 2014 1 次提交
    • R
      fix aliasing violations in mbtowc and mbrtowc · e89cfe51
      Rich Felker 提交于
      these functions were setting wc to point to wchar_t aliasing itself as
      a "cheap" way to support null wc arguments. doing so was anything but
      cheap, since even without the aliasing violation, it would limit the
      compiler's ability to optimize.
      
      making wc point to a dummy object is equally easy and does not suffer
      from the above problems.
      e89cfe51
  5. 12 12月, 2013 1 次提交
  6. 09 4月, 2013 1 次提交
    • R
      implement mbtowc directly, not as a wrapper for mbrtowc · ea34b1b9
      Rich Felker 提交于
      the interface contract for mbtowc admits a much faster implementation
      than mbrtowc can achieve; wrapping mbrtowc with an extra call frame
      only made the situation worse.
      
      since the regex implementation uses mbtowc already, this change should
      improve regex performance too. it may be possible to improve
      performance in other places internally by switching from mbrtowc to
      mbtowc.
      ea34b1b9
  7. 07 9月, 2012 1 次提交
    • R
      use restrict everywhere it's required by c99 and/or posix 2008 · 400c5e5c
      Rich Felker 提交于
      to deal with the fact that the public headers may be used with pre-c99
      compilers, __restrict is used in place of restrict, and defined
      appropriately for any supported compiler. we also avoid the form
      [restrict] since older versions of gcc rejected it due to a bug in the
      original c99 standard, and instead use the form *restrict.
      400c5e5c
  8. 12 2月, 2011 1 次提交