/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MAR_PRIVATE_H__ #define MAR_PRIVATE_H__ #include "limits.h" #include "mozilla/Assertions.h" #include #define BLOCKSIZE 4096 #define ROUND_UP(n, incr) (((n) / (incr) + 1) * (incr)) #define MAR_ID "MAR1" #define MAR_ID_SIZE 4 /* The signature block comes directly after the header block which is 16 bytes */ #define SIGNATURE_BLOCK_OFFSET 16 /* Make sure the file is less than 500MB. We do this to protect against invalid MAR files. */ #define MAX_SIZE_OF_MAR_FILE ((int64_t)1824288000) /* Existing code makes assumptions that the file size is smaller than LONG_MAX. */ MOZ_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX), "max mar file size is too big"); /* We store at most the size up to the signature block + 4 bytes per BLOCKSIZE bytes */ MOZ_STATIC_ASSERT(sizeof(BLOCKSIZE) < (SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)), "BLOCKSIZE is too big"); /* The maximum size of any signature supported by current and future implementations of the signmar program. */ #define MAX_SIGNATURE_LENGTH 2048 /* Each additional block has a unique ID. The product information block has an ID of 1. */ #define PRODUCT_INFO_BLOCK_ID 1 #define MAR_ITEM_SIZE(namelen) (3*sizeof(uint32_t) + (namelen) + 1) /* Product Information Block (PIB) constants */ #define PIB_MAX_MAR_CHANNEL_ID_SIZE 63 #define PIB_MAX_PRODUCT_VERSION_SIZE 31 /* The mar program is compiled as a host bin so we don't have access to NSPR at runtime. For that reason we use ntohl, htonl, and define HOST_TO_NETWORK64 instead of the NSPR equivalents. */ #ifdef _WIN32 #include #define ftello _ftelli64 #define fseeko _fseeki64 #else #define _FILE_OFFSET_BITS 64 #include #include #endif #include #define HOST_TO_NETWORK64(x) ( \ ((((uint64_t) x) & 0xFF) << 56) | \ ((((uint64_t) x) >> 8) & 0xFF) << 48) | \ (((((uint64_t) x) >> 16) & 0xFF) << 40) | \ (((((uint64_t) x) >> 24) & 0xFF) << 32) | \ (((((uint64_t) x) >> 32) & 0xFF) << 24) | \ (((((uint64_t) x) >> 40) & 0xFF) << 16) | \ (((((uint64_t) x) >> 48) & 0xFF) << 8) | \ (((uint64_t) x) >> 56) #define NETWORK_TO_HOST64 HOST_TO_NETWORK64 #endif /* MAR_PRIVATE_H__ */ bora/co-22.05-testflight LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/rsc
AgeCommit message (Collapse)Author
2015-05-02Bin empty eval statementMatúš Kukan
Change-Id: I52755c373f86490ba3e8910e71e3fab88b1ca38c
2015-04-30Gradually typed LinkStephan Bergmann
Turn the Link class into a template abstracting over the link's argument and return types, but provide default template arguments that keep the generic, unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the Link class can be updated over time. All the related macros are duplicated with ..._TYPED counterparts, that additionally take the RetType (except for LINK_TYPED, which manages to infer the relevant types from the supplied Member). (It would have been attractive to change the "untyped" LinkStubs from taking a void* to a properly typed ArgType parameter, too, but that would cause -fsanitize=function to flag uses of "untyped" Link::Call.) Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-29Clean up tools/link.hxxStephan Bergmann
Change-Id: I44e4abb228394f99109f7d7e005cfeb26e4b95c1
2015-04-29Remove unnecessary IMPL_LINK[_NOARG]_INLINE_START/ENDStephan Bergmann
...just use IMPL_LINK[_NOARG] and let the compiler decide what to inline Change-Id: I63ec5116df7e79093ebf31193f8c674f1351c0e6
2015-04-29cppcheck: invalidPrintfArgType_uintCaolán McNamara
Change-Id: I5a0b5a4ff60c508f8ea11d613022ee7799900098
2015-04-24loplugin:simplifyboolStephan Bergmann
Change-Id: I86cec7670db8594a7563e86c6645c480d3f8702c
2015-04-22Various #include <sal/log.hxx> fixupsStephan Bergmann
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. Cleaned up some, but something like grep -FwL sal/log.hxx $(git grep -Elw \ 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF') -- \*.cxx) shows lots more files that potentially need fixing before the include can be removed from rtl/string.hxx and rtl/ustring.hxx. Change-Id: Ibf033363e83d37851776f392dc0b077381cd8b90
2015-04-20rsc crash on WIN64 due to LP64Norbert Thiebaud
rsc stash stuff in a 'value' filed that was defined as 'long' saddly it stash also pointer there... which on WIN64 truncate 64 bits pointers in 32 bits scalar. That went unnoticed for years because on every other platform sizeof(long) = sizeof(void*) Change-Id: I218ae181c9d6b64ade457ee49942d1d07a933bb7 Reviewed-on: https://gerrit.libreoffice.org/15394 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-04-15remove unnecessary use of void in function declarationsNoel Grandin
ie. void f(void); becomes void f(); I used the following command to make the changes: git grep -lP '\(\s*void\s*\)' -- *.cxx \ | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;' and ran it for both .cxx and .hxx files. Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd