Commit graph

68 commits

Author SHA1 Message Date
Fredrik Roubert
0178a07a26 ICU-22793 Clang-Tidy: google-readability-casting
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/google/readability-casting.html
2024-07-04 22:32:12 +02:00
Fredrik Roubert
5401c12018 ICU-22621 Clang-Tidy: modernize-use-nullptr
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-nullptr.html
2024-03-15 14:31:54 +01:00
Markus Scherer
b6dcc95d3c ICU-21833 remove redundant void parameter lists
See #2351
2023-03-02 09:31:57 -08:00
Fredrik Roubert
030fa1a479 ICU-21148 Consistently use standard lowercase true/false everywhere.
This is the normal standard way in C, C++ as well as Java and there's no
longer any reason for ICU to be different. The various internal macros
providing custom boolean constants can all be deleted and code as well
as documentation can be updated to use lowercase true/false everywhere.
2022-09-07 20:56:33 +02:00
Andy Heninger
2fef6b937f ICU-21763 UVector cleanup, remove old funcs.
Remove the functions UVector::addElementX() and UVector::ensureCapacityX() that
were temporarily added to aid in the cleaning up of UVector's out-of-memory
error handling.
2022-02-06 22:07:50 -08:00
Andy Heninger
081cf77330 ICU-21662 Improve UVector error handling.
- Add updated versions of UVector::addElement() and ensureCapacity() that respect
  incoming errors.
  Follow on to c26aebe, which renamed the original versions.

- Add UVector::adoptElement() as a replacement for addElement() when the vector
  has a deleter function set, meaning that it adopts ownership of its elements.

  The intent is to make the behavior clearer at the call sites when looking
  at unfamiliar code.

- Make all functions with an incoming failure, as indicated by a UErrorCode parameter,
  leave the vector unchanged.

- Change all functions that store object pointers into the vector such that,
  when the store cannot be completed for any reason _and_ the vector has a deleter function,
  then the incoming object is deleted.

  This change can simplify the error handling code around calls to the affected functions
  (addElement() and insertElementAt(), in particular)

- Add index bounds checking on functions where it was possible - that is, on functions
  with both U_ErrorCode and index parameters.

- Changed to more modern C++ idioms in some parts of the UVector implementation.

- Review & update as required all uses of the UVector functions
  setElementAt(), insertElementAt(), setSize(), sortedInsert()
  these being the functions with changed behavior on error conditions
  (aside from addElement()).

This PR will be followed by more, switching call sites in various ICU services
from UVector::addElementX() (old behavior on errors)
to   UVector::addElement()  (new behavior on errors)
2021-09-02 19:15:36 -07:00
Fredrik Roubert
0a1cfa398c ICU-20973 Use standard keywords true & false to initialize type bool.
Now when all equality operators return standard bool (commit 633438f),
it no longer makes any sense to use the ICU4C constants TRUE & FALSE
or local variables of type UBool for their return value.
2021-08-26 18:53:10 +02:00
Fredrik Roubert
633438f8da ICU-20973 Change all equality operator return types from UBool to bool. 2021-08-17 00:35:00 +02:00
Andy Heninger
c26aebe802 ICU-21662 Rename UVector::addElement().
This is the first step towards improving the error handling and out-of-memory
behavior of UVector::addElement(). A followup PR will add back a new addElement()
with corrected error handling, then additional followups will switch call sites
from the original (renamed) function to the new addElement().

This commit includes no logic or behavior changes; it only renames the existing functions.
2021-07-28 15:36:50 -07:00
Erik Torres
cfefa03539 ICU-21555 fix typos for D, E and F found in the repo
See #1714
2021-05-10 11:09:05 -07:00
Frank Tang
bdb4c7025a ICU-21526 Change return of UElementComparator to int32_t
See #1621
2021-03-31 12:02:08 -07:00
Erik Torres Aguilar
6eea259143 ICU-21018 Fix typos across repo that start with letter C
See #1525
2021-01-06 15:15:26 -08:00
Andy Heninger
242e02c388 ICU-12764 icu4c utf-8 source files, update Copyright notices.
X-SVN-Rev: 39583
2017-01-20 00:20:31 +00:00
Michael Ow
61607c2773 ICU-12564 Update copyright notice in trunk
X-SVN-Rev: 38848
2016-06-15 18:58:17 +00:00
Yoshito Umaoka
00ca13e126 ICU-12564 Reverted r38761 and r38762, because we want to prepend the Unicode copyright for existing source files, instead of replacing copyright comments.
X-SVN-Rev: 38776
2016-05-31 21:45:07 +00:00
Michael Ow
c9f199a30f ICU-12564 Update copyright notice in ICU4C
X-SVN-Rev: 38761
2016-05-26 22:32:17 +00:00
Markus Scherer
f5cd9984c6 ICU-9880 add ImmutableIndex, replace Chinese hacks and support zhuyin, handle index characters with multiple primary weights, lazy-create rarely-used objects, bug fixes, port other improvements from Java
X-SVN-Rev: 33245
2013-02-15 22:11:33 +00:00
Markus Scherer
744d1f3a19 ICU-8617 move UHashTok into lower-level uelement.h (new) and rename to UElement to share with UVector
X-SVN-Rev: 30272
2011-07-04 23:51:56 +00:00
Andy Heninger
7b7f48eef8 ICU-7530 Alphabetic index, move from branch to trunk.
X-SVN-Rev: 29482
2011-02-25 22:21:30 +00:00
Michael Grady
f92222ba98 ICU-7947 Relax 0-capacity test in previous checkin and fix compiler warnings
X-SVN-Rev: 28636
2010-09-17 01:53:01 +00:00
Michael Grady
a3a500f892 ICU-7947 Fix previous checkin, expandCapacity allows minimumCapacity=0
X-SVN-Rev: 28628
2010-09-16 02:05:19 +00:00
Michael Grady
290cadf0b8 ICU-7947 UVector safety checks to avoid heap overflow due to integer overflow/signedness/truncation
X-SVN-Rev: 28626
2010-09-16 00:30:26 +00:00
Andy Heninger
9715eae02c ICU-4790 spoof impl merged to trunk.
X-SVN-Rev: 25534
2009-03-09 23:40:15 +00:00
George Rhoten
1725c5899a ICU-6076 Fix some allocation issues.
X-SVN-Rev: 23087
2007-12-14 10:17:12 +00:00
George Rhoten
6112b5685d ICU-6076 Fix some realloc issues.
X-SVN-Rev: 23086
2007-12-14 09:23:07 +00:00
George Rhoten
c68fa87f5b ICU-4281 Reduce UStack dependencies
X-SVN-Rev: 16934
2004-12-09 06:39:49 +00:00
Eric Mader
14fbb48bf9 ICU-3770 Updated copyright notices for ICU 3.0
X-SVN-Rev: 15385
2004-05-18 22:01:41 +00:00
George Rhoten
232ee12872 ICU-3500 Fix compiler warnings about multiple virtual destructors and/or not inlining compiler generated destructors.
X-SVN-Rev: 14896
2004-04-07 05:20:22 +00:00
Andy Heninger
fdb386fb81 ICU-3043 multiple status values implementation
X-SVN-Rev: 14640
2004-03-05 05:04:10 +00:00
Eric Mader
6aac9dbeb8 ICU-3473 Update copyright notices for ICU 2.8.
X-SVN-Rev: 14180
2003-12-18 23:16:48 +00:00
George Rhoten
dc703b5f1b ICU-3221 MSVC.NET combines static const char values in the same file.
Separate them into different files.

