Commit Graph
100 Commits
Author SHA1 Message Date
Sylvestre Ledru 3bdffba86f Bug 2023419 - Remove Emacs/Vim modelines from modules/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287857
2026-03-17 12:06:03 +00:00
serge-sans-paille 9db08d3f52 Bug 2009953 - Do not use reserved identifiers for macro guard in identifiers r=emilio,geckoview-reviewers,media-playback-reviewers,devtools-reviewers,win-reviewers,ochameau,gstoll,keeler,mccr8,padenot,alwu,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D278766
2026-01-22 17:49:59 +00:00
pstanciu bc297a68a0 Revert "Bug 2009953 - Do not use reserved identifiers for macro guard in identifiers r=emilio,geckoview-reviewers,media-playback-reviewers,devtools-reviewers,win-reviewers,ochameau,gstoll,keeler,mccr8,padenot,alwu,m_kato" for causing build bustages @ CParserContext.h
This reverts commit afd052662d.
2026-01-21 16:23:10 +00:00
serge-sans-paille afd052662d Bug 2009953 - Do not use reserved identifiers for macro guard in identifiers r=emilio,geckoview-reviewers,media-playback-reviewers,devtools-reviewers,win-reviewers,ochameau,gstoll,keeler,mccr8,padenot,alwu,m_kato
Also remove security/manager/ssl/nsVerificationJob.h per request of
@keeler instead of changing its guard.

Differential Revision: https://phabricator.services.mozilla.com/D278766
2026-01-21 15:46:08 +00:00
serge-sans-paille 9eb9358a1e Bug 2007348 - Remove remaining unused <stdlib.h> and <stdio.h> inclusion r=webrtc-reviewers,win-reviewers,toolkit-telemetry-reviewers,gstoll,ng
Differential Revision: https://phabricator.services.mozilla.com/D277975
2026-01-07 06:34:04 +00:00
Ryan VanderMeulen ad700c2aa9 Bug 2008634 - Add back some stdio.h includes for MingW builds. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D277956
2026-01-06 13:52:35 +00:00
serge-sans-paille ca9d6265fe Bug 2007350 - Remove unused references to stdlib.h r=ahal,necko-reviewers,sunil
Differential Revision: https://phabricator.services.mozilla.com/D277317
2026-01-05 10:29:33 +00:00
serge-sans-paille 0515e71aa8 Bug 2007349 - Remove unused references to stdio.h r=ahal,necko-reviewers,media-playback-reviewers,win-reviewers,sunil,gstoll,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D277315
2026-01-05 10:29:30 +00:00
Mike Hommey d7bfe677d7 Bug 1941695 - Rename USE_STATIC_LIBS. r=firefox-build-system-reviewers,application-update-reviewers,media-playback-reviewers,padenot,bytesized,sergesanspaille
The name is confusing, as it doesn't apply to all libraries, and only on
Windows non-mingw.

Differential Revision: https://phabricator.services.mozilla.com/D234260
2025-01-20 20:51:51 +00:00
Chris Peterson 6ca4cf3312 Bug 1932297 - Stop forcing C99 or C11 for some C libraries. r=firefox-build-system-reviewers,sergesanspaille
These CFLAGS overrides aren't necessary now that we default to C17. These libraries all compile correctly as C17.

Depends on D229576

Differential Revision: https://phabricator.services.mozilla.com/D229577
2024-12-05 22:40:04 +00:00
Sylvestre Ledru a3ea006705 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
aaoblivion 200a484d48 Bug 1862505 - Removed unnecessary else statement. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D194903
2023-11-29 18:12:55 +00:00
serge-sans-paille 2d475bfed6 Bug 1824512 - Make modules/libmar/src buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D173612
2023-03-30 13:48:32 +00:00
Kirk Steuber 839768227e Bug 1806394 r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D168294
2023-02-16 18:15:40 +00:00
Cristian Tuns 4294e8e099 Backed out changeset 14fbd3cca8aa (bug 1806394) for causing build bustages in mar_read.c CLOSED TREE 2023-02-14 14:00:11 -05:00
Kirk Steuber 4b78b76ef8 Bug 1806394 r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D168294
2023-02-14 18:33:41 +00:00
Andi-Bogdan Postelnicu f221c438ca Bug 1725145 - Preparation for the hybrid build env. r=necko-reviewers,firefox-build-system-reviewers,valentin,glandium
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.

This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.

Differential Revision: https://phabricator.services.mozilla.com/D122345
2021-08-25 10:46:17 +00:00
Simon Giesecke d4e2af5588 Bug 1679522 - Fix include directives and forward declarations. r=andi,necko-reviewers,jgilbert
- Add missing include directives and forward declarations.
- Remove some extra include directives.
- Add missing namespace qualifications.
- Move include directives out of namespace in toolkit/xre/GlobalSemaphore.h

