Commit Graph
21 Commits
Author SHA1 Message Date
serge-sans-paille fac0f5e1a8 Bug 2041298 - Comply with clang-tidy's modernize-use-nullptr check for xpcom/ r=xpcom-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D301767
2026-05-25 15:20:21 +00:00
Sylvestre Ledru 6149f49299 Bug 2023419 - Remove Emacs/Vim modelines from xpcom/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287878
2026-03-16 17:22:07 +00:00
serge-sans-paille 18da74b20f Bug 2008695 - Remove unused <string.h> inclusion and make sure we don't regress on those r=ahal,necko-reviewers,media-playback-reviewers,webrtc-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,padenot,gstoll,kershaw,ng
Differential Revision: https://phabricator.services.mozilla.com/D277979
2026-01-13 17:21:53 +00:00
ISHIKAWA, Chiaki e02bf0b25f Bug 1732008 - Avoid MOZ_ASSERT in nsTextFormatter.cpp r=xpcom-reviewers,barret
Differential Revision: https://phabricator.services.mozilla.com/D169207
2023-02-08 23:47:23 +00:00
Andrew McCreight 291afe14f4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Chris Peterson 0a9155f83b Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440
2019-12-20 07:16:43 +00:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Nathan Froyd fef98a6f6c Bug 1435916 - use a const array in nsTextFormatter::dosprintf; r=tromey
I don't know how this was not constant, but there you go.
2018-02-14 12:01:36 -05:00
Tom Tromey 3f91c32af3 Bug 1401821 - nsTextFormatter "*" width argument comes before the actual argument; r=froydnj
Bug 1388789 introduced a bug breaking formats like "%*.f".  The problem
was that the next "natural" argument was taken before the "*" width
argument.

MozReview-Commit-ID: BZack9faY7a
2017-09-21 09:43:28 -06:00
Tom Tromey bda71f4da8 Bug 1388789 - clean up \0 emission in nsTextFormatter; r=froydnj
nsTextFormatter unconditionally emitted a trailing \0, leading some code
elsewhere to have to work around this.  This changes the code to only
emit it in snprintf.

MozReview-Commit-ID: G3CBpAPp9Tn
2017-09-06 09:38:58 -06:00
Tom Tromey a5342bfa6b Bug 1388789 - normalize null string handling in nsTextFormatter; r=froydnj
The char* and char16_t* cases handled null strings differently;
normalize them to both emit "(null)".

MozReview-Commit-ID: IzRkc3pSSjl
2017-09-06 08:38:44 -06:00
Tom Tromey 9c9f19fe97 Bug 1388789 - make nsTextFormatter runtime type-safe; r=froydnj
Change nsTextFormatter functions to template functions, box their
arguments, and then make the formatter mostly impervious to type
mismatches.  Most formatting is done according to the type of the actual
argument.

MozReview-Commit-ID: H8WmyxFCb7s
2017-09-01 14:03:56 -06:00
Tom Tromey 9f5ef8223c Bug 1388789 - change return values of nsTextFormatter::vs{s,v}printf; r=froydnj
nsTextFormatter::vsnprintf is defined to return uint32_t(-1) on error.
However, it was not doing this.

nsTextFormatter::vssprintf is defined as infallible; enforce this by
having it return void.

MozReview-Commit-ID: LdOhIHzRvAT
2017-09-05 13:17:49 -06:00
Tom Tromey 1ab6214824 Bug 1388789 - handle unrecognized escapes in nsTextFormatter; r=froydnj
nsTextFormatter tried to pass unrecognized escapes in the format string
through to the output.  However, if the format held a width or
precision, that text was not output.  It seems better to me to try to
preserve the format text as-is.

MozReview-Commit-ID: HoBykpfzK7C
2017-09-01 08:31:49 -06:00
Tom Tromey 44fe6d4a47 Bug 1388789 - replace hex strings with static arrays; r=froydnj
nsTextFormatter used nsAutoString for arrays of hex digits; but this
didn't seem to provide any benefit.

MozReview-Commit-ID: EYHtnAzJL8h
2017-09-01 06:25:11 -06:00
Nicholas Nethercote 5fe06e280f Bug 1388253 - Remove nsTextFormatter:[v]smprintf(). r=erahm. 2017-08-09 10:41:21 +10:00
Nicholas Nethercote 8e0034b6c7 Bug 1381726 - Remove nsTextFormatter::smprintf_free(). r=erahm.
We can just use free() instead.
2017-07-25 09:09:27 +10:00
Nicholas Nethercote fcd4f4fa21 Bug 1376638 - Minimize uses of prmem.h. r=glandium.
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.
2017-06-30 19:05:41 -07:00
Eric Rahm 8644f2267b Bug 1353143 - Part 3: Switch PR_ASSERT usage to MOZ_ASSERT. r=froydnj 2017-04-04 14:36:17 -07:00
Tom Tromey c6913978fb Bug 1060419 - remove SprintfState typedef; r=froydnj
MozReview-Commit-ID: 9ygDxy8pBLT
2017-01-13 14:54:14 -07:00
Benjamin Smedberg 2ecc8bf217 Bug 1332631 part E - file moves from xpcom/glue to xpcom/string, r=froydnj
MozReview-Commit-ID: AGHVJ5uYOoI
2017-01-20 14:19:22 -05:00