1. 13 Aug, 2017 1 commit
  2. 08 Aug, 2017 1 commit
  3. 04 Aug, 2017 3 commits
  4. 03 Aug, 2017 2 commits
  5. 02 Aug, 2017 7 commits
  6. 01 Aug, 2017 1 commit
  7. 31 Jul, 2017 2 commits
  8. 11 Jul, 2017 2 commits
  9. 07 Jul, 2017 2 commits
  10. 05 Jul, 2017 3 commits
  11. 27 Jun, 2017 2 commits
  12. 12 Jun, 2017 3 commits
  13. 09 Jun, 2017 3 commits
    • Florent Rougon's avatar
      Fix erroneous test on language id in FcLangSetPromote() · 209619b1
      Florent Rougon authored
      FcLangSetIndex() indicates "not found" with a non-negative return value.
      Return value 0 doesn't imply "not found", it rather means "language
      found at index 0 in fcLangCharSets".
      209619b1
    • Florent Rougon's avatar
      Fix an off-by-one error in FcLangSetIndex() · 4970c7e8
      Florent Rougon authored
      This commit fixes a bug that can be reproduced like this:
        - remove all languages starting with 'a' in fc-lang/Makefile.am (in
          ORTH's definition);
        - rebuild fontconfig with this change (-> new fc-lang/fclang.h);
        - create an FcLangSet 'ls1' that contains at least the first language
          from fcLangCharSets (i.e., the first *remaining* in lexicographic
          order); let's assume it is "ba" for the sake of this description;
        - create an FcLangSet 'ls2' that only contains the language "aa" (any
          language starting with 'a' should work as well);
        - check the return value of FcLangSetContains(ls1, ls2);
      
      The expected return value is FcFalse, however it is FcTrue if you use
      the code before this commit.
      
      What happens is that FcLangSetIndex() returns 0, because this is the
      index of the first slot after the not-found language "aa" in
      fcLangCharSets (since we removed all languages starting with 'a').
      However, this index happens to be non-negative, therefore
      FcLangSetContainsLang() mistakenly infers that the language "aa" was
      found in fcLangCharSets, and thus calls FcLangSetBitGet(ls1, 0), which
      returns FcTrue since we've put the first remaining language "ba" in the
      'ls1' language set.
      
      The "return -low;" statement previously in FcLangSetIndex() was
      inconsistent with the final return statement. "return -(low+1);" fixes
      this inconsistency as well as the incorrect behavior described above.
      4970c7e8
    • Florent Rougon's avatar
      fc-lang: gracefully handle the case where the last language initial is < 'z' · 02161ef2
      Florent Rougon authored
      FcLangSetIndex() contains code like this:
      
        low = fcLangCharSetRanges[firstChar - 'a'].begin;
        high = fcLangCharSetRanges[firstChar - 'a'].end;
        /* no matches */
        if (low > high)
      
      The assumption behind this test didn't hold before this commit, unless
      there is at least one language name that starts with 'z' (which is
      thankfully the case in our world :-). If the last language name in
      lexicographic order starts for instance with 'x', this change ensures
      that fcLangCharSetRanges['y' - 'a'].begin and
           fcLangCharSetRanges['z' - 'a'].begin
      are equal to NUM_LANG_CHAR_SET, in order to make the above assumption
      correct in all cases.
      02161ef2
  14. 07 Jun, 2017 1 commit
    • Florent Rougon's avatar
      FcCharSetHash(): use the 'numbers' values to compute the hash · c37eeb8f
      Florent Rougon authored
      Before this commit, FcCharSetHash() repeatedly used the address of the
      'numbers' array of an FcCharSet to compute the FcCharSet hash, instead
      of the value of each array element. This is not good for even spreading
      of the FcCharSet objects among the various buckets of the hash table
      (and should thus reduce performance). This bug appears to have been
      mistakenly introduced in commit
      cd2ec1a9 (June 2005).
      c37eeb8f
  15. 05 Jun, 2017 1 commit
  16. 03 Jun, 2017 1 commit
  17. 01 Jun, 2017 2 commits
  18. 31 May, 2017 3 commits