Differential Revision: https://phabricator.services.mozilla.com/D98894
2021-03-25 10:19:44 +00:00
Ricky Stewart 31b8ca9716 Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
sanketh b2606fb41f Bug 1663119 - Remove mingw workaround for _ftelli64/_fseeki64 r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D94658
2020-10-24 01:26:39 +00:00
Bogdan Tara 612312a64c Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart 065d2eb893 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 95b44c982f Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 43baed3c18 Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Chris Peterson ffe0fbefba Bug 1656285 - libmar: Avoid clobbering ftello() and fseeko() declarations in MinGW's stdio.h. r=mhowell
Include stdio.h before redefining ftello and fseeko to avoid clobbering the ftello() and fseeko() function declarations in MinGW's stdio.h.

I don't know why my change to compile libmar as C11 (bug 1653182) caused this ftello/fseeko problem. From my inspection of MinGW's stdio.h, this problem should have already been happening!

Differential Revision: https://phabricator.services.mozilla.com/D85665
2020-08-03 16:05:49 +00:00
Chris Peterson 20d234916d Bug 1652914 - Part 1: Replace MOZ_STATIC_ASSERT with static_assert in C code. r=jwalden
static_assert is available in both C++11 and C11. While C++11's static_assert is a keyword, C11's static_assert is a macro defined in assert.h (that expands to the C11 keywoard _Static_assert). libar's header files are included in both C and C++ code, so we must #include assert.h to use static_assert.

https://en.cppreference.com/w/c/language/_Static_assert

Differential Revision: https://phabricator.services.mozilla.com/D83736
2020-07-17 02:48:19 +00:00
Brindusan Cristian 5b65efbdae Backed out changeset 3ebab9ec3685 (bug 1653182) as requested by cpeterson for being a duplicate patch. CLOSED TREE 2020-07-30 09:02:15 +03:00
Chris Peterson 3650a09f3d Bug 1653182 - Part 1: Compile libmar as C11. r=nalexander,mhowell
Compile libmar as C11 so we can replace MOZ_STATIC_ASSERT() with static_assert() (bug 1652914).

Differential Revision: https://phabricator.services.mozilla.com/D85119
2020-07-29 19:12:20 +00:00
Chris Peterson 9d078305ad Bug 1653182 - Part 1: Compile libmar as C11. r=nalexander,mhowell
Compile libmar as C11 so we can replace MOZ_STATIC_ASSERT() with static_assert() (bug 1652914).

Differential Revision: https://phabricator.services.mozilla.com/D85119
2020-07-29 19:12:20 +00:00
Molly Howell 5f24df7012 Bug 1653371 - Don't used a signed type for a length parameter. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D84031
2020-07-17 22:25:54 +00:00
Mike Hommey 3dd8b44fe0 Bug 1562952 - Always build signmar when mar is built. r=nalexander
When we build mar, there is no reason not to build signmar as well. It
used to be optional because not all platforms were supported, but they
are now.

... except when building the newly added tools/update-packaging,
which builds the mar tool as a standalone thing, and building signmar
as well causes complications.

Differential Revision: https://phabricator.services.mozilla.com/D36992
2019-07-16 19:01:03 +00:00
Sylvestre Ledru 95a130621a Bug 1563903 - Reformat libmar to the coding style r=Ehsan
Depends on D37152

Differential Revision: https://phabricator.services.mozilla.com/D37153
2019-07-08 15:38:50 +00:00
Kathy Brade c9261bdef7 Bug 1561636 - intermittent updater failures on Win64 (Error 19) r=rstrong
Avoid MinGW's _ftelli64() and _fseeki64() implementations because they
are unreliable.

Differential Revision: https://phabricator.services.mozilla.com/D36037
2019-06-27 09:11:48 +00:00
Robert Strong a5be2bb053 Bug 1514532 - the modules/libmar directory isn't clang formatted and there are a few deprecation warnings in app update code. r=mhowell
Added defines to mar_extract.c, mar_read.c, bsdiff.c so they use the ISO C and C++ conformant name.
Ran clang format on bspatch.cpp and the files under modules/libmar except for nss_secutil.c and nss_secutil.h since they are copies of nss code.
2018-12-17 11:17:21 -08:00
June Wilde 708ddf0693 Bug 1468556 - Protect against overlapping files in libmar; r=mhowell
Disallows files from referencing the same bytes in the content blocks of a MAR
file by storing a list of structs containing a file's byte offsets and lengths.
A list was chosen since the cap of 256 files wouldn't produce considerable
overhead when extracting/reading/searching/etc through the archive.

