fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / external / icu / icu-ubsan.patch.0
blob25efb5fec728fd08f93e369356b620be8b2af3cb
1 --- source/common/rbbidata.h
2 +++ source/common/rbbidata.h
3 @@ -113,7 +113,7 @@
4                                      /*     StatusTable of the set of matching             */
5                                      /*     tags (rule status values)                      */
6      int16_t          fReserved;
7 -    uint16_t         fNextState[2]; /*  Next State, indexed by char category.             */
8 +    uint16_t         fNextState[1]; /*  Next State, indexed by char category.             */
9                                      /*  This array does not have two elements             */
10                                      /*    Array Size is actually fData->fHeader->fCatCount         */
11                                      /*    CAUTION:  see RBBITableBuilder::getTableSize()  */
12 @@ -126,7 +126,7 @@
13      uint32_t         fRowLen;       /*  Length of a state table row, in bytes.            */
14      uint32_t         fFlags;        /*  Option Flags for this state table                 */
15      uint32_t         fReserved;     /*  reserved                                          */
16 -    char             fTableData[4]; /*  First RBBIStateTableRow begins here.              */
17 +    char             fTableData[1]; /*  First RBBIStateTableRow begins here.              */
18                                      /*    (making it char[] simplifies ugly address       */
19                                      /*     arithmetic for indexing variable length rows.) */
20  };
21 --- source/common/rbbitblb.cpp
22 +++ source/common/rbbitblb.cpp
23 @@ -1067,15 +1067,15 @@
24          return 0;
25      }
27 -    size    = sizeof(RBBIStateTable) - 4;    // The header, with no rows to the table.
28 +    size    = offsetof(RBBIStateTable, fTableData);    // The header, with no rows to the table.
30      numRows = fDStates->size();
31      numCols = fRB->fSetBuilder->getNumCharCategories();
33 -    //  Note  The declaration of RBBIStateTableRow is for a table of two columns.
34 -    //        Therefore we subtract two from numCols when determining
35 +    //  Note  The declaration of RBBIStateTableRow is for a table of one columns.
36 +    //        Therefore we subtract one from numCols when determining
37      //        how much storage to add to a row for the total columns.
38 -    rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2);
39 +    rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1);
40      size   += numRows * rowSize;
41      return size;
42  }
43 @@ -1105,7 +1105,7 @@
44      }
46      table->fRowLen    = sizeof(RBBIStateTableRow) +
47 -                            sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2);
48 +                            sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1);
49      table->fNumStates = fDStates->size();
50      table->fFlags     = 0;
51      if (fRB->fLookAheadHardBreak) {
52 --- source/common/ubidiimp.h
53 +++ source/common/ubidiimp.h
54 @@ -198,8 +198,8 @@
55  /* in a Run, logicalStart will get this bit set if the run level is odd */
56  #define INDEX_ODD_BIT (1UL<<31)
58 -#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31))
59 -#define ADD_ODD_BIT_FROM_LEVEL(x, level)  ((x)|=((int32_t)(level)<<31))
60 +#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31))
61 +#define ADD_ODD_BIT_FROM_LEVEL(x, level)  ((x)|=((uint32_t)(level)<<31))
62  #define REMOVE_ODD_BIT(x)                 ((x)&=~INDEX_ODD_BIT)
64  #define GET_INDEX(x)   ((x)&~INDEX_ODD_BIT)
65 --- source/common/ucharstriebuilder.cpp
66 +++ source/common/ucharstriebuilder.cpp
67 @@ -285,7 +285,7 @@
69  UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode)
70          : LinearMatchNode(len, nextNode), s(units) {
71 -    hash=hash*37+ustr_hashUCharsN(units, len);
72 +    hash=hash*37U+ustr_hashUCharsN(units, len);
73  }
75  UBool
76 --- source/common/ucmndata.c
77 +++ source/common/ucmndata.c
78 @@ -75,7 +75,7 @@
79  typedef struct  {
80      uint32_t          count;
81      uint32_t          reserved;
82 -    PointerTOCEntry   entry[2];   /* Actual size is from count. */
83 +    PointerTOCEntry   entry[1];   /* Actual size is from count. */
84  }  PointerTOC;
87 --- source/common/ucmndata.h
88 +++ source/common/ucmndata.h
89 @@ -50,7 +50,7 @@
91  typedef struct {
92      uint32_t count;
93 -    UDataOffsetTOCEntry entry[2];    /* Actual size of array is from count. */
94 +    UDataOffsetTOCEntry entry[1];    /* Actual size of array is from count. */
95  } UDataOffsetTOC;
97  /**
98 --- source/common/unicode/stringtriebuilder.h
99 +++ source/common/unicode/stringtriebuilder.h
100 @@ -269,7 +269,7 @@
101          void setValue(int32_t v) {
102              hasValue=TRUE;
103              value=v;
104 -            hash=hash*37+v;
105 +            hash=hash*37U+v;
106          }
107      protected:
108          UBool hasValue;
109 @@ -296,7 +296,7 @@
110      class LinearMatchNode : public ValueNode {
111      public:
112          LinearMatchNode(int32_t len, Node *nextNode)
113 -                : ValueNode((0x333333*37+len)*37+hashCode(nextNode)),
114 +                : ValueNode((0x333333U*37+len)*37+hashCode(nextNode)),
115                    length(len), next(nextNode) {}
116          virtual UBool operator==(const Node &other) const;
117          virtual int32_t markRightEdgesFirst(int32_t edgeNumber);
118 @@ -330,7 +330,7 @@
119              equal[length]=NULL;
120              values[length]=value;
121              ++length;
122 -            hash=(hash*37+c)*37+value;
123 +            hash=(hash*37U+c)*37+value;
124          }
125          // Adds a unit which leads to another match node.
126          void add(int32_t c, Node *node) {
127 @@ -338,7 +338,7 @@
128              equal[length]=node;
129              values[length]=0;
130              ++length;
131 -            hash=(hash*37+c)*37+hashCode(node);
132 +            hash=(hash*37U+c)*37+hashCode(node);
133          }
134      protected:
135          Node *equal[kMaxBranchLinearSubNodeLength];  // NULL means "has final value".
136 @@ -353,7 +353,7 @@
137      class SplitBranchNode : public BranchNode {
138      public:
139          SplitBranchNode(UChar middleUnit, Node *lessThanNode, Node *greaterOrEqualNode)
140 -                : BranchNode(((0x555555*37+middleUnit)*37+
141 +                : BranchNode(((0x555555U*37+middleUnit)*37+
142                                hashCode(lessThanNode))*37+hashCode(greaterOrEqualNode)),
143                    unit(middleUnit), lessThan(lessThanNode), greaterOrEqual(greaterOrEqualNode) {}
144          virtual UBool operator==(const Node &other) const;
145 @@ -370,7 +370,7 @@
146      class BranchHeadNode : public ValueNode {
147      public:
148          BranchHeadNode(int32_t len, Node *subNode)
149 -                : ValueNode((0x666666*37+len)*37+hashCode(subNode)),
150 +                : ValueNode((0x666666U*37+len)*37+hashCode(subNode)),
151                    length(len), next(subNode) {}
152          virtual UBool operator==(const Node &other) const;
153          virtual int32_t markRightEdgesFirst(int32_t edgeNumber);
154 --- source/common/unifiedcache.h
155 +++ source/common/unifiedcache.h
156 @@ -139,7 +139,7 @@
157             : CacheKey<T>(other), fLoc(other.fLoc) { }
158     virtual ~LocaleCacheKey() { }
159     virtual int32_t hashCode() const {
160 -       return 37 *CacheKey<T>::hashCode() + fLoc.hashCode();
161 +       return 37U *CacheKey<T>::hashCode() + fLoc.hashCode();
162     }
163     virtual UBool operator == (const CacheKeyBase &other) const {
164         // reflexive
165 --- source/common/uresbund.cpp
166 +++ source/common/uresbund.cpp
167 @@ -53,7 +53,7 @@
168      UHashTok namekey, pathkey;
169      namekey.pointer = b->fName;
170      pathkey.pointer = b->fPath;
171 -    return uhash_hashChars(namekey)+37*uhash_hashChars(pathkey);
172 +    return uhash_hashChars(namekey)+37U*uhash_hashChars(pathkey);
175  /* INTERNAL: compares two entries */