X-SVN-Rev: 12988
2003-08-29 21:05:48 +00:00
George Rhoten
4d18bb2b4f ICU-3221 Fix the AIX linker warning about multiple definitions of virtual functions.
X-SVN-Rev: 12958
2003-08-27 01:01:42 +00:00
Vladimir Weinstein
f346c4d8f2 ICU-2268 fixed UTokenAssigner bug in UVector
X-SVN-Rev: 9816
2002-08-29 22:12:49 +00:00
George Rhoten
aa41d27d93 ICU-1947 Better usage for U_EXPORT2 and U_CALLCONV
X-SVN-Rev: 9296
2002-07-23 23:12:03 +00:00
Andy Heninger
e32993b2d8 ICU-45 RBBI, getRuleStatus() works after previous().
More Tests.
Private includes removed from public header
Break rule tag status added to word break rules.

X-SVN-Rev: 9284
2002-07-22 22:02:08 +00:00
George Rhoten
e8a6207142 ICU-1913 Less aggressive optimization of the iSeries fix.
X-SVN-Rev: 9247
2002-07-18 16:46:30 +00:00
George Rhoten
824423395b ICU-1913 Fix for 64-bit machines (AIX and Solaris)
X-SVN-Rev: 9242
2002-07-17 22:53:39 +00:00
George Rhoten
4d4cde52ca ICU-1913 Fixes for iSeries.
X-SVN-Rev: 9235
2002-07-17 19:44:00 +00:00
George Rhoten
f414b9c5d2 ICU-1891 Update for z/OS regarding U_CALLCONV.
All C callbacks should all be defined the same way.

X-SVN-Rev: 9107
2002-07-12 00:23:52 +00:00
GCL Shanghai
2fab4a8cb7 ICU-1953 backout buffer overflow changes
X-SVN-Rev: 9070
2002-07-09 12:47:45 +00:00
GCL Shanghai
6348e12895 ICU-1953 test for buffer overflows
X-SVN-Rev: 9044
2002-07-06 10:58:51 +00:00
Markus Scherer
11948b52df ICU-1962 change UObject: RTTI pure virtual, remove other boilerplate for now
X-SVN-Rev: 8977
2002-06-29 00:04:16 +00:00
Andy Heninger
32c09250b7 ICU-45 new builder for RBBI rules, initial checkin
X-SVN-Rev: 8939
2002-06-25 17:23:07 +00:00
Alan Liu
37b4739783 ICU-1749 API additions to support UnicodeSet
X-SVN-Rev: 8526
2002-04-26 06:30:37 +00:00
George Rhoten
2ab3c9cd3b ICU-214 Fix for Win64. Don't freely convert between (void *) and int32_t.
Use the int32_t functions when you are only using integers.
Also arrays of scalars need to be allocated with malloc (Needed by Lotus j1733).

X-SVN-Rev: 8289
2002-03-29 01:56:09 +00:00
George Rhoten
f2aadf39e9 ICU-1779 Better fix for malloc(0)
X-SVN-Rev: 8093
2002-03-18 21:53:11 +00:00
Alan Liu
cd9a595ff6 ICU-1779 avoid malloc(0)
X-SVN-Rev: 8091
2002-03-18 21:25:01 +00:00
George Rhoten
ff18de7c2a ICU-1733 Forgot a change from Lotus.
X-SVN-Rev: 7853
2002-03-01 23:26:35 +00:00
George Rhoten
41ffc2ef36 ICU-1733 Integrate some of the easier (and non-redundent) changes from Lotus.
X-SVN-Rev: 7802
2002-02-28 01:42:40 +00:00
Alan Liu
47c47a5cd9 ICU-1234 make output side of RBTs object-oriented; rewrite ID parsers and modularize them; implement &Any-Lower() support
X-SVN-Rev: 7582
2002-02-07 01:07:55 +00:00