Removing the ability for a MAR file to reference the same content block
repeatedly seems like a better solution than what was suggested in the BLRG
report. (limiting the number of files or checking for overly large
decompressed files)

Allows us to prohibit this type of file bomb while only losing an attribute
of the MAR file format that wasn't being leveraged. The fix is applied in
mar_enum_items and mar_find_item so that the manifest the updater uses is
equally safeguarded as the mar host tool.

Differential Revision: https://phabricator.services.mozilla.com/D11706
2018-11-26 17:25:24 +00:00
June Wilde 660999c1e2 Bug 1468544 - Replace mar_hash_name with CityHash algorithm. r=rstrong
Make CityHash64, CityHash64WithSeed, and CityHash64WithSeeds usable from C code
Remove unnecessary includes from mar_read.c as well
Add DisableStlWrapping to mar tool's moz.build to fix linkage break when
building in Windows with MSVC

Differential Revision: https://phabricator.services.mozilla.com/D10774
2018-11-06 13:34:21 -05:00
June Wilde 1a1a6d0184 Bug 1468539 - Limit libmar from reading more than a single Additional_Section. r=mhowell
Only a single type of additional block has ever been defined for the MAR
archive format and only a single block of that type is needed per file.
Limiting ourselves to reading only that until we define more seems
sensible.

Move additionalBlockSize check before first fread
Add MAXADDITIONALBLOCKSIZE as a constant for checking block sizes

Differential Revision: https://phabricator.services.mozilla.com/D10797
2018-11-05 21:29:42 -05:00
Sylvestre Ledru 0c1c733b0d Bug 1489454 - Remove all trailing whitespaces (again) r=Ehsan
This also includes moving some files to the regular format.

Differential Revision: https://phabricator.services.mozilla.com/D5249
2018-09-07 14:47:51 +00:00
Matt Howell a2f9604629 Bug 1473113 - Defer initializing the MAR index until it's needed. r=rstrong 2018-07-11 10:12:08 -07:00
Cosm 558acbaf6c Bug 1396795 - mar_read_product_info_block: Value stored to 'location' is never read. r=rstrong 2017-09-05 22:53:16 -07:00
Robert Strong f03959ddf1 Bug 641212 - use lzma compression for application update. Part 2 - add xe-embedded decompression support to the updater. r=mhowell, , a=app_update_lzma
Changes to the libmar host utilities (mar and signmar) are backwards compatible with the previous versions of mar and signmar
2017-07-30 23:27:00 -07:00
Tom Tromey 1b5a2bdb96 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx
2016-07-14 10:16:42 -06:00
Mike Shal 02ecf87e3d Bug 1253775 - Remove libmar and libbz2 Makefile.ins; r=ted
MozReview-Commit-ID: aF8PmM0KvF
2016-03-04 19:03:18 -05:00
Nicholas Nethercote 1b81677176 Bug 1232219 (part 1) - Fix -Wunused warnings in libmar/. r=bbondy. 2015-12-16 22:24:19 -08:00
Matt Howell 6a4865fa76 Bug 1209551 - Don't read past the end of a buffer in libmar
The index section of a MAR archive file contains several fixed-length fields
and also variable-length names for each file in the archive, terminated by a
null byte. Since that makes the length of the index variable, the length of the
entire index is also provided in the file.
When libmar opens a file, it allocates a buffer with the length given in the
file and reads the index from the file into that buffer.
mar_consume_index() then parses the entire index from that copy,
trying to make sure it doesn't read past the buffer it was given.

The length of the buffer is given to mar_consume_index()
by providing it a pointer to one byte past the end of the buffer.
However, mar_consume_index() treats this pointer as pointing *to* the end.
Therefore, it is possible for a malformed MAR file (one where the stated length
is less than the real length) to trigger a read of one byte beyond the
allocated memory.

Fix this by failing the parse when we reach the buffer end pointer minus one,
instead of when we reach that address itself.
2015-10-06 09:11:43 -07:00
Nicholas Nethercote 112d083e7c Bug 1202971 (part 1) - Fix compile warnings in libmar. r=rstrong.
Also remove ALLOW_COMPILER_WARNINGS=True so they don't come back.
2015-09-15 17:39:11 -07:00
Nicholas Nethercote 12fec02dfb Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Stephen Pohl 29faaec3e5 Bug 1184500: Improve handling of index names in MAR files. r=rstrong 2015-07-18 18:42:15 -07:00
Brian Smith 468a4ba048 Bug 903135 - Updates to libmar needed to support B2G MAR signature verification. r=bbondy 2014-10-22 21:00:15 -04:00
Mike Hommey aec0b61280 Bug 1041941 - Use templates for programs, simple programs, libraries and C++ unit tests. r=gps 2014-09-03 14:10:54 +09:00