mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
Revert whitespace fixes to third_party (#501)
This commit is contained in:
parent
d4000bb8f7
commit
9de3d8f1e6
365 changed files with 39190 additions and 39211 deletions
2
third_party/argon2/LICENSE
vendored
2
third_party/argon2/LICENSE
vendored
|
@ -3,7 +3,7 @@ Argon2 reference source code package - reference C implementations
|
|||
Copyright 2015
|
||||
Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
|
||||
|
||||
You may use this work under the terms of a Creative Commons CC0 1.0
|
||||
You may use this work under the terms of a Creative Commons CC0 1.0
|
||||
License/Waiver or the Apache Public License 2.0, at your option. The terms of
|
||||
these licenses can be found at:
|
||||
|
||||
|
|
20
third_party/bzip2/CHANGES
vendored
20
third_party/bzip2/CHANGES
vendored
|
@ -5,7 +5,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -20,7 +20,7 @@ First version.
|
|||
|
||||
0.9.0a
|
||||
~~~~~~
|
||||
Removed 'ranlib' from Makefile, since most modern Unix-es
|
||||
Removed 'ranlib' from Makefile, since most modern Unix-es
|
||||
don't need it, or even know about it.
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ In bzlib.c:
|
|||
bzBuffToBuffDecompress. Fixed.
|
||||
|
||||
In compress.c:
|
||||
* changed setting of nGroups in sendMTFValues() so as to
|
||||
* changed setting of nGroups in sendMTFValues() so as to
|
||||
do a bit better on small files. This _does_ effect
|
||||
bzip2.c.
|
||||
|
||||
|
@ -117,7 +117,7 @@ changes are minor documentation changes.
|
|||
Several minor bugfixes and enhancements:
|
||||
|
||||
* Large file support. The library uses 64-bit counters to
|
||||
count the volume of data passing through it. bzip2.c
|
||||
count the volume of data passing through it. bzip2.c
|
||||
is now compiled with -D_FILE_OFFSET_BITS=64 to get large
|
||||
file support from the C library. -v correctly prints out
|
||||
file sizes greater than 4 gigabytes. All these changes have
|
||||
|
@ -128,7 +128,7 @@ Several minor bugfixes and enhancements:
|
|||
* Decompression robustness. The library/program should be
|
||||
robust to any corruption of compressed data, detecting and
|
||||
handling _all_ corruption, instead of merely relying on
|
||||
the CRCs. What this means is that the program should
|
||||
the CRCs. What this means is that the program should
|
||||
never crash, given corrupted data, and the library should
|
||||
always return BZ_DATA_ERROR.
|
||||
|
||||
|
@ -140,13 +140,13 @@ Several minor bugfixes and enhancements:
|
|||
* Don't run out of file handles on test/decompression when
|
||||
large numbers of files have invalid magic numbers.
|
||||
|
||||
* Avoid library namespace pollution. Prefix all exported
|
||||
* Avoid library namespace pollution. Prefix all exported
|
||||
symbols with BZ2_.
|
||||
|
||||
* Minor sorting enhancements from my DCC2000 paper.
|
||||
|
||||
* Advance the version number to 1.0, so as to counteract the
|
||||
(false-in-this-case) impression some people have that programs
|
||||
(false-in-this-case) impression some people have that programs
|
||||
with version numbers less than 1.0 are in some way, experimental,
|
||||
pre-release versions.
|
||||
|
||||
|
@ -156,10 +156,10 @@ Several minor bugfixes and enhancements:
|
|||
* Make the program exit with 2 instead of 0 when decompression
|
||||
fails due to a bad magic number (ie, an invalid bzip2 header).
|
||||
Also exit with 1 (as the manual claims :-) whenever a diagnostic
|
||||
message would have been printed AND the corresponding operation
|
||||
message would have been printed AND the corresponding operation
|
||||
is aborted, for example
|
||||
bzip2: Output file xx already exists.
|
||||
When a diagnostic message is printed but the operation is not
|
||||
When a diagnostic message is printed but the operation is not
|
||||
aborted, for example
|
||||
bzip2: Can't guess original name for wurble -- using wurble.out
|
||||
then the exit value 0 is returned, unless some other problem is
|
||||
|
@ -272,7 +272,7 @@ Fixes some minor bugs since the last version, 1.0.2.
|
|||
* Further robustification against corrupted compressed data.
|
||||
There are currently no known bitstreams which can cause the
|
||||
decompressor to crash, loop or access memory which does not
|
||||
belong to it. If you are using bzip2 or the library to
|
||||
belong to it. If you are using bzip2 or the library to
|
||||
decompress bitstreams from untrusted sources, an upgrade
|
||||
to 1.0.3 is recommended. This fixes CAN-2005-1260.
|
||||
|
||||
|
|
10
third_party/bzip2/LICENSE
vendored
10
third_party/bzip2/LICENSE
vendored
|
@ -12,16 +12,16 @@ are met:
|
|||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
|
|
24
third_party/bzip2/README
vendored
24
third_party/bzip2/README
vendored
|
@ -79,7 +79,7 @@ unmodified with MS Visual C. If you have difficulties building, you
|
|||
might want to read README.COMPILATION.PROBLEMS.
|
||||
|
||||
At least using MS Visual C++ 6, you can build from the unmodified
|
||||
sources by issuing, in a command shell:
|
||||
sources by issuing, in a command shell:
|
||||
|
||||
nmake -f makefile.msc
|
||||
|
||||
|
@ -103,12 +103,12 @@ Please read and be aware of the following:
|
|||
|
||||
WARNING:
|
||||
|
||||
This program and library (attempts to) compress data by
|
||||
performing several non-trivial transformations on it.
|
||||
Unless you are 100% familiar with *all* the algorithms
|
||||
contained herein, and with the consequences of modifying them,
|
||||
you should NOT meddle with the compression or decompression
|
||||
machinery. Incorrect changes can and very likely *will*
|
||||
This program and library (attempts to) compress data by
|
||||
performing several non-trivial transformations on it.
|
||||
Unless you are 100% familiar with *all* the algorithms
|
||||
contained herein, and with the consequences of modifying them,
|
||||
you should NOT meddle with the compression or decompression
|
||||
machinery. Incorrect changes can and very likely *will*
|
||||
lead to disastrous loss of data.
|
||||
|
||||
|
||||
|
@ -128,16 +128,16 @@ DISCLAIMER:
|
|||
PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
|
||||
SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
|
||||
|
||||
That is not to say this program is inherently unreliable.
|
||||
Indeed, I very much hope the opposite is true. bzip2/libbzip2
|
||||
That is not to say this program is inherently unreliable.
|
||||
Indeed, I very much hope the opposite is true. bzip2/libbzip2
|
||||
has been carefully constructed and extensively tested.
|
||||
|
||||
|
||||
PATENTS:
|
||||
|
||||
To the best of my knowledge, bzip2/libbzip2 does not use any
|
||||
patented algorithms. However, I do not have the resources
|
||||
to carry out a patent search. Therefore I cannot give any
|
||||
To the best of my knowledge, bzip2/libbzip2 does not use any
|
||||
patented algorithms. However, I do not have the resources
|
||||
to carry out a patent search. Therefore I cannot give any
|
||||
guarantee of the above statement.
|
||||
|
||||
|
||||
|
|
132
third_party/bzip2/blocksort.c
vendored
132
third_party/bzip2/blocksort.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -30,11 +30,11 @@
|
|||
/*---------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
__inline__
|
||||
void fallbackSimpleSort ( UInt32* fmap,
|
||||
UInt32* eclass,
|
||||
Int32 lo,
|
||||
void fallbackSimpleSort ( UInt32* fmap,
|
||||
UInt32* eclass,
|
||||
Int32 lo,
|
||||
Int32 hi )
|
||||
{
|
||||
Int32 i, j, tmp;
|
||||
|
@ -93,9 +93,9 @@ void fallbackSimpleSort ( UInt32* fmap,
|
|||
|
||||
|
||||
static
|
||||
void fallbackQSort3 ( UInt32* fmap,
|
||||
void fallbackQSort3 ( UInt32* fmap,
|
||||
UInt32* eclass,
|
||||
Int32 loSt,
|
||||
Int32 loSt,
|
||||
Int32 hiSt )
|
||||
{
|
||||
Int32 unLo, unHi, ltLo, gtHi, n, m;
|
||||
|
@ -120,9 +120,9 @@ void fallbackQSort3 ( UInt32* fmap,
|
|||
}
|
||||
|
||||
/* Random partitioning. Median of 3 sometimes fails to
|
||||
avoid bad cases. Median of 9 seems to help but
|
||||
avoid bad cases. Median of 9 seems to help but
|
||||
looks rather expensive. This too seems to work but
|
||||
is cheaper. Guidance for the magic constants
|
||||
is cheaper. Guidance for the magic constants
|
||||
7621 and 32768 is taken from Sedgewick's algorithms
|
||||
book, chapter 35.
|
||||
*/
|
||||
|
@ -139,10 +139,10 @@ void fallbackQSort3 ( UInt32* fmap,
|
|||
while (1) {
|
||||
if (unLo > unHi) break;
|
||||
n = (Int32)eclass[fmap[unLo]] - (Int32)med;
|
||||
if (n == 0) {
|
||||
fswap(fmap[unLo], fmap[ltLo]);
|
||||
ltLo++; unLo++;
|
||||
continue;
|
||||
if (n == 0) {
|
||||
fswap(fmap[unLo], fmap[ltLo]);
|
||||
ltLo++; unLo++;
|
||||
continue;
|
||||
};
|
||||
if (n > 0) break;
|
||||
unLo++;
|
||||
|
@ -150,10 +150,10 @@ void fallbackQSort3 ( UInt32* fmap,
|
|||
while (1) {
|
||||
if (unLo > unHi) break;
|
||||
n = (Int32)eclass[fmap[unHi]] - (Int32)med;
|
||||
if (n == 0) {
|
||||
fswap(fmap[unHi], fmap[gtHi]);
|
||||
gtHi--; unHi--;
|
||||
continue;
|
||||
if (n == 0) {
|
||||
fswap(fmap[unHi], fmap[gtHi]);
|
||||
gtHi--; unHi--;
|
||||
continue;
|
||||
};
|
||||
if (n < 0) break;
|
||||
unHi--;
|
||||
|
@ -212,8 +212,8 @@ void fallbackQSort3 ( UInt32* fmap,
|
|||
#define UNALIGNED_BH(zz) ((zz) & 0x01f)
|
||||
|
||||
static
|
||||
void fallbackSort ( UInt32* fmap,
|
||||
UInt32* eclass,
|
||||
void fallbackSort ( UInt32* fmap,
|
||||
UInt32* eclass,
|
||||
UInt32* bhtab,
|
||||
Int32 nblock,
|
||||
Int32 verb )
|
||||
|
@ -254,7 +254,7 @@ void fallbackSort ( UInt32* fmap,
|
|||
--*/
|
||||
|
||||
/*-- set sentinel bits for block-end detection --*/
|
||||
for (i = 0; i < 32; i++) {
|
||||
for (i = 0; i < 32; i++) {
|
||||
SET_BH(nblock + 2*i);
|
||||
CLEAR_BH(nblock + 2*i + 1);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ void fallbackSort ( UInt32* fmap,
|
|||
H = 1;
|
||||
while (1) {
|
||||
|
||||
if (verb >= 4)
|
||||
if (verb >= 4)
|
||||
VPrintf1 ( " depth %6d has ", H );
|
||||
|
||||
j = 0;
|
||||
|
@ -308,14 +308,14 @@ void fallbackSort ( UInt32* fmap,
|
|||
}
|
||||
}
|
||||
|
||||
if (verb >= 4)
|
||||
if (verb >= 4)
|
||||
VPrintf1 ( "%6d unresolved strings\n", nNotDone );
|
||||
|
||||
H *= 2;
|
||||
if (H > nblock || nNotDone == 0) break;
|
||||
}
|
||||
|
||||
/*--
|
||||
/*--
|
||||
Reconstruct the original block in
|
||||
eclass8 [0 .. nblock-1], since the
|
||||
previous phase destroyed it.
|
||||
|
@ -347,9 +347,9 @@ void fallbackSort ( UInt32* fmap,
|
|||
/*---------------------------------------------*/
|
||||
static
|
||||
__inline__
|
||||
Bool mainGtU ( UInt32 i1,
|
||||
Bool mainGtU ( UInt32 i1,
|
||||
UInt32 i2,
|
||||
UChar* block,
|
||||
UChar* block,
|
||||
UInt16* quadrant,
|
||||
UInt32 nblock,
|
||||
Int32* budget )
|
||||
|
@ -489,8 +489,8 @@ void mainSimpleSort ( UInt32* ptr,
|
|||
UChar* block,
|
||||
UInt16* quadrant,
|
||||
Int32 nblock,
|
||||
Int32 lo,
|
||||
Int32 hi,
|
||||
Int32 lo,
|
||||
Int32 hi,
|
||||
Int32 d,
|
||||
Int32* budget )
|
||||
{
|
||||
|
@ -514,8 +514,8 @@ void mainSimpleSort ( UInt32* ptr,
|
|||
if (i > hi) break;
|
||||
v = ptr[i];
|
||||
j = i;
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
) ) {
|
||||
ptr[j] = ptr[j-h];
|
||||
j = j - h;
|
||||
|
@ -528,8 +528,8 @@ void mainSimpleSort ( UInt32* ptr,
|
|||
if (i > hi) break;
|
||||
v = ptr[i];
|
||||
j = i;
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
) ) {
|
||||
ptr[j] = ptr[j-h];
|
||||
j = j - h;
|
||||
|
@ -542,8 +542,8 @@ void mainSimpleSort ( UInt32* ptr,
|
|||
if (i > hi) break;
|
||||
v = ptr[i];
|
||||
j = i;
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
while ( mainGtU (
|
||||
ptr[j-h]+d, v+d, block, quadrant, nblock, budget
|
||||
) ) {
|
||||
ptr[j] = ptr[j-h];
|
||||
j = j - h;
|
||||
|
@ -581,13 +581,13 @@ void mainSimpleSort ( UInt32* ptr,
|
|||
} \
|
||||
}
|
||||
|
||||
static
|
||||
static
|
||||
__inline__
|
||||
UChar mmed3 ( UChar a, UChar b, UChar c )
|
||||
{
|
||||
UChar t;
|
||||
if (a > b) { t = a; a = b; b = t; };
|
||||
if (b > c) {
|
||||
if (b > c) {
|
||||
b = c;
|
||||
if (a > b) b = a;
|
||||
}
|
||||
|
@ -625,8 +625,8 @@ void mainQSort3 ( UInt32* ptr,
|
|||
UChar* block,
|
||||
UInt16* quadrant,
|
||||
Int32 nblock,
|
||||
Int32 loSt,
|
||||
Int32 hiSt,
|
||||
Int32 loSt,
|
||||
Int32 hiSt,
|
||||
Int32 dSt,
|
||||
Int32* budget )
|
||||
{
|
||||
|
@ -649,14 +649,14 @@ void mainQSort3 ( UInt32* ptr,
|
|||
AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 );
|
||||
|
||||
mpop ( lo, hi, d );
|
||||
if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
|
||||
if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
|
||||
d > MAIN_QSORT_DEPTH_THRESH) {
|
||||
mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );
|
||||
if (*budget < 0) return;
|
||||
continue;
|
||||
}
|
||||
|
||||
med = (Int32)
|
||||
med = (Int32)
|
||||
mmed3 ( block[ptr[ lo ]+d],
|
||||
block[ptr[ hi ]+d],
|
||||
block[ptr[ (lo+hi)>>1 ]+d] );
|
||||
|
@ -668,9 +668,9 @@ void mainQSort3 ( UInt32* ptr,
|
|||
while (True) {
|
||||
if (unLo > unHi) break;
|
||||
n = ((Int32)block[ptr[unLo]+d]) - med;
|
||||
if (n == 0) {
|
||||
mswap(ptr[unLo], ptr[ltLo]);
|
||||
ltLo++; unLo++; continue;
|
||||
if (n == 0) {
|
||||
mswap(ptr[unLo], ptr[ltLo]);
|
||||
ltLo++; unLo++; continue;
|
||||
};
|
||||
if (n > 0) break;
|
||||
unLo++;
|
||||
|
@ -678,9 +678,9 @@ void mainQSort3 ( UInt32* ptr,
|
|||
while (True) {
|
||||
if (unLo > unHi) break;
|
||||
n = ((Int32)block[ptr[unHi]+d]) - med;
|
||||
if (n == 0) {
|
||||
mswap(ptr[unHi], ptr[gtHi]);
|
||||
gtHi--; unHi--; continue;
|
||||
if (n == 0) {
|
||||
mswap(ptr[unHi], ptr[gtHi]);
|
||||
gtHi--; unHi--; continue;
|
||||
};
|
||||
if (n < 0) break;
|
||||
unHi--;
|
||||
|
@ -751,9 +751,9 @@ void mainQSort3 ( UInt32* ptr,
|
|||
#define CLEARMASK (~(SETMASK))
|
||||
|
||||
static
|
||||
void mainSort ( UInt32* ptr,
|
||||
void mainSort ( UInt32* ptr,
|
||||
UChar* block,
|
||||
UInt16* quadrant,
|
||||
UInt16* quadrant,
|
||||
UInt32* ftab,
|
||||
Int32 nblock,
|
||||
Int32 verb,
|
||||
|
@ -881,7 +881,7 @@ void mainSort ( UInt32* ptr,
|
|||
/*--
|
||||
Step 1:
|
||||
Complete the big bucket [ss] by quicksorting
|
||||
any unsorted small buckets [ss, j], for j != ss.
|
||||
any unsorted small buckets [ss, j], for j != ss.
|
||||
Hopefully previous pointer-scanning phases have already
|
||||
completed many of the small buckets [ss, j], so
|
||||
we don't have to sort them at all.
|
||||
|
@ -897,10 +897,10 @@ void mainSort ( UInt32* ptr,
|
|||
VPrintf4 ( " qsort [0x%x, 0x%x] "
|
||||
"done %d this %d\n",
|
||||
ss, j, numQSorted, hi - lo + 1 );
|
||||
mainQSort3 (
|
||||
ptr, block, quadrant, nblock,
|
||||
lo, hi, BZ_N_RADIX, budget
|
||||
);
|
||||
mainQSort3 (
|
||||
ptr, block, quadrant, nblock,
|
||||
lo, hi, BZ_N_RADIX, budget
|
||||
);
|
||||
numQSorted += (hi - lo + 1);
|
||||
if (*budget < 0) return;
|
||||
}
|
||||
|
@ -932,16 +932,16 @@ void mainSort ( UInt32* ptr,
|
|||
for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
|
||||
k = ptr[j]-1; if (k < 0) k += nblock;
|
||||
c1 = block[k];
|
||||
if (!bigDone[c1])
|
||||
if (!bigDone[c1])
|
||||
ptr[ copyEnd[c1]-- ] = k;
|
||||
}
|
||||
}
|
||||
|
||||
AssertH ( (copyStart[ss]-1 == copyEnd[ss])
|
||||
||
|
||||
||
|
||||
/* Extremely rare case missing in bzip2-1.0.0 and 1.0.1.
|
||||
Necessity for this case is demonstrated by compressing
|
||||
a sequence of approximately 48.5 million of character
|
||||
Necessity for this case is demonstrated by compressing
|
||||
a sequence of approximately 48.5 million of character
|
||||
251; 1.0.0/1.0.1 will then die here. */
|
||||
(copyStart[ss] == 0 && copyEnd[ss] == nblock-1),
|
||||
1007 )
|
||||
|
@ -958,7 +958,7 @@ void mainSort ( UInt32* ptr,
|
|||
updating for the last bucket is pointless.
|
||||
|
||||
The quadrant array provides a way to incrementally
|
||||
cache sort orderings, as they appear, so as to
|
||||
cache sort orderings, as they appear, so as to
|
||||
make subsequent comparisons in fullGtU() complete
|
||||
faster. For repetitive blocks this makes a big
|
||||
difference (but not big enough to be able to avoid
|
||||
|
@ -968,9 +968,9 @@ void mainSort ( UInt32* ptr,
|
|||
|
||||
for 0 <= i < nblock and 0 <= j <= nblock
|
||||
|
||||
if block[i] != block[j],
|
||||
if block[i] != block[j],
|
||||
|
||||
then the relative values of quadrant[i] and
|
||||
then the relative values of quadrant[i] and
|
||||
quadrant[j] are meaningless.
|
||||
|
||||
else {
|
||||
|
@ -1033,7 +1033,7 @@ void mainSort ( UInt32* ptr,
|
|||
*/
|
||||
void BZ2_blockSort ( EState* s )
|
||||
{
|
||||
UInt32* ptr = s->ptr;
|
||||
UInt32* ptr = s->ptr;
|
||||
UChar* block = s->block;
|
||||
UInt32* ftab = s->ftab;
|
||||
Int32 nblock = s->nblock;
|
||||
|
@ -1057,8 +1057,8 @@ void BZ2_blockSort ( EState* s )
|
|||
quadrant = (UInt16*)(&(block[i]));
|
||||
|
||||
/* (wfact-1) / 3 puts the default-factor-30
|
||||
transition point at very roughly the same place as
|
||||
with v0.1 and v0.9.0.
|
||||
transition point at very roughly the same place as
|
||||
with v0.1 and v0.9.0.
|
||||
Not that it particularly matters any more, since the
|
||||
resulting compressed stream is now the same regardless
|
||||
of whether or not we use the main sort or fallback sort.
|
||||
|
@ -1069,14 +1069,14 @@ void BZ2_blockSort ( EState* s )
|
|||
budget = budgetInit;
|
||||
|
||||
mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );
|
||||
if (verb >= 3)
|
||||
if (verb >= 3)
|
||||
VPrintf3 ( " %d work, %d block, ratio %5.2f\n",
|
||||
budgetInit - budget,
|
||||
nblock,
|
||||
nblock,
|
||||
(float)(budgetInit - budget) /
|
||||
(float)(nblock==0 ? 1 : nblock) );
|
||||
(float)(nblock==0 ? 1 : nblock) );
|
||||
if (budget < 0) {
|
||||
if (verb >= 2)
|
||||
if (verb >= 2)
|
||||
VPrintf0 ( " too repetitive; using fallback"
|
||||
" sorting algorithm\n" );
|
||||
fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
|
||||
|
|
2
third_party/bzip2/bzdiff
vendored
2
third_party/bzip2/bzdiff
vendored
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
|
||||
|
||||
# Bzcmp/diff wrapped for bzip2,
|
||||
# Bzcmp/diff wrapped for bzip2,
|
||||
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
|
||||
|
||||
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
|
||||
|
|
4
third_party/bzip2/bzdiff.1
vendored
4
third_party/bzip2/bzdiff.1
vendored
|
@ -13,7 +13,7 @@ bzcmp, bzdiff \- compare bzip2 compressed files
|
|||
[ file2 ]
|
||||
.SH DESCRIPTION
|
||||
.I Bzcmp
|
||||
and
|
||||
and
|
||||
.I bzdiff
|
||||
are used to invoke the
|
||||
.I cmp
|
||||
|
@ -32,7 +32,7 @@ If two files are specified, then they are uncompressed if necessary and fed to
|
|||
.I cmp
|
||||
or
|
||||
.IR diff "."
|
||||
The exit status from
|
||||
The exit status from
|
||||
.I cmp
|
||||
or
|
||||
.I diff
|
||||
|
|
2
third_party/bzip2/bzgrep
vendored
2
third_party/bzip2/bzgrep
vendored
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Bzgrep wrapped for bzip2,
|
||||
# Bzgrep wrapped for bzip2,
|
||||
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
|
||||
## zgrep notice:
|
||||
## zgrep -- a wrapper around a grep program that decompresses files as needed
|
||||
|
|
102
third_party/bzip2/bzip2.1
vendored
102
third_party/bzip2/bzip2.1
vendored
|
@ -18,13 +18,13 @@ bzip2recover \- recovers data from damaged bzip2 files
|
|||
.br
|
||||
.B bunzip2
|
||||
.RB [ " \-fkvsVL " ]
|
||||
[
|
||||
[
|
||||
.I "filenames \&..."
|
||||
]
|
||||
.br
|
||||
.B bzcat
|
||||
.RB [ " \-s " ]
|
||||
[
|
||||
[
|
||||
.I "filenames \&..."
|
||||
]
|
||||
.br
|
||||
|
@ -39,15 +39,15 @@ generally considerably better than that achieved by more conventional
|
|||
LZ77/LZ78-based compressors, and approaches the performance of the PPM
|
||||
family of statistical compressors.
|
||||
|
||||
The command-line options are deliberately very similar to
|
||||
those of
|
||||
.I GNU gzip,
|
||||
The command-line options are deliberately very similar to
|
||||
those of
|
||||
.I GNU gzip,
|
||||
but they are not identical.
|
||||
|
||||
.I bzip2
|
||||
expects a list of file names to accompany the
|
||||
command-line flags. Each file is replaced by a compressed version of
|
||||
itself, with the name "original_name.bz2".
|
||||
itself, with the name "original_name.bz2".
|
||||
Each compressed file
|
||||
has the same modification date, permissions, and, when possible,
|
||||
ownership as the corresponding original, so that these properties can
|
||||
|
@ -74,13 +74,13 @@ incomprehensible and therefore pointless.
|
|||
|
||||
.I bunzip2
|
||||
(or
|
||||
.I bzip2 \-d)
|
||||
.I bzip2 \-d)
|
||||
decompresses all
|
||||
specified files. Files which were not created by
|
||||
specified files. Files which were not created by
|
||||
.I bzip2
|
||||
will be detected and ignored, and a warning issued.
|
||||
will be detected and ignored, and a warning issued.
|
||||
.I bzip2
|
||||
attempts to guess the filename for the decompressed file
|
||||
attempts to guess the filename for the decompressed file
|
||||
from that of the compressed file as follows:
|
||||
|
||||
filename.bz2 becomes filename
|
||||
|
@ -89,13 +89,13 @@ from that of the compressed file as follows:
|
|||
filename.tbz becomes filename.tar
|
||||
anyothername becomes anyothername.out
|
||||
|
||||
If the file does not end in one of the recognised endings,
|
||||
.I .bz2,
|
||||
.I .bz,
|
||||
If the file does not end in one of the recognised endings,
|
||||
.I .bz2,
|
||||
.I .bz,
|
||||
.I .tbz2
|
||||
or
|
||||
.I .tbz,
|
||||
.I bzip2
|
||||
.I .tbz,
|
||||
.I bzip2
|
||||
complains that it cannot
|
||||
guess the name of the original file, and uses the original name
|
||||
with
|
||||
|
@ -103,25 +103,25 @@ with
|
|||
appended.
|
||||
|
||||
As with compression, supplying no
|
||||
filenames causes decompression from
|
||||
filenames causes decompression from
|
||||
standard input to standard output.
|
||||
|
||||
.I bunzip2
|
||||
.I bunzip2
|
||||
will correctly decompress a file which is the
|
||||
concatenation of two or more compressed files. The result is the
|
||||
concatenation of the corresponding uncompressed files. Integrity
|
||||
testing (\-t)
|
||||
of concatenated
|
||||
testing (\-t)
|
||||
of concatenated
|
||||
compressed files is also supported.
|
||||
|
||||
You can also compress or decompress files to the standard output by
|
||||
giving the \-c flag. Multiple files may be compressed and
|
||||
decompressed like this. The resulting outputs are fed sequentially to
|
||||
stdout. Compression of multiple files
|
||||
stdout. Compression of multiple files
|
||||
in this manner generates a stream
|
||||
containing multiple compressed file representations. Such a stream
|
||||
can be decompressed correctly only by
|
||||
.I bzip2
|
||||
.I bzip2
|
||||
version 0.9.0 or
|
||||
later. Earlier versions of
|
||||
.I bzip2
|
||||
|
@ -130,7 +130,7 @@ the first file in the stream.
|
|||
|
||||
.I bzcat
|
||||
(or
|
||||
.I bzip2 -dc)
|
||||
.I bzip2 -dc)
|
||||
decompresses all specified files to
|
||||
the standard output.
|
||||
|
||||
|
@ -140,10 +140,10 @@ will read arguments from the environment variables
|
|||
and
|
||||
.I BZIP,
|
||||
in that order, and will process them
|
||||
before any arguments read from the command line. This gives a
|
||||
before any arguments read from the command line. This gives a
|
||||
convenient way to supply default arguments.
|
||||
|
||||
Compression is always performed, even if the compressed
|
||||
Compression is always performed, even if the compressed
|
||||
file is slightly
|
||||
larger than the original. Files of less than about one hundred bytes
|
||||
tend to get larger, since the compression mechanism has a constant
|
||||
|
@ -151,8 +151,8 @@ overhead in the region of 50 bytes. Random data (including the output
|
|||
of most file compressors) is coded at about 8.05 bits per byte, giving
|
||||
an expansion of around 0.5%.
|
||||
|
||||
As a self-check for your protection,
|
||||
.I
|
||||
As a self-check for your protection,
|
||||
.I
|
||||
bzip2
|
||||
uses 32-bit CRCs to
|
||||
make sure that the decompressed version of a file is identical to the
|
||||
|
@ -163,9 +163,9 @@ against undetected bugs in
|
|||
chances of data corruption going undetected is microscopic, about one
|
||||
chance in four billion for each file processed. Be aware, though, that
|
||||
the check occurs upon decompression, so it can only tell you that
|
||||
something is wrong. It can't help you
|
||||
something is wrong. It can't help you
|
||||
recover the original uncompressed
|
||||
data. You can use
|
||||
data. You can use
|
||||
.I bzip2recover
|
||||
to try to recover data from
|
||||
damaged files.
|
||||
|
@ -183,15 +183,15 @@ to panic.
|
|||
Compress or decompress to standard output.
|
||||
.TP
|
||||
.B \-d --decompress
|
||||
Force decompression.
|
||||
.I bzip2,
|
||||
.I bunzip2
|
||||
Force decompression.
|
||||
.I bzip2,
|
||||
.I bunzip2
|
||||
and
|
||||
.I bzcat
|
||||
.I bzcat
|
||||
are
|
||||
really the same program, and the decision about what actions to take is
|
||||
done on the basis of which name is used. This flag overrides that
|
||||
mechanism, and forces
|
||||
mechanism, and forces
|
||||
.I bzip2
|
||||
to decompress.
|
||||
.TP
|
||||
|
@ -205,10 +205,10 @@ This really performs a trial decompression and throws away the result.
|
|||
.TP
|
||||
.B \-f --force
|
||||
Force overwrite of output files. Normally,
|
||||
.I bzip2
|
||||
.I bzip2
|
||||
will not overwrite
|
||||
existing output files. Also forces
|
||||
.I bzip2
|
||||
existing output files. Also forces
|
||||
.I bzip2
|
||||
to break hard links
|
||||
to files, which it otherwise wouldn't do.
|
||||
|
||||
|
@ -246,9 +246,9 @@ Display the software version, license terms and conditions.
|
|||
.B \-1 (or \-\-fast) to \-9 (or \-\-best)
|
||||
Set the block size to 100 k, 200 k .. 900 k when compressing. Has no
|
||||
effect when decompressing. See MEMORY MANAGEMENT below.
|
||||
The \-\-fast and \-\-best aliases are primarily for GNU gzip
|
||||
The \-\-fast and \-\-best aliases are primarily for GNU gzip
|
||||
compatibility. In particular, \-\-fast doesn't make things
|
||||
significantly faster.
|
||||
significantly faster.
|
||||
And \-\-best merely selects the default behaviour.
|
||||
.TP
|
||||
.B \--
|
||||
|
@ -263,7 +263,7 @@ earlier versions, which was sometimes useful. 0.9.5 and above have an
|
|||
improved algorithm which renders these flags irrelevant.
|
||||
|
||||
.SH MEMORY MANAGEMENT
|
||||
.I bzip2
|
||||
.I bzip2
|
||||
compresses large files in blocks. The block size affects
|
||||
both the compression ratio achieved, and the amount of memory needed for
|
||||
compression and decompression. The flags \-1 through \-9
|
||||
|
@ -276,7 +276,7 @@ the file. Since block sizes are stored in compressed files, it follows
|
|||
that the flags \-1 to \-9 are irrelevant to and so ignored
|
||||
during decompression.
|
||||
|
||||
Compression and decompression requirements,
|
||||
Compression and decompression requirements,
|
||||
in bytes, can be estimated as:
|
||||
|
||||
Compression: 400k + ( 8 x block size )
|
||||
|
@ -295,7 +295,7 @@ requirement is set at compression time by the choice of block size.
|
|||
For files compressed with the default 900k block size,
|
||||
.I bunzip2
|
||||
will require about 3700 kbytes to decompress. To support decompression
|
||||
of any file on a 4 megabyte machine,
|
||||
of any file on a 4 megabyte machine,
|
||||
.I bunzip2
|
||||
has an option to
|
||||
decompress using approximately half this amount of memory, about 2300
|
||||
|
@ -350,20 +350,20 @@ damaged blocks can be distinguished from undamaged ones.
|
|||
|
||||
.I bzip2recover
|
||||
is a simple program whose purpose is to search for
|
||||
blocks in .bz2 files, and write each block out into its own .bz2
|
||||
blocks in .bz2 files, and write each block out into its own .bz2
|
||||
file. You can then use
|
||||
.I bzip2
|
||||
.I bzip2
|
||||
\-t
|
||||
to test the
|
||||
integrity of the resulting files, and decompress those which are
|
||||
undamaged.
|
||||
|
||||
.I bzip2recover
|
||||
takes a single argument, the name of the damaged file,
|
||||
takes a single argument, the name of the damaged file,
|
||||
and writes a number of files "rec00001file.bz2",
|
||||
"rec00002file.bz2", etc, containing the extracted blocks.
|
||||
The output filenames are designed so that the use of
|
||||
wildcards in subsequent processing -- for example,
|
||||
wildcards in subsequent processing -- for example,
|
||||
"bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in
|
||||
the correct order.
|
||||
|
||||
|
@ -371,8 +371,8 @@ the correct order.
|
|||
should be of most use dealing with large .bz2
|
||||
files, as these will contain many blocks. It is clearly
|
||||
futile to use it on damaged single-block files, since a
|
||||
damaged block cannot be recovered. If you wish to minimise
|
||||
any potential data loss through media or transmission errors,
|
||||
damaged block cannot be recovered. If you wish to minimise
|
||||
any potential data loss through media or transmission errors,
|
||||
you might consider compressing with a smaller
|
||||
block size.
|
||||
|
||||
|
@ -395,7 +395,7 @@ that performance, both for compressing and decompressing, is largely
|
|||
determined by the speed at which your machine can service cache misses.
|
||||
Because of this, small changes to the code to reduce the miss rate have
|
||||
been observed to give disproportionately large performance improvements.
|
||||
I imagine
|
||||
I imagine
|
||||
.I bzip2
|
||||
will perform best on machines with very large caches.
|
||||
|
||||
|
@ -406,7 +406,7 @@ tries hard to detect I/O errors and exit cleanly, but the details of
|
|||
what the problem is sometimes seem rather misleading.
|
||||
|
||||
This manual page pertains to version 1.0.8 of
|
||||
.I bzip2.
|
||||
.I bzip2.
|
||||
Compressed data created by this version is entirely forwards and
|
||||
backwards compatible with the previous public releases, versions
|
||||
0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following
|
||||
|
@ -440,13 +440,13 @@ Fenwick (for the structured coding model in the original
|
|||
.I bzip,
|
||||
and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
|
||||
(for the arithmetic coder in the original
|
||||
.I bzip).
|
||||
.I bzip).
|
||||
I am much
|
||||
indebted for their help, support and advice. See the manual in the
|
||||
source distribution for pointers to sources of documentation. Christian
|
||||
von Roques encouraged me to look for faster sorting algorithms, so as to
|
||||
speed up compression. Bela Lubkin encouraged me to improve the
|
||||
worst-case compression performance.
|
||||
worst-case compression performance.
|
||||
Donna Robinson XMLised the documentation.
|
||||
The bz* scripts are derived from those of GNU gzip.
|
||||
Many people sent patches, helped
|
||||
|
|
4
third_party/bzip2/bzip2.1.txt
vendored
4
third_party/bzip2/bzip2.1.txt
vendored
|
@ -351,10 +351,10 @@ bzip2(1) bzip2(1)
|
|||
This manual page pertains to version 1.0.8 of b̲z̲i̲p̲2̲.̲ Com-
|
||||
pressed data created by this version is entirely forwards
|
||||
and backwards compatible with the previous public
|
||||
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
|
||||
releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
|
||||
1.0.2 and above, but with the following exception: 0.9.0
|
||||
and above can correctly decompress multiple concatenated
|
||||
compressed files. 0.1pl2 cannot do this; it will stop
|
||||
compressed files. 0.1pl2 cannot do this; it will stop
|
||||
after decompressing just the first file in the stream.
|
||||
|
||||
b̲z̲i̲p̲2̲r̲e̲c̲o̲v̲e̲r̲ versions prior to 1.0.2 used 32-bit integers
|
||||
|
|
212
third_party/bzip2/bzip2.c
vendored
212
third_party/bzip2/bzip2.c
vendored
|
@ -27,7 +27,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -76,7 +76,7 @@ typedef int Int32;
|
|||
typedef unsigned int UInt32;
|
||||
typedef short Int16;
|
||||
typedef unsigned short UInt16;
|
||||
|
||||
|
||||
#define True ((Bool)1)
|
||||
#define False ((Bool)0)
|
||||
|
||||
|
@ -141,7 +141,7 @@ static void applySavedFileAttrToOutputFile ( IntNative fd );
|
|||
/*---------------------------------------------------*/
|
||||
|
||||
typedef
|
||||
struct { UChar b[8]; }
|
||||
struct { UChar b[8]; }
|
||||
UInt64;
|
||||
|
||||
|
||||
|
@ -184,7 +184,7 @@ Bool uInt64_isZero ( UInt64* n )
|
|||
|
||||
|
||||
/* Divide *n by 10, and return the remainder. */
|
||||
static
|
||||
static
|
||||
Int32 uInt64_qrm10 ( UInt64* n )
|
||||
{
|
||||
UInt32 rem, tmp;
|
||||
|
@ -215,7 +215,7 @@ void uInt64_toAscii ( char* outbuf, UInt64* n )
|
|||
nBuf++;
|
||||
} while (!uInt64_isZero(&n_copy));
|
||||
outbuf[nBuf] = 0;
|
||||
for (i = 0; i < nBuf; i++)
|
||||
for (i = 0; i < nBuf; i++)
|
||||
outbuf[i] = buf[nBuf-i-1];
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ void uInt64_toAscii ( char* outbuf, UInt64* n )
|
|||
/*---------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Bool myfeof ( FILE* f )
|
||||
{
|
||||
Int32 c = fgetc ( f );
|
||||
|
@ -236,7 +236,7 @@ Bool myfeof ( FILE* f )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void compressStream ( FILE *stream, FILE *zStream )
|
||||
{
|
||||
BZFILE* bzf = NULL;
|
||||
|
@ -252,8 +252,8 @@ void compressStream ( FILE *stream, FILE *zStream )
|
|||
if (ferror(stream)) goto errhandler_io;
|
||||
if (ferror(zStream)) goto errhandler_io;
|
||||
|
||||
bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
|
||||
blockSize100k, verbosity, workFactor );
|
||||
bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
|
||||
blockSize100k, verbosity, workFactor );
|
||||
if (bzerr != BZ_OK) goto errhandler;
|
||||
|
||||
if (verbosity >= 2) (fprintf) ( stderr, "\n" );
|
||||
|
@ -268,7 +268,7 @@ void compressStream ( FILE *stream, FILE *zStream )
|
|||
|
||||
}
|
||||
|
||||
BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
|
||||
BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
|
||||
&nbytes_in_lo32, &nbytes_in_hi32,
|
||||
&nbytes_out_lo32, &nbytes_out_hi32 );
|
||||
if (bzerr != BZ_OK) goto errhandler;
|
||||
|
@ -296,9 +296,9 @@ void compressStream ( FILE *stream, FILE *zStream )
|
|||
Char buf_nin[32], buf_nout[32];
|
||||
UInt64 nbytes_in, nbytes_out;
|
||||
double nbytes_in_d, nbytes_out_d;
|
||||
uInt64_from_UInt32s ( &nbytes_in,
|
||||
uInt64_from_UInt32s ( &nbytes_in,
|
||||
nbytes_in_lo32, nbytes_in_hi32 );
|
||||
uInt64_from_UInt32s ( &nbytes_out,
|
||||
uInt64_from_UInt32s ( &nbytes_out,
|
||||
nbytes_out_lo32, nbytes_out_hi32 );
|
||||
nbytes_in_d = uInt64_to_double ( &nbytes_in );
|
||||
nbytes_out_d = uInt64_to_double ( &nbytes_out );
|
||||
|
@ -318,7 +318,7 @@ void compressStream ( FILE *stream, FILE *zStream )
|
|||
return;
|
||||
|
||||
errhandler:
|
||||
BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1,
|
||||
BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1,
|
||||
&nbytes_in_lo32, &nbytes_in_hi32,
|
||||
&nbytes_out_lo32, &nbytes_out_hi32 );
|
||||
switch (bzerr) {
|
||||
|
@ -340,7 +340,7 @@ void compressStream ( FILE *stream, FILE *zStream )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Bool uncompressStream ( FILE *zStream, FILE *stream )
|
||||
{
|
||||
BZFILE* bzf = NULL;
|
||||
|
@ -362,8 +362,8 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
|
|||
|
||||
while (True) {
|
||||
|
||||
bzf = BZ2_bzReadOpen (
|
||||
&bzerr, zStream, verbosity,
|
||||
bzf = BZ2_bzReadOpen (
|
||||
&bzerr, zStream, verbosity,
|
||||
(int)smallMode, unused, nUnused
|
||||
);
|
||||
if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
|
||||
|
@ -412,7 +412,7 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
|
|||
if (verbosity >= 2) (fprintf) ( stderr, "\n " );
|
||||
return True;
|
||||
|
||||
trycat:
|
||||
trycat:
|
||||
if (forceOverwrite) {
|
||||
rewind(zStream);
|
||||
while (True) {
|
||||
|
@ -424,7 +424,7 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
|
|||
}
|
||||
goto closeok;
|
||||
}
|
||||
|
||||
|
||||
errhandler:
|
||||
BZ2_bzReadClose ( &bzerr_dummy, bzf );
|
||||
switch (bzerr) {
|
||||
|
@ -446,10 +446,10 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
|
|||
return False;
|
||||
} else {
|
||||
if (noisy)
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"\n%s: %s: trailing garbage after EOF ignored\n",
|
||||
progName, inName );
|
||||
return True;
|
||||
return True;
|
||||
}
|
||||
default:
|
||||
panic ( "decompress:unexpected error" );
|
||||
|
@ -461,7 +461,7 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Bool testStream ( FILE *zStream )
|
||||
{
|
||||
BZFILE* bzf = NULL;
|
||||
|
@ -480,8 +480,8 @@ Bool testStream ( FILE *zStream )
|
|||
|
||||
while (True) {
|
||||
|
||||
bzf = BZ2_bzReadOpen (
|
||||
&bzerr, zStream, verbosity,
|
||||
bzf = BZ2_bzReadOpen (
|
||||
&bzerr, zStream, verbosity,
|
||||
(int)smallMode, unused, nUnused
|
||||
);
|
||||
if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
|
||||
|
@ -514,7 +514,7 @@ Bool testStream ( FILE *zStream )
|
|||
|
||||
errhandler:
|
||||
BZ2_bzReadClose ( &bzerr_dummy, bzf );
|
||||
if (verbosity == 0)
|
||||
if (verbosity == 0)
|
||||
(fprintf) ( stderr, "%s: %s: ", progName, inName );
|
||||
switch (bzerr) {
|
||||
case BZ_CONFIG_ERROR:
|
||||
|
@ -535,14 +535,14 @@ Bool testStream ( FILE *zStream )
|
|||
case BZ_DATA_ERROR_MAGIC:
|
||||
if (zStream != stdin) fclose(zStream);
|
||||
if (streamNo == 1) {
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"bad magic number (file not created by bzip2)\n" );
|
||||
return False;
|
||||
} else {
|
||||
if (noisy)
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"trailing garbage after EOF ignored\n" );
|
||||
return True;
|
||||
return True;
|
||||
}
|
||||
default:
|
||||
panic ( "test:unexpected error" );
|
||||
|
@ -566,7 +566,7 @@ void setExit ( Int32 v )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void cadvise ( void )
|
||||
{
|
||||
if (noisy)
|
||||
|
@ -581,26 +581,26 @@ void cadvise ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void showFileNames ( void )
|
||||
{
|
||||
if (noisy)
|
||||
(fprintf) (
|
||||
stderr,
|
||||
"\tInput file = %s, output file = %s\n",
|
||||
inName, outName
|
||||
inName, outName
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void cleanUpAndFail ( Int32 ec )
|
||||
{
|
||||
IntNative retVal;
|
||||
struct MY_STAT statBuf;
|
||||
|
||||
if ( srcMode == SM_F2F
|
||||
if ( srcMode == SM_F2F
|
||||
&& opMode != OM_TEST
|
||||
&& deleteOutputOnInterrupt ) {
|
||||
|
||||
|
@ -612,7 +612,7 @@ void cleanUpAndFail ( Int32 ec )
|
|||
retVal = MY_STAT ( inName, &statBuf );
|
||||
if (retVal == 0) {
|
||||
if (noisy)
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: Deleting output file %s, if it exists.\n",
|
||||
progName, outName );
|
||||
if (outputHandleJustInCase != NULL)
|
||||
|
@ -633,7 +633,7 @@ void cleanUpAndFail ( Int32 ec )
|
|||
(fprintf) ( stderr,
|
||||
"%s: `%s' may be incomplete.\n",
|
||||
progName, outName );
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: I suggest doing an integrity test (bzip2 -tv)"
|
||||
" of it.\n",
|
||||
progName );
|
||||
|
@ -641,7 +641,7 @@ void cleanUpAndFail ( Int32 ec )
|
|||
}
|
||||
|
||||
if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) {
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: WARNING: some files have not been processed:\n"
|
||||
"%s: %d specified on command line, %d not processed yet.\n\n",
|
||||
progName, progName,
|
||||
|
@ -653,7 +653,7 @@ void cleanUpAndFail ( Int32 ec )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void panic ( const Char* s )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -668,7 +668,7 @@ void panic ( const Char* s )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void crcError ( void )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -681,7 +681,7 @@ void crcError ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void compressedStreamEOF ( void )
|
||||
{
|
||||
if (noisy) {
|
||||
|
@ -698,7 +698,7 @@ void compressedStreamEOF ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void ioError ( void )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -712,7 +712,7 @@ void ioError ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void mySignalCatcher ( IntNative n )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -723,11 +723,11 @@ void mySignalCatcher ( IntNative n )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void mySIGSEGVorSIGBUScatcher ( IntNative n )
|
||||
{
|
||||
if (opMode == OM_Z)
|
||||
(fprintf) (
|
||||
(fprintf) (
|
||||
stderr,
|
||||
"\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
|
||||
"\n"
|
||||
|
@ -748,7 +748,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
|
|||
"\n",
|
||||
progName );
|
||||
else
|
||||
(fprintf) (
|
||||
(fprintf) (
|
||||
stderr,
|
||||
"\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
|
||||
"\n"
|
||||
|
@ -779,7 +779,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void outOfMemory ( void )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -791,7 +791,7 @@ void outOfMemory ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void configError ( void )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -811,11 +811,11 @@ void configError ( void )
|
|||
|
||||
/* All rather crufty. The main problem is that input files
|
||||
are stat()d multiple times before use. This should be
|
||||
cleaned up.
|
||||
cleaned up.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void pad ( Char *s )
|
||||
{
|
||||
Int32 i;
|
||||
|
@ -826,8 +826,8 @@ void pad ( Char *s )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
void copyFileName ( Char* to, Char* from )
|
||||
static
|
||||
void copyFileName ( Char* to, Char* from )
|
||||
{
|
||||
if ( strlen(from) > FILE_NAME_LEN-10 ) {
|
||||
(fprintf) (
|
||||
|
@ -847,7 +847,7 @@ void copyFileName ( Char* to, Char* from )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Bool fileExists ( Char* name )
|
||||
{
|
||||
FILE *tmp = fopen ( name, "rb" );
|
||||
|
@ -888,7 +888,7 @@ FILE* fopen_output_safely ( Char* name, const char* mode )
|
|||
/*--
|
||||
if in doubt, return True
|
||||
--*/
|
||||
static
|
||||
static
|
||||
Bool notAStandardFile ( Char* name )
|
||||
{
|
||||
IntNative i;
|
||||
|
@ -905,9 +905,9 @@ Bool notAStandardFile ( Char* name )
|
|||
/*--
|
||||
rac 11/21/98 see if file has hard links to it
|
||||
--*/
|
||||
static
|
||||
static
|
||||
Int32 countHardLinks ( Char* name )
|
||||
{
|
||||
{
|
||||
IntNative i;
|
||||
struct MY_STAT statBuf;
|
||||
|
||||
|
@ -938,14 +938,14 @@ Int32 countHardLinks ( Char* name )
|
|||
|
||||
It sounds pretty fragile to me. Whether this carries across
|
||||
robustly to arbitrary Unix-like platforms (or even works robustly
|
||||
on this one, RedHat 7.2) is unknown to me. Nevertheless ...
|
||||
on this one, RedHat 7.2) is unknown to me. Nevertheless ...
|
||||
*/
|
||||
#if BZ_UNIX
|
||||
static
|
||||
static
|
||||
struct MY_STAT fileMetaInfo;
|
||||
#endif
|
||||
|
||||
static
|
||||
static
|
||||
void saveInputFileMetaInfo ( Char *srcName )
|
||||
{
|
||||
# if BZ_UNIX
|
||||
|
@ -957,7 +957,7 @@ void saveInputFileMetaInfo ( Char *srcName )
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
static
|
||||
void applySavedTimeInfoToOutputFile ( Char *dstName )
|
||||
{
|
||||
# if BZ_UNIX
|
||||
|
@ -972,7 +972,7 @@ void applySavedTimeInfoToOutputFile ( Char *dstName )
|
|||
# endif
|
||||
}
|
||||
|
||||
static
|
||||
static
|
||||
void applySavedFileAttrToOutputFile ( IntNative fd )
|
||||
{
|
||||
# if BZ_UNIX
|
||||
|
@ -990,7 +990,7 @@ void applySavedFileAttrToOutputFile ( IntNative fd )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Bool containsDubiousChars ( Char* name )
|
||||
{
|
||||
# if BZ_UNIX
|
||||
|
@ -999,7 +999,7 @@ Bool containsDubiousChars ( Char* name )
|
|||
*/
|
||||
return False;
|
||||
# else /* ! BZ_UNIX */
|
||||
/* On non-unix (Win* platforms), wildcard characters are not allowed in
|
||||
/* On non-unix (Win* platforms), wildcard characters are not allowed in
|
||||
* filenames.
|
||||
*/
|
||||
for (; *name != '\0'; name++)
|
||||
|
@ -1012,12 +1012,12 @@ Bool containsDubiousChars ( Char* name )
|
|||
/*---------------------------------------------*/
|
||||
#define BZ_N_SUFFIX_PAIRS 4
|
||||
|
||||
const Char* zSuffix[BZ_N_SUFFIX_PAIRS]
|
||||
const Char* zSuffix[BZ_N_SUFFIX_PAIRS]
|
||||
= { ".bz2", ".bz", ".tbz2", ".tbz" };
|
||||
const Char* unzSuffix[BZ_N_SUFFIX_PAIRS]
|
||||
const Char* unzSuffix[BZ_N_SUFFIX_PAIRS]
|
||||
= { "", "", ".tar", ".tar" };
|
||||
|
||||
static
|
||||
static
|
||||
Bool hasSuffix ( Char* s, const Char* suffix )
|
||||
{
|
||||
Int32 ns = strlen(s);
|
||||
|
@ -1027,9 +1027,9 @@ Bool hasSuffix ( Char* s, const Char* suffix )
|
|||
return False;
|
||||
}
|
||||
|
||||
static
|
||||
Bool mapSuffix ( Char* name,
|
||||
const Char* oldSuffix,
|
||||
static
|
||||
Bool mapSuffix ( Char* name,
|
||||
const Char* oldSuffix,
|
||||
const Char* newSuffix )
|
||||
{
|
||||
if (!hasSuffix(name,oldSuffix)) return False;
|
||||
|
@ -1040,7 +1040,7 @@ Bool mapSuffix ( Char* name,
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void compress ( Char *name )
|
||||
{
|
||||
FILE *inStr;
|
||||
|
@ -1054,18 +1054,18 @@ void compress ( Char *name )
|
|||
panic ( "compress: bad modes\n" );
|
||||
|
||||
switch (srcMode) {
|
||||
case SM_I2O:
|
||||
case SM_I2O:
|
||||
copyFileName ( inName, (Char*)"(stdin)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
break;
|
||||
case SM_F2F:
|
||||
case SM_F2F:
|
||||
copyFileName ( inName, name );
|
||||
copyFileName ( outName, name );
|
||||
strcat ( outName, ".bz2" );
|
||||
strcat ( outName, ".bz2" );
|
||||
break;
|
||||
case SM_F2O:
|
||||
case SM_F2O:
|
||||
copyFileName ( inName, name );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ void compress ( Char *name )
|
|||
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
|
||||
if (hasSuffix(inName, zSuffix[i])) {
|
||||
if (noisy)
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: Input file %s already has %s suffix.\n",
|
||||
progName, inName, zSuffix[i] );
|
||||
setExit(1);
|
||||
|
@ -1221,7 +1221,7 @@ void compress ( Char *name )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void uncompress ( Char *name )
|
||||
{
|
||||
FILE *inStr;
|
||||
|
@ -1238,22 +1238,22 @@ void uncompress ( Char *name )
|
|||
|
||||
cantGuess = False;
|
||||
switch (srcMode) {
|
||||
case SM_I2O:
|
||||
case SM_I2O:
|
||||
copyFileName ( inName, (Char*)"(stdin)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
break;
|
||||
case SM_F2F:
|
||||
case SM_F2F:
|
||||
copyFileName ( inName, name );
|
||||
copyFileName ( outName, name );
|
||||
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
|
||||
if (mapSuffix(outName,zSuffix[i],unzSuffix[i]))
|
||||
goto zzz;
|
||||
goto zzz;
|
||||
cantGuess = True;
|
||||
strcat ( outName, ".out" );
|
||||
break;
|
||||
case SM_F2O:
|
||||
case SM_F2O:
|
||||
copyFileName ( inName, name );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
copyFileName ( outName, (Char*)"(stdout)" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1290,11 +1290,11 @@ void uncompress ( Char *name )
|
|||
}
|
||||
if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
|
||||
if (noisy)
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: Can't guess original name for %s -- using %s\n",
|
||||
progName, inName, outName );
|
||||
/* just a warning, no return */
|
||||
}
|
||||
}
|
||||
if ( srcMode == SM_F2F && fileExists ( outName ) ) {
|
||||
if (forceOverwrite) {
|
||||
remove(outName);
|
||||
|
@ -1419,7 +1419,7 @@ void uncompress ( Char *name )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void testf ( Char *name )
|
||||
{
|
||||
FILE *inStr;
|
||||
|
@ -1508,7 +1508,7 @@ void testf ( Char *name )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void license ( void )
|
||||
{
|
||||
(fprintf) ( stderr,
|
||||
|
@ -1533,7 +1533,7 @@ void license ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void usage ( Char *fullProgName )
|
||||
{
|
||||
(fprintf) (
|
||||
|
@ -1577,11 +1577,11 @@ void usage ( Char *fullProgName )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void redundant ( Char* flag )
|
||||
{
|
||||
(fprintf) (
|
||||
stderr,
|
||||
(fprintf) (
|
||||
stderr,
|
||||
"%s: %s is redundant in versions 0.9.5 and above\n",
|
||||
progName, flag );
|
||||
}
|
||||
|
@ -1593,8 +1593,8 @@ void redundant ( Char* flag )
|
|||
implement a linked list of command-line arguments,
|
||||
into which main() copies argv[1 .. argc-1].
|
||||
|
||||
The purpose of this exercise is to facilitate
|
||||
the expansion of wildcard characters * and ? in
|
||||
The purpose of this exercise is to facilitate
|
||||
the expansion of wildcard characters * and ? in
|
||||
filenames for OSs which don't know how to do it
|
||||
themselves, like MSDOS, Windows 95 and NT.
|
||||
|
||||
|
@ -1611,7 +1611,7 @@ typedef
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
void *myMalloc ( Int32 n )
|
||||
{
|
||||
void* p;
|
||||
|
@ -1623,7 +1623,7 @@ void *myMalloc ( Int32 n )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Cell *mkCell ( void )
|
||||
{
|
||||
Cell *c;
|
||||
|
@ -1636,7 +1636,7 @@ Cell *mkCell ( void )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
static
|
||||
Cell *snocString ( Cell *root, Char *name )
|
||||
{
|
||||
if (root == NULL) {
|
||||
|
@ -1654,8 +1654,8 @@ Cell *snocString ( Cell *root, Char *name )
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
static
|
||||
void addFlagsFromEnvVar ( Cell** argList, Char* varName )
|
||||
static
|
||||
void addFlagsFromEnvVar ( Cell** argList, Char* varName )
|
||||
{
|
||||
Int32 i, j, k;
|
||||
Char *envbase, *p;
|
||||
|
@ -1732,7 +1732,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
if (*tmp == PATH_SEP) progName = tmp + 1;
|
||||
|
||||
|
||||
/*-- Copy flags from env var BZIP2, and
|
||||
/*-- Copy flags from env var BZIP2, and
|
||||
expand filename wildcards in arg list.
|
||||
--*/
|
||||
argList = NULL;
|
||||
|
@ -1815,7 +1815,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-- And again ... --*/
|
||||
for (aa = argList; aa != NULL; aa = aa->link) {
|
||||
if (ISFLAG("--")) break;
|
||||
|
@ -1829,7 +1829,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
if (ISFLAG("--quiet")) noisy = False; else
|
||||
if (ISFLAG("--version")) license(); else
|
||||
if (ISFLAG("--license")) license(); else
|
||||
if (ISFLAG("--exponential")) workFactor = 1; else
|
||||
if (ISFLAG("--exponential")) workFactor = 1; else
|
||||
if (ISFLAG("--repetitive-best")) redundant(aa->name); else
|
||||
if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
|
||||
if (ISFLAG("--fast")) blockSize100k = 1; else
|
||||
|
@ -1845,7 +1845,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
}
|
||||
|
||||
if (verbosity > 4) verbosity = 4;
|
||||
if (opMode == OM_Z && smallMode && blockSize100k > 2)
|
||||
if (opMode == OM_Z && smallMode && blockSize100k > 2)
|
||||
blockSize100k = 2;
|
||||
|
||||
if (opMode == OM_TEST && srcMode == SM_F2O) {
|
||||
|
@ -1879,7 +1879,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
compress ( aa->name );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (opMode == OM_UNZ) {
|
||||
|
@ -1893,13 +1893,13 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
if (aa->name[0] == '-' && decode) continue;
|
||||
numFilesProcessed++;
|
||||
uncompress ( aa->name );
|
||||
}
|
||||
}
|
||||
}
|
||||
if (unzFailsExist) {
|
||||
setExit(2);
|
||||
if (unzFailsExist) {
|
||||
setExit(2);
|
||||
exit(exitValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
testFailsExist = False;
|
||||
|
@ -1927,7 +1927,7 @@ IntNative main ( IntNative argc, Char *argv[] )
|
|||
}
|
||||
}
|
||||
|
||||
/* Free the argument list memory to mollify leak detectors
|
||||
/* Free the argument list memory to mollify leak detectors
|
||||
(eg) Purify, Checker. Serves no other useful purpose.
|
||||
*/
|
||||
aa = argList;
|
||||
|
|
40
third_party/bzip2/bzip2recover.c
vendored
40
third_party/bzip2/bzip2recover.c
vendored
|
@ -18,7 +18,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -77,7 +77,7 @@ MaybeUInt64 bytesIn = 0;
|
|||
#define BZ_HDR_Z 0x5a /* 'Z' */
|
||||
#define BZ_HDR_h 0x68 /* 'h' */
|
||||
#define BZ_HDR_0 0x30 /* '0' */
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/*--- I/O errors ---*/
|
||||
|
@ -130,7 +130,7 @@ static void tooManyBlocks ( Int32 max_handled_blocks )
|
|||
(fprintf) ( stderr,
|
||||
"%s: and cannot be handled. To fix, increase\n",
|
||||
progName );
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: BZ_MAX_HANDLED_BLOCKS in bzip2recover.c, and recompile.\n",
|
||||
progName );
|
||||
exit ( 1 );
|
||||
|
@ -315,7 +315,7 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
progName[BZ_MAX_FILENAME-1]='\0';
|
||||
inFileName[0] = outFileName[0] = 0;
|
||||
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"bzip2recover 1.0.8: extracts blocks from damaged .bz2 files.\n" );
|
||||
|
||||
if (argc != 2) {
|
||||
|
@ -323,18 +323,18 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
progName, progName );
|
||||
switch (sizeof(MaybeUInt64)) {
|
||||
case 8:
|
||||
(fprintf)(stderr,
|
||||
(fprintf)(stderr,
|
||||
"\trestrictions on size of recovered file: None\n");
|
||||
break;
|
||||
case 4:
|
||||
(fprintf)(stderr,
|
||||
(fprintf)(stderr,
|
||||
"\trestrictions on size of recovered file: 512 MB\n");
|
||||
(fprintf)(stderr,
|
||||
(fprintf)(stderr,
|
||||
"\tto circumvent, recompile with MaybeUInt64 as an\n"
|
||||
"\tunsigned 64-bit int.\n");
|
||||
break;
|
||||
default:
|
||||
(fprintf)(stderr,
|
||||
(fprintf)(stderr,
|
||||
"\tsizeof(MaybeUInt64) is not 4 or 8 -- "
|
||||
"configuration error.\n");
|
||||
break;
|
||||
|
@ -343,7 +343,7 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
}
|
||||
|
||||
if (strlen(argv[1]) >= BZ_MAX_FILENAME-20) {
|
||||
(fprintf) ( stderr,
|
||||
(fprintf) ( stderr,
|
||||
"%s: supplied filename is suspiciously (>= %d chars) long. Bye!\n",
|
||||
progName, (int)strlen(argv[1]) );
|
||||
exit(1);
|
||||
|
@ -375,7 +375,7 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
(bitsRead - bStart[currBlock]) >= 40) {
|
||||
bEnd[currBlock] = bitsRead-1;
|
||||
if (currBlock > 0)
|
||||
(fprintf) ( stderr, " block %d runs from " MaybeUInt64_FMT
|
||||
(fprintf) ( stderr, " block %d runs from " MaybeUInt64_FMT
|
||||
" to " MaybeUInt64_FMT " (incomplete)\n",
|
||||
currBlock, bStart[currBlock], bEnd[currBlock] );
|
||||
} else
|
||||
|
@ -384,10 +384,10 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
}
|
||||
buffHi = (buffHi << 1) | (buffLo >> 31);
|
||||
buffLo = (buffLo << 1) | (b & 1);
|
||||
if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI
|
||||
if ( ( (buffHi & 0x0000ffff) == BLOCK_HEADER_HI
|
||||
&& buffLo == BLOCK_HEADER_LO)
|
||||
||
|
||||
( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI
|
||||
||
|
||||
( (buffHi & 0x0000ffff) == BLOCK_ENDMARK_HI
|
||||
&& buffLo == BLOCK_ENDMARK_LO)
|
||||
) {
|
||||
if (bitsRead > 49) {
|
||||
|
@ -397,7 +397,7 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
}
|
||||
if (currBlock > 0 &&
|
||||
(bEnd[currBlock] - bStart[currBlock]) >= 130) {
|
||||
(fprintf) ( stderr, " block %d runs from " MaybeUInt64_FMT
|
||||
(fprintf) ( stderr, " block %d runs from " MaybeUInt64_FMT
|
||||
" to " MaybeUInt64_FMT "\n",
|
||||
rbCtr+1, bStart[currBlock], bEnd[currBlock] );
|
||||
rbStart[rbCtr] = bStart[currBlock];
|
||||
|
@ -443,7 +443,7 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
if (b == 2) break;
|
||||
buffHi = (buffHi << 1) | (buffLo >> 31);
|
||||
buffLo = (buffLo << 1) | (b & 1);
|
||||
if (bitsRead == 47+rbStart[wrBlock])
|
||||
if (bitsRead == 47+rbStart[wrBlock])
|
||||
blockCRC = (buffHi << 16) | (buffLo >> 16);
|
||||
|
||||
if (outFile != NULL && bitsRead >= rbStart[wrBlock]
|
||||
|
@ -466,11 +466,11 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
wrBlock++;
|
||||
} else
|
||||
if (bitsRead == rbStart[wrBlock]) {
|
||||
/* Create the output file name, correctly handling leading paths.
|
||||
/* Create the output file name, correctly handling leading paths.
|
||||
(31.10.2001 by Sergey E. Kusikov) */
|
||||
Char* split;
|
||||
Int32 ofs, k;
|
||||
for (k = 0; k < BZ_MAX_FILENAME; k++)
|
||||
for (k = 0; k < BZ_MAX_FILENAME; k++)
|
||||
outFileName[k] = 0;
|
||||
strcpy (outFileName, inFileName);
|
||||
split = strrchr (outFileName, BZ_SPLIT_SYM);
|
||||
|
@ -497,9 +497,9 @@ Int32 main ( Int32 argc, Char** argv )
|
|||
exit(1);
|
||||
}
|
||||
bsWr = bsOpenWriteStream ( outFile );
|
||||
bsPutUChar ( bsWr, BZ_HDR_B );
|
||||
bsPutUChar ( bsWr, BZ_HDR_Z );
|
||||
bsPutUChar ( bsWr, BZ_HDR_h );
|
||||
bsPutUChar ( bsWr, BZ_HDR_B );
|
||||
bsPutUChar ( bsWr, BZ_HDR_Z );
|
||||
bsPutUChar ( bsWr, BZ_HDR_h );
|
||||
bsPutUChar ( bsWr, BZ_HDR_0 + 9 );
|
||||
bsPutUChar ( bsWr, 0x31 ); bsPutUChar ( bsWr, 0x41 );
|
||||
bsPutUChar ( bsWr, 0x59 ); bsPutUChar ( bsWr, 0x26 );
|
||||
|
|
224
third_party/bzip2/bzlib.c
vendored
224
third_party/bzip2/bzlib.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -42,7 +42,7 @@
|
|||
#ifndef BZ_NO_STDIO
|
||||
void BZ2_bz__AssertH__fail ( int errcode )
|
||||
{
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"\n\nbzip2/libbzip2: internal error number %d.\n"
|
||||
"This is a bug in bzip2/libbzip2, %s.\n"
|
||||
"Please report it to: bzip2-devel@sourceware.org. If this happened\n"
|
||||
|
@ -147,8 +147,8 @@ Bool isempty_RL ( EState* s )
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
int BZ2_bzCompressInit
|
||||
( bz_stream* strm,
|
||||
int BZ2_bzCompressInit
|
||||
( bz_stream* strm,
|
||||
int blockSize100k,
|
||||
int verbosity,
|
||||
int workFactor )
|
||||
|
@ -158,7 +158,7 @@ int BZ2_bzCompressInit
|
|||
|
||||
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
|
||||
|
||||
if (strm == NULL ||
|
||||
if (strm == NULL ||
|
||||
blockSize100k < 1 || blockSize100k > 9 ||
|
||||
workFactor < 0 || workFactor > 250)
|
||||
return BZ_PARAM_ERROR;
|
||||
|
@ -301,7 +301,7 @@ Bool copy_input_until_stop ( EState* s )
|
|||
/*-- no input? --*/
|
||||
if (s->strm->avail_in == 0) break;
|
||||
progress_in = True;
|
||||
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
|
||||
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
|
||||
s->strm->next_in++;
|
||||
s->strm->avail_in--;
|
||||
s->strm->total_in_lo32++;
|
||||
|
@ -319,7 +319,7 @@ Bool copy_input_until_stop ( EState* s )
|
|||
/*-- flush/finish end? --*/
|
||||
if (s->avail_in_expect == 0) break;
|
||||
progress_in = True;
|
||||
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
|
||||
ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
|
||||
s->strm->next_in++;
|
||||
s->strm->avail_in--;
|
||||
s->strm->total_in_lo32++;
|
||||
|
@ -365,18 +365,18 @@ Bool handle_compress ( bz_stream* strm )
|
|||
Bool progress_in = False;
|
||||
Bool progress_out = False;
|
||||
EState* s = strm->state;
|
||||
|
||||
|
||||
while (True) {
|
||||
|
||||
if (s->state == BZ_S_OUTPUT) {
|
||||
progress_out |= copy_output_until_stop ( s );
|
||||
if (s->state_out_pos < s->numZ) break;
|
||||
if (s->mode == BZ_M_FINISHING &&
|
||||
if (s->mode == BZ_M_FINISHING &&
|
||||
s->avail_in_expect == 0 &&
|
||||
isempty_RL(s)) break;
|
||||
prepare_new_block ( s );
|
||||
s->state = BZ_S_INPUT;
|
||||
if (s->mode == BZ_M_FLUSHING &&
|
||||
if (s->mode == BZ_M_FLUSHING &&
|
||||
s->avail_in_expect == 0 &&
|
||||
isempty_RL(s)) break;
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ int BZ2_bzCompress ( bz_stream *strm, int action )
|
|||
if (action == BZ_RUN) {
|
||||
progress = handle_compress ( strm );
|
||||
return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (action == BZ_FLUSH) {
|
||||
s->avail_in_expect = strm->avail_in;
|
||||
|
@ -438,12 +438,12 @@ int BZ2_bzCompress ( bz_stream *strm, int action )
|
|||
s->mode = BZ_M_FINISHING;
|
||||
goto preswitch;
|
||||
}
|
||||
else
|
||||
else
|
||||
return BZ_PARAM_ERROR;
|
||||
|
||||
case BZ_M_FLUSHING:
|
||||
if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
|
||||
if (s->avail_in_expect != s->strm->avail_in)
|
||||
if (s->avail_in_expect != s->strm->avail_in)
|
||||
return BZ_SEQUENCE_ERROR;
|
||||
progress = handle_compress ( strm );
|
||||
if (s->avail_in_expect > 0 || !isempty_RL(s) ||
|
||||
|
@ -453,7 +453,7 @@ int BZ2_bzCompress ( bz_stream *strm, int action )
|
|||
|
||||
case BZ_M_FINISHING:
|
||||
if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
|
||||
if (s->avail_in_expect != s->strm->avail_in)
|
||||
if (s->avail_in_expect != s->strm->avail_in)
|
||||
return BZ_SEQUENCE_ERROR;
|
||||
progress = handle_compress ( strm );
|
||||
if (!progress) return BZ_SEQUENCE_ERROR;
|
||||
|
@ -480,7 +480,7 @@ int BZ2_bzCompressEnd ( bz_stream *strm )
|
|||
if (s->ftab != NULL) BZFREE(s->ftab);
|
||||
BZFREE(strm->state);
|
||||
|
||||
strm->state = NULL;
|
||||
strm->state = NULL;
|
||||
|
||||
return BZ_OK;
|
||||
}
|
||||
|
@ -491,8 +491,8 @@ int BZ2_bzCompressEnd ( bz_stream *strm )
|
|||
/*---------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
int BZ2_bzDecompressInit
|
||||
( bz_stream* strm,
|
||||
int BZ2_bzDecompressInit
|
||||
( bz_stream* strm,
|
||||
int verbosity,
|
||||
int small )
|
||||
{
|
||||
|
@ -557,34 +557,34 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
|
|||
|
||||
/* can a new run be started? */
|
||||
if (s->nblock_used == s->save_nblock+1) return False;
|
||||
|
||||
|
||||
/* Only caused by corrupt data stream? */
|
||||
if (s->nblock_used > s->save_nblock+1)
|
||||
return True;
|
||||
|
||||
|
||||
s->state_out_len = 1;
|
||||
s->state_out_ch = s->k0;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 2;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 3;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
|
||||
BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
s->state_out_len = ((Int32)k1) + 4;
|
||||
BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
|
||||
s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
|
|||
}
|
||||
s_state_out_len_eq_one:
|
||||
{
|
||||
if (cs_avail_out == 0) {
|
||||
if (cs_avail_out == 0) {
|
||||
c_state_out_len = 1; goto return_notr;
|
||||
};
|
||||
*( (UChar*)(cs_next_out) ) = c_state_out_ch;
|
||||
|
@ -630,7 +630,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
|
|||
cs_next_out++;
|
||||
cs_avail_out--;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Only caused by corrupt data stream? */
|
||||
if (c_nblock_used > s_save_nblockPP)
|
||||
return True;
|
||||
|
@ -638,25 +638,25 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
|
|||
/* can a new run be started? */
|
||||
if (c_nblock_used == s_save_nblockPP) {
|
||||
c_state_out_len = 0; goto return_notr;
|
||||
};
|
||||
};
|
||||
c_state_out_ch = c_k0;
|
||||
BZ_GET_FAST_C(k1); c_nblock_used++;
|
||||
if (k1 != c_k0) {
|
||||
c_k0 = k1; goto s_state_out_len_eq_one;
|
||||
if (k1 != c_k0) {
|
||||
c_k0 = k1; goto s_state_out_len_eq_one;
|
||||
};
|
||||
if (c_nblock_used == s_save_nblockPP)
|
||||
if (c_nblock_used == s_save_nblockPP)
|
||||
goto s_state_out_len_eq_one;
|
||||
|
||||
|
||||
c_state_out_len = 2;
|
||||
BZ_GET_FAST_C(k1); c_nblock_used++;
|
||||
if (c_nblock_used == s_save_nblockPP) continue;
|
||||
if (k1 != c_k0) { c_k0 = k1; continue; };
|
||||
|
||||
|
||||
c_state_out_len = 3;
|
||||
BZ_GET_FAST_C(k1); c_nblock_used++;
|
||||
if (c_nblock_used == s_save_nblockPP) continue;
|
||||
if (k1 != c_k0) { c_k0 = k1; continue; };
|
||||
|
||||
|
||||
BZ_GET_FAST_C(k1); c_nblock_used++;
|
||||
c_state_out_len = ((Int32)k1) + 4;
|
||||
BZ_GET_FAST_C(c_k0); c_nblock_used++;
|
||||
|
@ -724,37 +724,37 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s )
|
|||
s->strm->total_out_lo32++;
|
||||
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
|
||||
}
|
||||
|
||||
|
||||
/* can a new run be started? */
|
||||
if (s->nblock_used == s->save_nblock+1) return False;
|
||||
|
||||
/* Only caused by corrupt data stream? */
|
||||
if (s->nblock_used > s->save_nblock+1)
|
||||
return True;
|
||||
|
||||
|
||||
s->state_out_len = 1;
|
||||
s->state_out_ch = s->k0;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 2;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 3;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
|
||||
BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
|
||||
k1 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
s->state_out_len = ((Int32)k1) + 4;
|
||||
BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
|
||||
BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
|
||||
s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
|
||||
}
|
||||
|
||||
|
@ -773,30 +773,30 @@ Bool unRLE_obuf_to_output_SMALL ( DState* s )
|
|||
s->strm->total_out_lo32++;
|
||||
if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
|
||||
}
|
||||
|
||||
|
||||
/* can a new run be started? */
|
||||
if (s->nblock_used == s->save_nblock+1) return False;
|
||||
|
||||
/* Only caused by corrupt data stream? */
|
||||
if (s->nblock_used > s->save_nblock+1)
|
||||
return True;
|
||||
|
||||
|
||||
s->state_out_len = 1;
|
||||
s->state_out_ch = s->k0;
|
||||
BZ_GET_SMALL(k1); s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 2;
|
||||
BZ_GET_SMALL(k1); s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
s->state_out_len = 3;
|
||||
BZ_GET_SMALL(k1); s->nblock_used++;
|
||||
if (s->nblock_used == s->save_nblock+1) continue;
|
||||
if (k1 != s->k0) { s->k0 = k1; continue; };
|
||||
|
||||
|
||||
BZ_GET_SMALL(k1); s->nblock_used++;
|
||||
s->state_out_len = ((Int32)k1) + 4;
|
||||
BZ_GET_SMALL(s->k0); s->nblock_used++;
|
||||
|
@ -825,14 +825,14 @@ int BZ2_bzDecompress ( bz_stream *strm )
|
|||
if (corrupt) return BZ_DATA_ERROR;
|
||||
if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
|
||||
BZ_FINALISE_CRC ( s->calculatedBlockCRC );
|
||||
if (s->verbosity >= 3)
|
||||
VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC,
|
||||
if (s->verbosity >= 3)
|
||||
VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC,
|
||||
s->calculatedBlockCRC );
|
||||
if (s->verbosity >= 2) VPrintf0 ( "]" );
|
||||
if (s->calculatedBlockCRC != s->storedBlockCRC)
|
||||
return BZ_DATA_ERROR;
|
||||
s->calculatedCombinedCRC
|
||||
= (s->calculatedCombinedCRC << 1) |
|
||||
s->calculatedCombinedCRC
|
||||
= (s->calculatedCombinedCRC << 1) |
|
||||
(s->calculatedCombinedCRC >> 31);
|
||||
s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
|
||||
s->state = BZ_X_BLKHDR_1;
|
||||
|
@ -844,7 +844,7 @@ int BZ2_bzDecompress ( bz_stream *strm )
|
|||
Int32 r = BZ2_decompress ( s );
|
||||
if (r == BZ_STREAM_END) {
|
||||
if (s->verbosity >= 3)
|
||||
VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x",
|
||||
VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x",
|
||||
s->storedCombinedCRC, s->calculatedCombinedCRC );
|
||||
if (s->calculatedCombinedCRC != s->storedCombinedCRC)
|
||||
return BZ_DATA_ERROR;
|
||||
|
@ -890,7 +890,7 @@ int BZ2_bzDecompressEnd ( bz_stream *strm )
|
|||
if (bzf != NULL) bzf->lastErr = eee; \
|
||||
}
|
||||
|
||||
typedef
|
||||
typedef
|
||||
struct {
|
||||
FILE* handle;
|
||||
Char buf[BZ_MAX_UNUSED];
|
||||
|
@ -914,10 +914,10 @@ static Bool myfeof ( FILE* f )
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
BZFILE* BZ2_bzWriteOpen
|
||||
( int* bzerror,
|
||||
FILE* f,
|
||||
int blockSize100k,
|
||||
BZFILE* BZ2_bzWriteOpen
|
||||
( int* bzerror,
|
||||
FILE* f,
|
||||
int blockSize100k,
|
||||
int verbosity,
|
||||
int workFactor )
|
||||
{
|
||||
|
@ -949,23 +949,23 @@ BZFILE* BZ2_bzWriteOpen
|
|||
bzf->strm.opaque = NULL;
|
||||
|
||||
if (workFactor == 0) workFactor = 30;
|
||||
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
|
||||
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
|
||||
verbosity, workFactor );
|
||||
if (ret != BZ_OK)
|
||||
{ BZ_SETERR(ret); free(bzf); return NULL; };
|
||||
|
||||
bzf->strm.avail_in = 0;
|
||||
bzf->initialisedOk = True;
|
||||
return bzf;
|
||||
return bzf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
void BZ2_bzWrite
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void* buf,
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void* buf,
|
||||
int len )
|
||||
{
|
||||
Int32 n, n2, ret;
|
||||
|
@ -994,7 +994,7 @@ void BZ2_bzWrite
|
|||
|
||||
if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
|
||||
n = BZ_MAX_UNUSED - bzf->strm.avail_out;
|
||||
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
|
||||
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
|
||||
n, bzf->handle );
|
||||
if (n != n2 || ferror(bzf->handle))
|
||||
{ BZ_SETERR(BZ_IO_ERROR); return; };
|
||||
|
@ -1008,20 +1008,20 @@ void BZ2_bzWrite
|
|||
|
||||
/*---------------------------------------------------*/
|
||||
void BZ2_bzWriteClose
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
int abandon,
|
||||
unsigned int* nbytes_in,
|
||||
unsigned int* nbytes_out )
|
||||
{
|
||||
BZ2_bzWriteClose64 ( bzerror, b, abandon,
|
||||
BZ2_bzWriteClose64 ( bzerror, b, abandon,
|
||||
nbytes_in, NULL, nbytes_out, NULL );
|
||||
}
|
||||
|
||||
|
||||
void BZ2_bzWriteClose64
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
int abandon,
|
||||
unsigned int* nbytes_in_lo32,
|
||||
unsigned int* nbytes_in_hi32,
|
||||
|
@ -1053,7 +1053,7 @@ void BZ2_bzWriteClose64
|
|||
|
||||
if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
|
||||
n = BZ_MAX_UNUSED - bzf->strm.avail_out;
|
||||
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
|
||||
n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
|
||||
n, bzf->handle );
|
||||
if (n != n2 || ferror(bzf->handle))
|
||||
{ BZ_SETERR(BZ_IO_ERROR); return; };
|
||||
|
@ -1085,9 +1085,9 @@ void BZ2_bzWriteClose64
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
BZFILE* BZ2_bzReadOpen
|
||||
( int* bzerror,
|
||||
FILE* f,
|
||||
BZFILE* BZ2_bzReadOpen
|
||||
( int* bzerror,
|
||||
FILE* f,
|
||||
int verbosity,
|
||||
int small,
|
||||
void* unused,
|
||||
|
@ -1098,7 +1098,7 @@ BZFILE* BZ2_bzReadOpen
|
|||
|
||||
BZ_SETERR(BZ_OK);
|
||||
|
||||
if (f == NULL ||
|
||||
if (f == NULL ||
|
||||
(small != 0 && small != 1) ||
|
||||
(verbosity < 0 || verbosity > 4) ||
|
||||
(unused == NULL && nUnused != 0) ||
|
||||
|
@ -1109,7 +1109,7 @@ BZFILE* BZ2_bzReadOpen
|
|||
{ BZ_SETERR(BZ_IO_ERROR); return NULL; };
|
||||
|
||||
bzf = malloc ( sizeof(bzFile) );
|
||||
if (bzf == NULL)
|
||||
if (bzf == NULL)
|
||||
{ BZ_SETERR(BZ_MEM_ERROR); return NULL; };
|
||||
|
||||
BZ_SETERR(BZ_OK);
|
||||
|
@ -1121,7 +1121,7 @@ BZFILE* BZ2_bzReadOpen
|
|||
bzf->strm.bzalloc = NULL;
|
||||
bzf->strm.bzfree = NULL;
|
||||
bzf->strm.opaque = NULL;
|
||||
|
||||
|
||||
while (nUnused > 0) {
|
||||
bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
|
||||
unused = ((void*)( 1 + ((UChar*)(unused)) ));
|
||||
|
@ -1136,7 +1136,7 @@ BZFILE* BZ2_bzReadOpen
|
|||
bzf->strm.next_in = bzf->buf;
|
||||
|
||||
bzf->initialisedOk = True;
|
||||
return bzf;
|
||||
return bzf;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1159,10 +1159,10 @@ void BZ2_bzReadClose ( int *bzerror, BZFILE *b )
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
int BZ2_bzRead
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void* buf,
|
||||
int BZ2_bzRead
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void* buf,
|
||||
int len )
|
||||
{
|
||||
Int32 n, ret;
|
||||
|
@ -1184,11 +1184,11 @@ int BZ2_bzRead
|
|||
|
||||
while (True) {
|
||||
|
||||
if (ferror(bzf->handle))
|
||||
if (ferror(bzf->handle))
|
||||
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
|
||||
|
||||
if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
|
||||
n = fread ( bzf->buf, sizeof(UChar),
|
||||
n = fread ( bzf->buf, sizeof(UChar),
|
||||
BZ_MAX_UNUSED, bzf->handle );
|
||||
if (ferror(bzf->handle))
|
||||
{ BZ_SETERR(BZ_IO_ERROR); return 0; };
|
||||
|
@ -1202,7 +1202,7 @@ int BZ2_bzRead
|
|||
if (ret != BZ_OK && ret != BZ_STREAM_END)
|
||||
{ BZ_SETERR(ret); return 0; };
|
||||
|
||||
if (ret == BZ_OK && myfeof(bzf->handle) &&
|
||||
if (ret == BZ_OK && myfeof(bzf->handle) &&
|
||||
bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
|
||||
{ BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
|
||||
|
||||
|
@ -1211,7 +1211,7 @@ int BZ2_bzRead
|
|||
return len - bzf->strm.avail_out; };
|
||||
if (bzf->strm.avail_out == 0)
|
||||
{ BZ_SETERR(BZ_OK); return len; };
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0; /*not reached*/
|
||||
|
@ -1219,10 +1219,10 @@ int BZ2_bzRead
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
void BZ2_bzReadGetUnused
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void** unused,
|
||||
void BZ2_bzReadGetUnused
|
||||
( int* bzerror,
|
||||
BZFILE* b,
|
||||
void** unused,
|
||||
int* nUnused )
|
||||
{
|
||||
bzFile* bzf = (bzFile*)b;
|
||||
|
@ -1244,30 +1244,30 @@ void BZ2_bzReadGetUnused
|
|||
/*---------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
int BZ2_bzBuffToBuffCompress
|
||||
( char* dest,
|
||||
int BZ2_bzBuffToBuffCompress
|
||||
( char* dest,
|
||||
unsigned int* destLen,
|
||||
char* source,
|
||||
char* source,
|
||||
unsigned int sourceLen,
|
||||
int blockSize100k,
|
||||
int verbosity,
|
||||
int blockSize100k,
|
||||
int verbosity,
|
||||
int workFactor )
|
||||
{
|
||||
bz_stream strm;
|
||||
int ret;
|
||||
|
||||
if (dest == NULL || destLen == NULL ||
|
||||
if (dest == NULL || destLen == NULL ||
|
||||
source == NULL ||
|
||||
blockSize100k < 1 || blockSize100k > 9 ||
|
||||
verbosity < 0 || verbosity > 4 ||
|
||||
workFactor < 0 || workFactor > 250)
|
||||
workFactor < 0 || workFactor > 250)
|
||||
return BZ_PARAM_ERROR;
|
||||
|
||||
if (workFactor == 0) workFactor = 30;
|
||||
strm.bzalloc = NULL;
|
||||
strm.bzfree = NULL;
|
||||
strm.opaque = NULL;
|
||||
ret = BZ2_bzCompressInit ( &strm, blockSize100k,
|
||||
ret = BZ2_bzCompressInit ( &strm, blockSize100k,
|
||||
verbosity, workFactor );
|
||||
if (ret != BZ_OK) return ret;
|
||||
|
||||
|
@ -1281,7 +1281,7 @@ int BZ2_bzBuffToBuffCompress
|
|||
if (ret != BZ_STREAM_END) goto errhandler;
|
||||
|
||||
/* normal termination */
|
||||
*destLen -= strm.avail_out;
|
||||
*destLen -= strm.avail_out;
|
||||
BZ2_bzCompressEnd ( &strm );
|
||||
return BZ_OK;
|
||||
|
||||
|
@ -1296,10 +1296,10 @@ int BZ2_bzBuffToBuffCompress
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
int BZ2_bzBuffToBuffDecompress
|
||||
( char* dest,
|
||||
int BZ2_bzBuffToBuffDecompress
|
||||
( char* dest,
|
||||
unsigned int* destLen,
|
||||
char* source,
|
||||
char* source,
|
||||
unsigned int sourceLen,
|
||||
int small,
|
||||
int verbosity )
|
||||
|
@ -1307,10 +1307,10 @@ int BZ2_bzBuffToBuffDecompress
|
|||
bz_stream strm;
|
||||
int ret;
|
||||
|
||||
if (dest == NULL || destLen == NULL ||
|
||||
if (dest == NULL || destLen == NULL ||
|
||||
source == NULL ||
|
||||
(small != 0 && small != 1) ||
|
||||
verbosity < 0 || verbosity > 4)
|
||||
verbosity < 0 || verbosity > 4)
|
||||
return BZ_PARAM_ERROR;
|
||||
|
||||
strm.bzalloc = NULL;
|
||||
|
@ -1340,11 +1340,11 @@ int BZ2_bzBuffToBuffDecompress
|
|||
} else {
|
||||
BZ2_bzDecompressEnd ( &strm );
|
||||
return BZ_OUTBUFF_FULL;
|
||||
};
|
||||
};
|
||||
|
||||
errhandler:
|
||||
BZ2_bzDecompressEnd ( &strm );
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ BZFILE * bzopen_or_bzdopen
|
|||
int verbosity = 0;
|
||||
int workFactor = 30;
|
||||
int smallMode = 0;
|
||||
int nUnused = 0;
|
||||
int nUnused = 0;
|
||||
|
||||
if (mode == NULL) return NULL;
|
||||
while (*mode) {
|
||||
|
@ -1436,7 +1436,7 @@ BZFILE * bzopen_or_bzdopen
|
|||
if (writing) {
|
||||
/* Guard against total chaos and anarchy -- JRS */
|
||||
if (blockSize100k < 1) blockSize100k = 1;
|
||||
if (blockSize100k > 9) blockSize100k = 9;
|
||||
if (blockSize100k > 9) blockSize100k = 9;
|
||||
bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
|
||||
verbosity,workFactor);
|
||||
} else {
|
||||
|
@ -1515,7 +1515,7 @@ void BZ2_bzclose (BZFILE* b)
|
|||
{
|
||||
int bzerr;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
if (b==NULL) {return;}
|
||||
fp = ((bzFile *)b)->handle;
|
||||
if(((bzFile*)b)->writing){
|
||||
|
@ -1534,7 +1534,7 @@ void BZ2_bzclose (BZFILE* b)
|
|||
|
||||
/*---------------------------------------------------*/
|
||||
/*--
|
||||
return last error code
|
||||
return last error code
|
||||
--*/
|
||||
static const char *bzerrorstrings[] = {
|
||||
"OK"
|
||||
|
|
24
third_party/bzip2/bzlib_private.inc
vendored
24
third_party/bzip2/bzlib_private.inc
vendored
|
@ -16,7 +16,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -40,7 +40,7 @@ typedef unsigned short UInt16;
|
|||
|
||||
#ifndef __GNUC__
|
||||
#define __inline__ /* */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef BZ_NO_STDIO
|
||||
|
||||
|
@ -98,7 +98,7 @@ extern void bz_internal_error ( int errcode );
|
|||
#define BZ_HDR_Z 0x5a /* 'Z' */
|
||||
#define BZ_HDR_h 0x68 /* 'h' */
|
||||
#define BZ_HDR_0 0x30 /* '0' */
|
||||
|
||||
|
||||
/*-- Constants for the back end. --*/
|
||||
|
||||
#define BZ_MAX_ALPHA_SIZE 258
|
||||
|
@ -258,19 +258,19 @@ typedef
|
|||
|
||||
/*-- externs for compression. --*/
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_blockSort ( EState* );
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_compressBlock ( EState*, Bool );
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_bsInitWrite ( EState* );
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
|
||||
|
||||
|
||||
|
@ -414,7 +414,7 @@ typedef
|
|||
Int32 save_N;
|
||||
Int32 save_curr;
|
||||
Int32 save_zt;
|
||||
Int32 save_zn;
|
||||
Int32 save_zn;
|
||||
Int32 save_zvec;
|
||||
Int32 save_zj;
|
||||
Int32 save_gSel;
|
||||
|
@ -470,12 +470,12 @@ typedef
|
|||
|
||||
/*-- externs for decompression. --*/
|
||||
|
||||
extern Int32
|
||||
extern Int32
|
||||
BZ2_indexIntoF ( Int32, Int32* );
|
||||
|
||||
extern Int32
|
||||
extern Int32
|
||||
BZ2_decompress ( DState* );
|
||||
|
||||
extern void
|
||||
extern void
|
||||
BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
|
||||
Int32, Int32, Int32 );
|
||||
|
|
4
third_party/bzip2/bzmore
vendored
4
third_party/bzip2/bzmore
vendored
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Bzmore wrapped for bzip2,
|
||||
# Bzmore wrapped for bzip2,
|
||||
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
|
||||
|
||||
PATH="/usr/bin:$PATH"; export PATH
|
||||
|
@ -43,7 +43,7 @@ else
|
|||
if test $FIRST -eq 0; then
|
||||
echo $n1 "--More--(Next file: $FILE)$n2"
|
||||
stty $cb -echo 2>/dev/null
|
||||
ANS=`dd bs=1 count=1 2>/dev/null`
|
||||
ANS=`dd bs=1 count=1 2>/dev/null`
|
||||
stty $ncb echo 2>/dev/null
|
||||
echo " "
|
||||
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
|
||||
|
|
8
third_party/bzip2/bzmore.1
vendored
8
third_party/bzip2/bzmore.1
vendored
|
@ -78,15 +78,15 @@ skip \fIi\fP screenfuls and print a screenful of lines
|
|||
quit reading the current file; go on to the next (if any)
|
||||
.PP
|
||||
.IP "e or q"
|
||||
When the prompt --More--(Next file:
|
||||
When the prompt --More--(Next file:
|
||||
.IR file )
|
||||
is printed, this command causes bzmore to exit.
|
||||
.PP
|
||||
.IP s
|
||||
When the prompt --More--(Next file:
|
||||
When the prompt --More--(Next file:
|
||||
.IR file )
|
||||
is printed, this command causes bzmore to skip the next file and continue.
|
||||
.PP
|
||||
.PP
|
||||
.IP =
|
||||
Display the current line number.
|
||||
.PP
|
||||
|
@ -105,7 +105,7 @@ Erasing back past the first column cancels the search command.
|
|||
search for the \fIi\|\fP-th occurrence of the last regular expression entered.
|
||||
.PP
|
||||
.IP !command
|
||||
invoke a shell with \fIcommand\|\fP.
|
||||
invoke a shell with \fIcommand\|\fP.
|
||||
The character `!' in "command" are replaced with the
|
||||
previous shell command. The sequence "\\!" is replaced by "!".
|
||||
.PP
|
||||
|
|
86
third_party/bzip2/compress.c
vendored
86
third_party/bzip2/compress.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -23,7 +23,7 @@
|
|||
/* CHANGES
|
||||
0.9.0 -- original version.
|
||||
0.9.0a/b -- no changes in this file.
|
||||
0.9.0c -- changed setting of nGroups in sendMTFValues()
|
||||
0.9.0c -- changed setting of nGroups in sendMTFValues()
|
||||
so as to do a bit better on small files
|
||||
*/
|
||||
|
||||
|
@ -126,11 +126,11 @@ void generateMTFValues ( EState* s )
|
|||
Int32 wr;
|
||||
Int32 EOB;
|
||||
|
||||
/*
|
||||
/*
|
||||
After sorting (eg, here),
|
||||
s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
|
||||
and
|
||||
((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
|
||||
((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
|
||||
holds the original block data.
|
||||
|
||||
The first thing to do is generate the MTF values,
|
||||
|
@ -145,7 +145,7 @@ void generateMTFValues ( EState* s )
|
|||
(UChar*) (&((UChar*)s->arr2)[s->nblock])
|
||||
|
||||
These storage aliases are set up in bzCompressInit(),
|
||||
except for the last one, which is arranged in
|
||||
except for the last one, which is arranged in
|
||||
compressBlock().
|
||||
*/
|
||||
UInt32* ptr = s->ptr;
|
||||
|
@ -168,7 +168,7 @@ void generateMTFValues ( EState* s )
|
|||
ll_i = s->unseqToSeq[block[j]];
|
||||
AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
|
||||
|
||||
if (yy[0] == ll_i) {
|
||||
if (yy[0] == ll_i) {
|
||||
zPend++;
|
||||
} else {
|
||||
|
||||
|
@ -176,11 +176,11 @@ void generateMTFValues ( EState* s )
|
|||
zPend--;
|
||||
while (True) {
|
||||
if (zPend & 1) {
|
||||
mtfv[wr] = BZ_RUNB; wr++;
|
||||
s->mtfFreq[BZ_RUNB]++;
|
||||
mtfv[wr] = BZ_RUNB; wr++;
|
||||
s->mtfFreq[BZ_RUNB]++;
|
||||
} else {
|
||||
mtfv[wr] = BZ_RUNA; wr++;
|
||||
s->mtfFreq[BZ_RUNA]++;
|
||||
mtfv[wr] = BZ_RUNA; wr++;
|
||||
s->mtfFreq[BZ_RUNA]++;
|
||||
}
|
||||
if (zPend < 2) break;
|
||||
zPend = (zPend - 2) / 2;
|
||||
|
@ -214,11 +214,11 @@ void generateMTFValues ( EState* s )
|
|||
zPend--;
|
||||
while (True) {
|
||||
if (zPend & 1) {
|
||||
mtfv[wr] = BZ_RUNB; wr++;
|
||||
s->mtfFreq[BZ_RUNB]++;
|
||||
mtfv[wr] = BZ_RUNB; wr++;
|
||||
s->mtfFreq[BZ_RUNB]++;
|
||||
} else {
|
||||
mtfv[wr] = BZ_RUNA; wr++;
|
||||
s->mtfFreq[BZ_RUNA]++;
|
||||
mtfv[wr] = BZ_RUNA; wr++;
|
||||
s->mtfFreq[BZ_RUNA]++;
|
||||
}
|
||||
if (zPend < 2) break;
|
||||
zPend = (zPend - 2) / 2;
|
||||
|
@ -261,7 +261,7 @@ void sendMTFValues ( EState* s )
|
|||
|
||||
if (s->verbosity >= 3)
|
||||
VPrintf3( " %d in block, %d after MTF & 1-2 coding, "
|
||||
"%d+2 syms in use\n",
|
||||
"%d+2 syms in use\n",
|
||||
s->nblock, s->nMTF, s->nInUse );
|
||||
|
||||
alphaSize = s->nInUse+2;
|
||||
|
@ -278,7 +278,7 @@ void sendMTFValues ( EState* s )
|
|||
nGroups = 6;
|
||||
|
||||
/*--- Generate an initial set of coding tables ---*/
|
||||
{
|
||||
{
|
||||
Int32 nPart, remF, tFreq, aFreq;
|
||||
|
||||
nPart = nGroups;
|
||||
|
@ -293,8 +293,8 @@ void sendMTFValues ( EState* s )
|
|||
aFreq += s->mtfFreq[ge];
|
||||
}
|
||||
|
||||
if (ge > gs
|
||||
&& nPart != nGroups && nPart != 1
|
||||
if (ge > gs
|
||||
&& nPart != nGroups && nPart != 1
|
||||
&& ((nGroups-nPart) % 2 == 1)) {
|
||||
aFreq -= s->mtfFreq[ge];
|
||||
ge--;
|
||||
|
@ -303,21 +303,21 @@ void sendMTFValues ( EState* s )
|
|||
if (s->verbosity >= 3)
|
||||
VPrintf5( " initial group %d, [%d .. %d], "
|
||||
"has %d syms (%4.1f%%)\n",
|
||||
nPart, gs, ge, aFreq,
|
||||
nPart, gs, ge, aFreq,
|
||||
(100.0 * (float)aFreq) / (float)(s->nMTF) );
|
||||
|
||||
|
||||
for (v = 0; v < alphaSize; v++)
|
||||
if (v >= gs && v <= ge)
|
||||
if (v >= gs && v <= ge)
|
||||
s->len[nPart-1][v] = BZ_LESSER_ICOST; else
|
||||
s->len[nPart-1][v] = BZ_GREATER_ICOST;
|
||||
|
||||
|
||||
nPart--;
|
||||
gs = ge+1;
|
||||
remF -= aFreq;
|
||||
}
|
||||
}
|
||||
|
||||
/*---
|
||||
/*---
|
||||
Iterate up to BZ_N_ITERS times to improve the tables.
|
||||
---*/
|
||||
for (iter = 0; iter < BZ_N_ITERS; iter++) {
|
||||
|
@ -330,7 +330,7 @@ void sendMTFValues ( EState* s )
|
|||
|
||||
/*---
|
||||
Set up an auxiliary length table which is used to fast-track
|
||||
the common case (nGroups == 6).
|
||||
the common case (nGroups == 6).
|
||||
---*/
|
||||
if (nGroups == 6) {
|
||||
for (v = 0; v < alphaSize; v++) {
|
||||
|
@ -347,10 +347,10 @@ void sendMTFValues ( EState* s )
|
|||
|
||||
/*--- Set group start & end marks. --*/
|
||||
if (gs >= s->nMTF) break;
|
||||
ge = gs + BZ_G_SIZE - 1;
|
||||
ge = gs + BZ_G_SIZE - 1;
|
||||
if (ge >= s->nMTF) ge = s->nMTF-1;
|
||||
|
||||
/*--
|
||||
/*--
|
||||
Calculate the cost of this group as coded
|
||||
by each of the coding tables.
|
||||
--*/
|
||||
|
@ -387,13 +387,13 @@ void sendMTFValues ( EState* s )
|
|||
|
||||
} else {
|
||||
/*--- slow version which correctly handles all situations ---*/
|
||||
for (i = gs; i <= ge; i++) {
|
||||
for (i = gs; i <= ge; i++) {
|
||||
UInt16 icv = mtfv[i];
|
||||
for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
|
||||
}
|
||||
}
|
||||
|
||||
/*--
|
||||
|
||||
/*--
|
||||
Find the coding table which is best for this group,
|
||||
and record its identity in the selector table.
|
||||
--*/
|
||||
|
@ -405,7 +405,7 @@ void sendMTFValues ( EState* s )
|
|||
s->selector[nSelectors] = bt;
|
||||
nSelectors++;
|
||||
|
||||
/*--
|
||||
/*--
|
||||
Increment the symbol frequencies for the selected table.
|
||||
--*/
|
||||
if (nGroups == 6 && 50 == ge-gs+1) {
|
||||
|
@ -435,7 +435,7 @@ void sendMTFValues ( EState* s )
|
|||
gs = ge+1;
|
||||
}
|
||||
if (s->verbosity >= 3) {
|
||||
VPrintf2 ( " pass %d: size is %d, grp uses are ",
|
||||
VPrintf2 ( " pass %d: size is %d, grp uses are ",
|
||||
iter+1, totc/8 );
|
||||
for (t = 0; t < nGroups; t++)
|
||||
VPrintf1 ( "%d ", fave[t] );
|
||||
|
@ -445,10 +445,10 @@ void sendMTFValues ( EState* s )
|
|||
/*--
|
||||
Recompute the tables based on the accumulated frequencies.
|
||||
--*/
|
||||
/* maxLen was changed from 20 to 17 in bzip2-1.0.3. See
|
||||
/* maxLen was changed from 20 to 17 in bzip2-1.0.3. See
|
||||
comment in huffman.c for details. */
|
||||
for (t = 0; t < nGroups; t++)
|
||||
BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
|
||||
BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
|
||||
alphaSize, 17 /*20*/ );
|
||||
}
|
||||
|
||||
|
@ -488,19 +488,19 @@ void sendMTFValues ( EState* s )
|
|||
}
|
||||
AssertH ( !(maxLen > 17 /*20*/ ), 3004 );
|
||||
AssertH ( !(minLen < 1), 3005 );
|
||||
BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
|
||||
BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
|
||||
minLen, maxLen, alphaSize );
|
||||
}
|
||||
|
||||
/*--- Transmit the mapping table. ---*/
|
||||
{
|
||||
{
|
||||
Bool inUse16[16];
|
||||
for (i = 0; i < 16; i++) {
|
||||
inUse16[i] = False;
|
||||
for (j = 0; j < 16; j++)
|
||||
if (s->inUse[i * 16 + j]) inUse16[i] = True;
|
||||
}
|
||||
|
||||
|
||||
nBytes = s->numZ;
|
||||
for (i = 0; i < 16; i++)
|
||||
if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
|
||||
|
@ -511,7 +511,7 @@ void sendMTFValues ( EState* s )
|
|||
if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
|
||||
}
|
||||
|
||||
if (s->verbosity >= 3)
|
||||
if (s->verbosity >= 3)
|
||||
VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes );
|
||||
}
|
||||
|
||||
|
@ -519,7 +519,7 @@ void sendMTFValues ( EState* s )
|
|||
nBytes = s->numZ;
|
||||
bsW ( s, 3, nGroups );
|
||||
bsW ( s, 15, nSelectors );
|
||||
for (i = 0; i < nSelectors; i++) {
|
||||
for (i = 0; i < nSelectors; i++) {
|
||||
for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
|
||||
bsW(s,1,0);
|
||||
}
|
||||
|
@ -548,14 +548,14 @@ void sendMTFValues ( EState* s )
|
|||
gs = 0;
|
||||
while (True) {
|
||||
if (gs >= s->nMTF) break;
|
||||
ge = gs + BZ_G_SIZE - 1;
|
||||
ge = gs + BZ_G_SIZE - 1;
|
||||
if (ge >= s->nMTF) ge = s->nMTF-1;
|
||||
AssertH ( s->selector[selCtr] < nGroups, 3006 );
|
||||
|
||||
if (nGroups == 6 && 50 == ge-gs+1) {
|
||||
/*--- fast track the common case ---*/
|
||||
UInt16 mtfv_i;
|
||||
UChar* s_len_sel_selCtr
|
||||
UChar* s_len_sel_selCtr
|
||||
= &(s->len[s->selector[selCtr]][0]);
|
||||
Int32* s_code_sel_selCtr
|
||||
= &(s->code[s->selector[selCtr]][0]);
|
||||
|
@ -582,7 +582,7 @@ void sendMTFValues ( EState* s )
|
|||
} else {
|
||||
/*--- slow version which correctly handles all situations ---*/
|
||||
for (i = gs; i <= ge; i++) {
|
||||
bsW ( s,
|
||||
bsW ( s,
|
||||
s->len [s->selector[selCtr]] [mtfv[i]],
|
||||
s->code [s->selector[selCtr]] [mtfv[i]] );
|
||||
}
|
||||
|
@ -637,8 +637,8 @@ void BZ2_compressBlock ( EState* s, Bool is_last_block )
|
|||
/*-- Now the block's CRC, so it is in a known place. --*/
|
||||
bsPutUInt32 ( s, s->blockCRC );
|
||||
|
||||
/*--
|
||||
Now a single bit indicating (non-)randomisation.
|
||||
/*--
|
||||
Now a single bit indicating (non-)randomisation.
|
||||
As of version 0.9.5, we use a better sorting algorithm
|
||||
which makes randomisation unnecessary. So always set
|
||||
the randomised bit to 'no'. Of course, the decoder
|
||||
|
|
48
third_party/bzip2/decompress.c
vendored
48
third_party/bzip2/decompress.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -128,7 +128,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
Int32 N;
|
||||
Int32 curr;
|
||||
Int32 zt;
|
||||
Int32 zn;
|
||||
Int32 zn;
|
||||
Int32 zvec;
|
||||
Int32 zj;
|
||||
Int32 gSel;
|
||||
|
@ -182,7 +182,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
N = s->save_N;
|
||||
curr = s->save_curr;
|
||||
zt = s->save_zt;
|
||||
zn = s->save_zn;
|
||||
zn = s->save_zn;
|
||||
zvec = s->save_zvec;
|
||||
zj = s->save_zj;
|
||||
gSel = s->save_gSel;
|
||||
|
@ -205,14 +205,14 @@ Int32 BZ2_decompress ( DState* s )
|
|||
if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);
|
||||
|
||||
GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
|
||||
if (s->blockSize100k < (BZ_HDR_0 + 1) ||
|
||||
if (s->blockSize100k < (BZ_HDR_0 + 1) ||
|
||||
s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);
|
||||
s->blockSize100k -= BZ_HDR_0;
|
||||
|
||||
if (s->smallDecompress) {
|
||||
s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
|
||||
s->ll4 = BZALLOC(
|
||||
((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
|
||||
s->ll4 = BZALLOC(
|
||||
((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
|
||||
);
|
||||
if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
|
||||
} else {
|
||||
|
@ -238,7 +238,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
s->currBlockNo++;
|
||||
if (s->verbosity >= 2)
|
||||
VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
|
||||
|
||||
|
||||
s->storedBlockCRC = 0;
|
||||
GET_UCHAR(BZ_X_BCRC_1, uc);
|
||||
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
|
||||
|
@ -261,14 +261,14 @@ Int32 BZ2_decompress ( DState* s )
|
|||
|
||||
if (s->origPtr < 0)
|
||||
RETURN(BZ_DATA_ERROR);
|
||||
if (s->origPtr > 10 + 100000*s->blockSize100k)
|
||||
if (s->origPtr > 10 + 100000*s->blockSize100k)
|
||||
RETURN(BZ_DATA_ERROR);
|
||||
|
||||
/*--- Receive the mapping table ---*/
|
||||
for (i = 0; i < 16; i++) {
|
||||
GET_BIT(BZ_X_MAPPING_1, uc);
|
||||
if (uc == 1)
|
||||
s->inUse16[i] = True; else
|
||||
if (uc == 1)
|
||||
s->inUse16[i] = True; else
|
||||
s->inUse16[i] = False;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
{
|
||||
UChar pos[BZ_N_GROUPS], tmp, v;
|
||||
for (v = 0; v < nGroups; v++) pos[v] = v;
|
||||
|
||||
|
||||
for (i = 0; i < nSelectors; i++) {
|
||||
v = s->selectorMtf[i];
|
||||
tmp = pos[v];
|
||||
|
@ -343,10 +343,10 @@ Int32 BZ2_decompress ( DState* s )
|
|||
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
|
||||
if (s->len[t][i] < minLen) minLen = s->len[t][i];
|
||||
}
|
||||
BZ2_hbCreateDecodeTables (
|
||||
&(s->limit[t][0]),
|
||||
&(s->base[t][0]),
|
||||
&(s->perm[t][0]),
|
||||
BZ2_hbCreateDecodeTables (
|
||||
&(s->limit[t][0]),
|
||||
&(s->base[t][0]),
|
||||
&(s->perm[t][0]),
|
||||
&(s->len[t][0]),
|
||||
minLen, maxLen, alphaSize
|
||||
);
|
||||
|
@ -445,23 +445,23 @@ Int32 BZ2_decompress ( DState* s )
|
|||
s->mtfa[(z)-3] = s->mtfa[(z)-4];
|
||||
nn -= 4;
|
||||
}
|
||||
while (nn > 0) {
|
||||
s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
|
||||
while (nn > 0) {
|
||||
s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
|
||||
};
|
||||
s->mtfa[pp] = uc;
|
||||
} else {
|
||||
} else {
|
||||
/* general case */
|
||||
lno = nn / MTFL_SIZE;
|
||||
off = nn % MTFL_SIZE;
|
||||
pp = s->mtfbase[lno] + off;
|
||||
uc = s->mtfa[pp];
|
||||
while (pp > s->mtfbase[lno]) {
|
||||
s->mtfa[pp] = s->mtfa[pp-1]; pp--;
|
||||
while (pp > s->mtfbase[lno]) {
|
||||
s->mtfa[pp] = s->mtfa[pp-1]; pp--;
|
||||
};
|
||||
s->mtfbase[lno]++;
|
||||
while (lno > 0) {
|
||||
s->mtfbase[lno]--;
|
||||
s->mtfa[s->mtfbase[lno]]
|
||||
s->mtfa[s->mtfbase[lno]]
|
||||
= s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
|
||||
lno--;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
if (s->blockRandomised) {
|
||||
BZ_RAND_INIT_MASK;
|
||||
BZ_GET_SMALL(s->k0); s->nblock_used++;
|
||||
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
|
||||
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
|
||||
} else {
|
||||
BZ_GET_SMALL(s->k0); s->nblock_used++;
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
if (s->blockRandomised) {
|
||||
BZ_RAND_INIT_MASK;
|
||||
BZ_GET_FAST(s->k0); s->nblock_used++;
|
||||
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
|
||||
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
|
||||
} else {
|
||||
BZ_GET_FAST(s->k0); s->nblock_used++;
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ Int32 BZ2_decompress ( DState* s )
|
|||
s->save_gBase = gBase;
|
||||
s->save_gPerm = gPerm;
|
||||
|
||||
return retVal;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
|
|
6
third_party/bzip2/format.pl
vendored
6
third_party/bzip2/format.pl
vendored
|
@ -7,7 +7,7 @@
|
|||
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
#
|
||||
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
# README file.
|
||||
#
|
||||
# This program is released under the terms of the license contained
|
||||
|
@ -30,14 +30,14 @@ if (! -r $infile) {
|
|||
die "Can't read input $infile\n";
|
||||
}
|
||||
# check we can open infile
|
||||
open( INFILE,"<$infile" ) or
|
||||
open( INFILE,"<$infile" ) or
|
||||
die "Can't input $infile $!";
|
||||
|
||||
#my $outfile = 'fmt-manual.xml';
|
||||
my $outfile = shift;
|
||||
#print "Infile: $infile, Outfile: $outfile\n";
|
||||
# check we can write to outfile
|
||||
open( OUTFILE,">$outfile" ) or
|
||||
open( OUTFILE,">$outfile" ) or
|
||||
die "Can't output $outfile $! for writing";
|
||||
|
||||
my ($prev, $curr, $str);
|
||||
|
|
8
third_party/bzip2/huffman.c
vendored
8
third_party/bzip2/huffman.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
void BZ2_hbMakeCodeLengths ( UChar *len,
|
||||
void BZ2_hbMakeCodeLengths ( UChar *len,
|
||||
Int32 *freq,
|
||||
Int32 alphaSize,
|
||||
Int32 maxLen )
|
||||
|
@ -99,7 +99,7 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
|
|||
}
|
||||
|
||||
AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
|
||||
|
||||
|
||||
while (nHeap > 1) {
|
||||
n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
|
||||
n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
|
||||
|
@ -122,7 +122,7 @@ void BZ2_hbMakeCodeLengths ( UChar *len,
|
|||
len[i-1] = j;
|
||||
if (j > maxLen) tooLong = True;
|
||||
}
|
||||
|
||||
|
||||
if (! tooLong) break;
|
||||
|
||||
/* 17 Oct 04: keep-going condition for the following loop used
|
||||
|
|
106
third_party/bzip2/randtable.c
vendored
106
third_party/bzip2/randtable.c
vendored
|
@ -12,7 +12,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
@ -24,58 +24,58 @@
|
|||
|
||||
|
||||
/*---------------------------------------------*/
|
||||
Int32 BZ2_rNums[512] = {
|
||||
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
|
||||
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
|
||||
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
|
||||
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
|
||||
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
|
||||
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
|
||||
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
|
||||
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
|
||||
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
|
||||
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
|
||||
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
|
||||
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
|
||||
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
|
||||
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
|
||||
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
|
||||
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
|
||||
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
|
||||
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
|
||||
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
|
||||
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
|
||||
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
|
||||
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
|
||||
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
|
||||
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
|
||||
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
|
||||
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
|
||||
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
|
||||
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
|
||||
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
|
||||
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
|
||||
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
|
||||
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
|
||||
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
|
||||
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
|
||||
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
|
||||
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
|
||||
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
|
||||
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
|
||||
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
|
||||
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
|
||||
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
|
||||
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
|
||||
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
|
||||
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
|
||||
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
|
||||
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
|
||||
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
|
||||
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
|
||||
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
|
||||
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
|
||||
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
|
||||
Int32 BZ2_rNums[512] = {
|
||||
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
|
||||
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
|
||||
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
|
||||
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
|
||||
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
|
||||
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
|
||||
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
|
||||
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
|
||||
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
|
||||
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
|
||||
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
|
||||
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
|
||||
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
|
||||
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
|
||||
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
|
||||
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
|
||||
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
|
||||
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
|
||||
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
|
||||
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
|
||||
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
|
||||
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
|
||||
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
|
||||
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
|
||||
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
|
||||
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
|
||||
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
|
||||
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
|
||||
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
|
||||
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
|
||||
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
|
||||
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
|
||||
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
|
||||
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
|
||||
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
|
||||
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
|
||||
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
|
||||
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
|
||||
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
|
||||
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
|
||||
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
|
||||
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
|
||||
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
|
||||
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
|
||||
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
|
||||
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
|
||||
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
|
||||
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
|
||||
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
|
||||
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
|
||||
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
|
||||
936, 638
|
||||
};
|
||||
|
||||
|
|
4
third_party/bzip2/spewG.c
vendored
4
third_party/bzip2/spewG.c
vendored
|
@ -7,7 +7,7 @@
|
|||
support for large files (> 2GB) in a reasonable amount of time.
|
||||
I suggest you use the undocumented --exponential option to
|
||||
bzip2 when compressing the resulting file; this saves a bit of
|
||||
time. Note: *don't* bother with --exponential when compressing
|
||||
time. Note: *don't* bother with --exponential when compressing
|
||||
Real Files; it'll just waste a lot of CPU time :-)
|
||||
(but is otherwise harmless).
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@
|
|||
bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
||||
Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
||||
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
||||
README file.
|
||||
|
||||
This program is released under the terms of the license contained
|
||||
|
|
2
third_party/bzip2/words1
vendored
2
third_party/bzip2/words1
vendored
|
@ -1,4 +1,4 @@
|
|||
|
||||
Doing 6 tests (3 compress, 3 uncompress) ...
|
||||
If there's a problem, things might stop at this point.
|
||||
|
||||
|
||||
|
|
10
third_party/bzip2/words3
vendored
10
third_party/bzip2/words3
vendored
|
@ -1,13 +1,13 @@
|
|||
|
||||
If you got this far and the 'cmp's didn't complain, it looks
|
||||
like you're in business.
|
||||
like you're in business.
|
||||
|
||||
To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
|
||||
To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
|
||||
/usr/local/include, type
|
||||
|
||||
make install
|
||||
|
||||
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
|
||||
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
|
||||
|
||||
make install PREFIX=/xxx/yyy
|
||||
|
||||
|
@ -21,10 +21,10 @@ The -n instructs make to show the commands it would execute, but
|
|||
not actually execute them.
|
||||
|
||||
Instructions for use are in the preformatted manual page, in the file
|
||||
bzip2.txt. For more detailed documentation, read the full manual.
|
||||
bzip2.txt. For more detailed documentation, read the full manual.
|
||||
It is available in Postscript form (manual.ps), PDF form (manual.pdf),
|
||||
and HTML form (manual.html).
|
||||
|
||||
You can also do "bzip2 --help" to see some helpful information.
|
||||
You can also do "bzip2 --help" to see some helpful information.
|
||||
"bzip2 -L" displays the software license.
|
||||
|
||||
|
|
2
third_party/compiler_rt/absvdi2.c
vendored
2
third_party/compiler_rt/absvdi2.c
vendored
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
STATIC_YOINK("huge_compiler_rt_license");
|
||||
|
||||
|
||||
#include "third_party/compiler_rt/int_lib.h"
|
||||
|
||||
/* Returns: absolute value */
|
||||
|
|
2
third_party/compiler_rt/absvsi2.c
vendored
2
third_party/compiler_rt/absvsi2.c
vendored
|
@ -14,7 +14,7 @@
|
|||
*/
|
||||
|
||||
STATIC_YOINK("huge_compiler_rt_license");
|
||||
|
||||
|
||||
#include "third_party/compiler_rt/int_lib.h"
|
||||
|
||||
/* Returns: absolute value */
|
||||
|
|
14
third_party/compiler_rt/comparedf2.c
vendored
14
third_party/compiler_rt/comparedf2.c
vendored
|
@ -52,18 +52,18 @@ enum LE_RESULT {
|
|||
|
||||
COMPILER_RT_ABI enum LE_RESULT
|
||||
__ledf2(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const srep_t aInt = toRep(a);
|
||||
const srep_t bInt = toRep(b);
|
||||
const rep_t aAbs = aInt & absMask;
|
||||
const rep_t bAbs = bInt & absMask;
|
||||
|
||||
|
||||
// If either a or b is NaN, they are unordered.
|
||||
if (aAbs > infRep || bAbs > infRep) return LE_UNORDERED;
|
||||
|
||||
|
||||
// If a and b are both zeros, they are equal.
|
||||
if ((aAbs | bAbs) == 0) return LE_EQUAL;
|
||||
|
||||
|
||||
// If at least one of a and b is positive, we get the same result comparing
|
||||
// a and b as signed integers as we would with a floating-point compare.
|
||||
if ((aInt & bInt) >= 0) {
|
||||
|
@ -71,7 +71,7 @@ __ledf2(fp_t a, fp_t b) {
|
|||
else if (aInt == bInt) return LE_EQUAL;
|
||||
else return LE_GREATER;
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, both are negative, so we need to flip the sense of the
|
||||
// comparison to get the correct result. (This assumes a twos- or ones-
|
||||
// complement integer representation; if integers are represented in a
|
||||
|
@ -98,12 +98,12 @@ enum GE_RESULT {
|
|||
|
||||
COMPILER_RT_ABI enum GE_RESULT
|
||||
__gedf2(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const srep_t aInt = toRep(a);
|
||||
const srep_t bInt = toRep(b);
|
||||
const rep_t aAbs = aInt & absMask;
|
||||
const rep_t bAbs = bInt & absMask;
|
||||
|
||||
|
||||
if (aAbs > infRep || bAbs > infRep) return GE_UNORDERED;
|
||||
if ((aAbs | bAbs) == 0) return GE_EQUAL;
|
||||
if ((aInt & bInt) >= 0) {
|
||||
|
|
14
third_party/compiler_rt/comparesf2.c
vendored
14
third_party/compiler_rt/comparesf2.c
vendored
|
@ -52,18 +52,18 @@ enum LE_RESULT {
|
|||
|
||||
COMPILER_RT_ABI enum LE_RESULT
|
||||
__lesf2(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const srep_t aInt = toRep(a);
|
||||
const srep_t bInt = toRep(b);
|
||||
const rep_t aAbs = aInt & absMask;
|
||||
const rep_t bAbs = bInt & absMask;
|
||||
|
||||
|
||||
// If either a or b is NaN, they are unordered.
|
||||
if (aAbs > infRep || bAbs > infRep) return LE_UNORDERED;
|
||||
|
||||
|
||||
// If a and b are both zeros, they are equal.
|
||||
if ((aAbs | bAbs) == 0) return LE_EQUAL;
|
||||
|
||||
|
||||
// If at least one of a and b is positive, we get the same result comparing
|
||||
// a and b as signed integers as we would with a fp_ting-point compare.
|
||||
if ((aInt & bInt) >= 0) {
|
||||
|
@ -71,7 +71,7 @@ __lesf2(fp_t a, fp_t b) {
|
|||
else if (aInt == bInt) return LE_EQUAL;
|
||||
else return LE_GREATER;
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, both are negative, so we need to flip the sense of the
|
||||
// comparison to get the correct result. (This assumes a twos- or ones-
|
||||
// complement integer representation; if integers are represented in a
|
||||
|
@ -98,12 +98,12 @@ enum GE_RESULT {
|
|||
|
||||
COMPILER_RT_ABI enum GE_RESULT
|
||||
__gesf2(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const srep_t aInt = toRep(a);
|
||||
const srep_t bInt = toRep(b);
|
||||
const rep_t aAbs = aInt & absMask;
|
||||
const rep_t bAbs = bInt & absMask;
|
||||
|
||||
|
||||
if (aAbs > infRep || bAbs > infRep) return GE_UNORDERED;
|
||||
if ((aAbs | bAbs) == 0) return GE_EQUAL;
|
||||
if ((aInt & bInt) >= 0) {
|
||||
|
|
46
third_party/compiler_rt/divdf3.c
vendored
46
third_party/compiler_rt/divdf3.c
vendored
|
@ -25,36 +25,36 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__divdf3(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
|
||||
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;
|
||||
const rep_t quotientSign = (toRep(a) ^ toRep(b)) & signBit;
|
||||
|
||||
|
||||
rep_t aSignificand = toRep(a) & significandMask;
|
||||
rep_t bSignificand = toRep(b) & significandMask;
|
||||
int scale = 0;
|
||||
|
||||
|
||||
// Detect if a or b is zero, denormal, infinity, or NaN.
|
||||
if (aExponent-1U >= maxExponent-1U || bExponent-1U >= maxExponent-1U) {
|
||||
|
||||
|
||||
const rep_t aAbs = toRep(a) & absMask;
|
||||
const rep_t bAbs = toRep(b) & absMask;
|
||||
|
||||
|
||||
// NaN / anything = qNaN
|
||||
if (aAbs > infRep) return fromRep(toRep(a) | quietBit);
|
||||
// anything / NaN = qNaN
|
||||
if (bAbs > infRep) return fromRep(toRep(b) | quietBit);
|
||||
|
||||
|
||||
if (aAbs == infRep) {
|
||||
// infinity / infinity = NaN
|
||||
if (bAbs == infRep) return fromRep(qnanRep);
|
||||
// infinity / anything else = +/- infinity
|
||||
else return fromRep(aAbs | quotientSign);
|
||||
}
|
||||
|
||||
|
||||
// anything else / infinity = +/- 0
|
||||
if (bAbs == infRep) return fromRep(quotientSign);
|
||||
|
||||
|
||||
if (!aAbs) {
|
||||
// zero / zero = NaN
|
||||
if (!bAbs) return fromRep(qnanRep);
|
||||
|
@ -63,28 +63,28 @@ __divdf3(fp_t a, fp_t b) {
|
|||
}
|
||||
// anything else / zero = +/- infinity
|
||||
if (!bAbs) return fromRep(infRep | quotientSign);
|
||||
|
||||
|
||||
// one or both of a or b is denormal, the other (if applicable) is a
|
||||
// normal number. Renormalize one or both of a and b, and set scale to
|
||||
// include the necessary exponent adjustment.
|
||||
if (aAbs < implicitBit) scale += normalize(&aSignificand);
|
||||
if (bAbs < implicitBit) scale -= normalize(&bSignificand);
|
||||
}
|
||||
|
||||
|
||||
// Or in the implicit significand bit. (If we fell through from the
|
||||
// denormal path it was already set by normalize( ), but setting it twice
|
||||
// won't hurt anything.)
|
||||
aSignificand |= implicitBit;
|
||||
bSignificand |= implicitBit;
|
||||
int quotientExponent = aExponent - bExponent + scale;
|
||||
|
||||
|
||||
// Align the significand of b as a Q31 fixed-point number in the range
|
||||
// [1, 2.0) and get a Q32 approximate reciprocal using a small minimax
|
||||
// polynomial approximation: reciprocal = 3/4 + 1/sqrt(2) - b/2. This
|
||||
// is accurate to about 3.5 binary digits.
|
||||
const uint32_t q31b = bSignificand >> 21;
|
||||
uint32_t recip32 = UINT32_C(0x7504f333) - q31b;
|
||||
|
||||
|
||||
// Now refine the reciprocal estimate using a Newton-Raphson iteration:
|
||||
//
|
||||
// x1 = x0 * (2 - x0 * b)
|
||||
|
@ -99,13 +99,13 @@ __divdf3(fp_t a, fp_t b) {
|
|||
recip32 = (uint64_t)recip32 * correction32 >> 31;
|
||||
correction32 = -((uint64_t)recip32 * q31b >> 32);
|
||||
recip32 = (uint64_t)recip32 * correction32 >> 31;
|
||||
|
||||
|
||||
// recip32 might have overflowed to exactly zero in the preceding
|
||||
// computation if the high word of b is exactly 1.0. This would sabotage
|
||||
// the full-width final stage of the computation that follows, so we adjust
|
||||
// recip32 downward by one bit.
|
||||
recip32--;
|
||||
|
||||
|
||||
// We need to perform one more iteration to get us to 56 binary digits;
|
||||
// The last iteration needs to happen with extra precision.
|
||||
const uint32_t q63blo = bSignificand << 11;
|
||||
|
@ -114,14 +114,14 @@ __divdf3(fp_t a, fp_t b) {
|
|||
uint32_t cHi = correction >> 32;
|
||||
uint32_t cLo = correction;
|
||||
reciprocal = (uint64_t)recip32*cHi + ((uint64_t)recip32*cLo >> 32);
|
||||
|
||||
|
||||
// We already adjusted the 32-bit estimate, now we need to adjust the final
|
||||
// 64-bit reciprocal estimate downward to ensure that it is strictly smaller
|
||||
// than the infinitely precise exact reciprocal. Because the computation
|
||||
// of the Newton-Raphson step is truncating at every step, this adjustment
|
||||
// is small; most of the work is already done.
|
||||
reciprocal -= 2;
|
||||
|
||||
|
||||
// The numerical reciprocal is accurate to within 2^-56, lies in the
|
||||
// interval [0.5, 1.0), and is strictly smaller than the true reciprocal
|
||||
// of b. Multiplying a by this reciprocal thus gives a numerical q = a/b
|
||||
|
@ -131,12 +131,12 @@ __divdf3(fp_t a, fp_t b) {
|
|||
// 2. q is in the interval [0.5, 2.0)
|
||||
// 3. the error in q is bounded away from 2^-53 (actually, we have a
|
||||
// couple of bits to spare, but this is all we need).
|
||||
|
||||
|
||||
// We need a 64 x 64 multiply high to compute q, which isn't a basic
|
||||
// operation in C, so we need to be a little bit fussy.
|
||||
rep_t quotient, quotientLo;
|
||||
wideMultiply(aSignificand << 2, reciprocal, "ient, "ientLo);
|
||||
|
||||
|
||||
// Two cases: quotient is in [0.5, 1.0) or quotient is in [1.0, 2.0).
|
||||
// In either case, we are going to compute a residual of the form
|
||||
//
|
||||
|
@ -145,7 +145,7 @@ __divdf3(fp_t a, fp_t b) {
|
|||
// We know from the construction of q that r satisfies:
|
||||
//
|
||||
// 0 <= r < ulp(q)*b
|
||||
//
|
||||
//
|
||||
// if r is greater than 1/2 ulp(q)*b, then q rounds up. Otherwise, we
|
||||
// already have the correct result. The exact halfway case cannot occur.
|
||||
// We also take this time to right shift quotient if it falls in the [1,2)
|
||||
|
@ -158,20 +158,20 @@ __divdf3(fp_t a, fp_t b) {
|
|||
quotient >>= 1;
|
||||
residual = (aSignificand << 52) - quotient * bSignificand;
|
||||
}
|
||||
|
||||
|
||||
const int writtenExponent = quotientExponent + exponentBias;
|
||||
|
||||
|
||||
if (writtenExponent >= maxExponent) {
|
||||
// If we have overflowed the exponent, return infinity.
|
||||
return fromRep(infRep | quotientSign);
|
||||
}
|
||||
|
||||
|
||||
else if (writtenExponent < 1) {
|
||||
// Flush denormals to zero. In the future, it would be nice to add
|
||||
// code to round them correctly.
|
||||
return fromRep(quotientSign);
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
const bool round = (residual << 1) > bSignificand;
|
||||
// Clear the implicit bit
|
||||
|
|
2
third_party/compiler_rt/divmodsi4.c
vendored
2
third_party/compiler_rt/divmodsi4.c
vendored
|
@ -24,7 +24,7 @@ __divmodsi4(si_int a, si_int b, si_int* rem)
|
|||
{
|
||||
si_int d = __divsi3(a,b);
|
||||
*rem = a - (d*b);
|
||||
return d;
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
|
|
40
third_party/compiler_rt/divsf3.c
vendored
40
third_party/compiler_rt/divsf3.c
vendored
|
@ -25,36 +25,36 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__divsf3(fp_t a, fp_t b) {
|
||||
|
||||
|
||||
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
|
||||
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;
|
||||
const rep_t quotientSign = (toRep(a) ^ toRep(b)) & signBit;
|
||||
|
||||
|
||||
rep_t aSignificand = toRep(a) & significandMask;
|
||||
rep_t bSignificand = toRep(b) & significandMask;
|
||||
int scale = 0;
|
||||
|
||||
|
||||
// Detect if a or b is zero, denormal, infinity, or NaN.
|
||||
if (aExponent-1U >= maxExponent-1U || bExponent-1U >= maxExponent-1U) {
|
||||
|
||||
|
||||
const rep_t aAbs = toRep(a) & absMask;
|
||||
const rep_t bAbs = toRep(b) & absMask;
|
||||
|
||||
|
||||
// NaN / anything = qNaN
|
||||
if (aAbs > infRep) return fromRep(toRep(a) | quietBit);
|
||||
// anything / NaN = qNaN
|
||||
if (bAbs > infRep) return fromRep(toRep(b) | quietBit);
|
||||
|
||||
|
||||
if (aAbs == infRep) {
|
||||
// infinity / infinity = NaN
|
||||
if (bAbs == infRep) return fromRep(qnanRep);
|
||||
// infinity / anything else = +/- infinity
|
||||
else return fromRep(aAbs | quotientSign);
|
||||
}
|
||||
|
||||
|
||||
// anything else / infinity = +/- 0
|
||||
if (bAbs == infRep) return fromRep(quotientSign);
|
||||
|
||||
|
||||
if (!aAbs) {
|
||||
// zero / zero = NaN
|
||||
if (!bAbs) return fromRep(qnanRep);
|
||||
|
@ -63,28 +63,28 @@ __divsf3(fp_t a, fp_t b) {
|
|||
}
|
||||
// anything else / zero = +/- infinity
|
||||
if (!bAbs) return fromRep(infRep | quotientSign);
|
||||
|
||||
|
||||
// one or both of a or b is denormal, the other (if applicable) is a
|
||||
// normal number. Renormalize one or both of a and b, and set scale to
|
||||
// include the necessary exponent adjustment.
|
||||
if (aAbs < implicitBit) scale += normalize(&aSignificand);
|
||||
if (bAbs < implicitBit) scale -= normalize(&bSignificand);
|
||||
}
|
||||
|
||||
|
||||
// Or in the implicit significand bit. (If we fell through from the
|
||||
// denormal path it was already set by normalize( ), but setting it twice
|
||||
// won't hurt anything.)
|
||||
aSignificand |= implicitBit;
|
||||
bSignificand |= implicitBit;
|
||||
int quotientExponent = aExponent - bExponent + scale;
|
||||
|
||||
|
||||
// Align the significand of b as a Q31 fixed-point number in the range
|
||||
// [1, 2.0) and get a Q32 approximate reciprocal using a small minimax
|
||||
// polynomial approximation: reciprocal = 3/4 + 1/sqrt(2) - b/2. This
|
||||
// is accurate to about 3.5 binary digits.
|
||||
uint32_t q31b = bSignificand << 8;
|
||||
uint32_t reciprocal = UINT32_C(0x7504f333) - q31b;
|
||||
|
||||
|
||||
// Now refine the reciprocal estimate using a Newton-Raphson iteration:
|
||||
//
|
||||
// x1 = x0 * (2 - x0 * b)
|
||||
|
@ -99,7 +99,7 @@ __divsf3(fp_t a, fp_t b) {
|
|||
reciprocal = (uint64_t)reciprocal * correction >> 31;
|
||||
correction = -((uint64_t)reciprocal * q31b >> 32);
|
||||
reciprocal = (uint64_t)reciprocal * correction >> 31;
|
||||
|
||||
|
||||
// Exhaustive testing shows that the error in reciprocal after three steps
|
||||
// is in the interval [-0x1.f58108p-31, 0x1.d0e48cp-29], in line with our
|
||||
// expectations. We bump the reciprocal by a tiny value to force the error
|
||||
|
@ -107,7 +107,7 @@ __divsf3(fp_t a, fp_t b) {
|
|||
// be specific). This also causes 1/1 to give a sensible approximation
|
||||
// instead of zero (due to overflow).
|
||||
reciprocal -= 2;
|
||||
|
||||
|
||||
// The numerical reciprocal is accurate to within 2^-28, lies in the
|
||||
// interval [0x1.000000eep-1, 0x1.fffffffcp-1], and is strictly smaller
|
||||
// than the true reciprocal of b. Multiplying a by this reciprocal thus
|
||||
|
@ -119,9 +119,9 @@ __divsf3(fp_t a, fp_t b) {
|
|||
// from the fact that we truncate the product, and the 2^27 term
|
||||
// is the error in the reciprocal of b scaled by the maximum
|
||||
// possible value of a. As a consequence of this error bound,
|
||||
// either q or nextafter(q) is the correctly rounded
|
||||
// either q or nextafter(q) is the correctly rounded
|
||||
rep_t quotient = (uint64_t)reciprocal*(aSignificand << 1) >> 32;
|
||||
|
||||
|
||||
// Two cases: quotient is in [0.5, 1.0) or quotient is in [1.0, 2.0).
|
||||
// In either case, we are going to compute a residual of the form
|
||||
//
|
||||
|
@ -130,7 +130,7 @@ __divsf3(fp_t a, fp_t b) {
|
|||
// We know from the construction of q that r satisfies:
|
||||
//
|
||||
// 0 <= r < ulp(q)*b
|
||||
//
|
||||
//
|
||||
// if r is greater than 1/2 ulp(q)*b, then q rounds up. Otherwise, we
|
||||
// already have the correct result. The exact halfway case cannot occur.
|
||||
// We also take this time to right shift quotient if it falls in the [1,2)
|
||||
|
@ -145,18 +145,18 @@ __divsf3(fp_t a, fp_t b) {
|
|||
}
|
||||
|
||||
const int writtenExponent = quotientExponent + exponentBias;
|
||||
|
||||
|
||||
if (writtenExponent >= maxExponent) {
|
||||
// If we have overflowed the exponent, return infinity.
|
||||
return fromRep(infRep | quotientSign);
|
||||
}
|
||||
|
||||
|
||||
else if (writtenExponent < 1) {
|
||||
// Flush denormals to zero. In the future, it would be nice to add
|
||||
// code to round them correctly.
|
||||
return fromRep(quotientSign);
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
const bool round = (residual << 1) > bSignificand;
|
||||
// Clear the implicit bit
|
||||
|
|
2
third_party/compiler_rt/fixunsxfdi.c
vendored
2
third_party/compiler_rt/fixunsxfdi.c
vendored
|
@ -25,7 +25,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
|
||||
* du_int is a 64 bit integral type
|
||||
* value in long double is representable in du_int or is negative
|
||||
* value in long double is representable in du_int or is negative
|
||||
* (no range checking performed)
|
||||
*/
|
||||
|
||||
|
|
2
third_party/compiler_rt/fixunsxfsi.c
vendored
2
third_party/compiler_rt/fixunsxfsi.c
vendored
|
@ -25,7 +25,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
|
||||
* su_int is a 32 bit integral type
|
||||
* value in long double is representable in su_int or is negative
|
||||
* value in long double is representable in su_int or is negative
|
||||
*/
|
||||
|
||||
/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
|
||||
|
|
2
third_party/compiler_rt/fixunsxfti.c
vendored
2
third_party/compiler_rt/fixunsxfti.c
vendored
|
@ -25,7 +25,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
|
||||
* tu_int is a 128 bit integral type
|
||||
* value in long double is representable in tu_int or is negative
|
||||
* value in long double is representable in tu_int or is negative
|
||||
*/
|
||||
|
||||
/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
|
||||
|
|
18
third_party/compiler_rt/floatdisf.c
vendored
18
third_party/compiler_rt/floatdisf.c
vendored
|
@ -17,9 +17,9 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Returns: convert a to a float, rounding toward even.*/
|
||||
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
* di_int is a 64 bit integral type
|
||||
*/
|
||||
*/
|
||||
|
||||
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
|
||||
|
||||
|
@ -37,13 +37,13 @@ __floatdisf(di_int a)
|
|||
int e = sd - 1; /* exponent */
|
||||
if (sd > FLT_MANT_DIG)
|
||||
{
|
||||
/* start: 0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx
|
||||
* finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR
|
||||
* 12345678901234567890123456
|
||||
* 1 = msb 1 bit
|
||||
* P = bit FLT_MANT_DIG-1 bits to the right of 1
|
||||
* Q = bit FLT_MANT_DIG bits to the right of 1
|
||||
* R = "or" of all bits to the right of Q
|
||||
/* start: 0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx
|
||||
* finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR
|
||||
* 12345678901234567890123456
|
||||
* 1 = msb 1 bit
|
||||
* P = bit FLT_MANT_DIG-1 bits to the right of 1
|
||||
* Q = bit FLT_MANT_DIG bits to the right of 1
|
||||
* R = "or" of all bits to the right of Q
|
||||
*/
|
||||
switch (sd)
|
||||
{
|
||||
|
|
2
third_party/compiler_rt/floatdixf.c
vendored
2
third_party/compiler_rt/floatdixf.c
vendored
|
@ -11,7 +11,7 @@
|
|||
* This file implements __floatdixf for the compiler_rt library.
|
||||
*
|
||||
* ===----------------------------------------------------------------------===
|
||||
*/
|
||||
*/
|
||||
|
||||
STATIC_YOINK("huge_compiler_rt_license");
|
||||
|
||||
|
|
12
third_party/compiler_rt/floatsidf.c
vendored
12
third_party/compiler_rt/floatsidf.c
vendored
|
@ -23,30 +23,30 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__floatsidf(int a) {
|
||||
|
||||
|
||||
const int aWidth = sizeof a * CHAR_BIT;
|
||||
|
||||
|
||||
// Handle zero as a special case to protect clz
|
||||
if (a == 0)
|
||||
return fromRep(0);
|
||||
|
||||
|
||||
// All other cases begin by extracting the sign and absolute value of a
|
||||
rep_t sign = 0;
|
||||
if (a < 0) {
|
||||
sign = signBit;
|
||||
a = -a;
|
||||
}
|
||||
|
||||
|
||||
// Exponent of (fp_t)a is the width of abs(a).
|
||||
const int exponent = (aWidth - 1) - __builtin_clz(a);
|
||||
rep_t result;
|
||||
|
||||
|
||||
// Shift a into the significand field and clear the implicit bit. Extra
|
||||
// cast to unsigned int is necessary to get the correct behavior for
|
||||
// the input INT_MIN.
|
||||
const int shift = significandBits - exponent;
|
||||
result = (rep_t)(unsigned int)a << shift ^ implicitBit;
|
||||
|
||||
|
||||
// Insert the exponent
|
||||
result += (rep_t)(exponent + exponentBias) << significandBits;
|
||||
// Insert the sign bit and return
|
||||
|
|
12
third_party/compiler_rt/floatsisf.c
vendored
12
third_party/compiler_rt/floatsisf.c
vendored
|
@ -23,24 +23,24 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__floatsisf(int a) {
|
||||
|
||||
|
||||
const int aWidth = sizeof a * CHAR_BIT;
|
||||
|
||||
|
||||
// Handle zero as a special case to protect clz
|
||||
if (a == 0)
|
||||
return fromRep(0);
|
||||
|
||||
|
||||
// All other cases begin by extracting the sign and absolute value of a
|
||||
rep_t sign = 0;
|
||||
if (a < 0) {
|
||||
sign = signBit;
|
||||
a = -a;
|
||||
}
|
||||
|
||||
|
||||
// Exponent of (fp_t)a is the width of abs(a).
|
||||
const int exponent = (aWidth - 1) - __builtin_clz(a);
|
||||
rep_t result;
|
||||
|
||||
|
||||
// Shift a into the significand field, rounding if it is a right-shift
|
||||
if (exponent <= significandBits) {
|
||||
const int shift = significandBits - exponent;
|
||||
|
@ -52,7 +52,7 @@ __floatsisf(int a) {
|
|||
if (round > signBit) result++;
|
||||
if (round == signBit) result += result & 1;
|
||||
}
|
||||
|
||||
|
||||
// Insert the exponent
|
||||
result += (rep_t)(exponent + exponentBias) << significandBits;
|
||||
// Insert the sign bit and return
|
||||
|
|
2
third_party/compiler_rt/floattisf.c
vendored
2
third_party/compiler_rt/floattisf.c
vendored
|
@ -21,7 +21,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Returns: convert a to a float, rounding toward even. */
|
||||
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
* ti_int is a 128 bit integral type
|
||||
*/
|
||||
|
||||
|
|
2
third_party/compiler_rt/floatundisf.c
vendored
2
third_party/compiler_rt/floatundisf.c
vendored
|
@ -17,7 +17,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Returns: convert a to a float, rounding toward even. */
|
||||
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
* du_int is a 64 bit integral type
|
||||
*/
|
||||
|
||||
|
|
10
third_party/compiler_rt/floatunsidf.c
vendored
10
third_party/compiler_rt/floatunsidf.c
vendored
|
@ -23,20 +23,20 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__floatunsidf(unsigned int a) {
|
||||
|
||||
|
||||
const int aWidth = sizeof a * CHAR_BIT;
|
||||
|
||||
|
||||
// Handle zero as a special case to protect clz
|
||||
if (a == 0) return fromRep(0);
|
||||
|
||||
|
||||
// Exponent of (fp_t)a is the width of abs(a).
|
||||
const int exponent = (aWidth - 1) - __builtin_clz(a);
|
||||
rep_t result;
|
||||
|
||||
|
||||
// Shift a into the significand field and clear the implicit bit.
|
||||
const int shift = significandBits - exponent;
|
||||
result = (rep_t)a << shift ^ implicitBit;
|
||||
|
||||
|
||||
// Insert the exponent
|
||||
result += (rep_t)(exponent + exponentBias) << significandBits;
|
||||
return fromRep(result);
|
||||
|
|
10
third_party/compiler_rt/floatunsisf.c
vendored
10
third_party/compiler_rt/floatunsisf.c
vendored
|
@ -23,16 +23,16 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__floatunsisf(unsigned int a) {
|
||||
|
||||
|
||||
const int aWidth = sizeof a * CHAR_BIT;
|
||||
|
||||
|
||||
// Handle zero as a special case to protect clz
|
||||
if (a == 0) return fromRep(0);
|
||||
|
||||
|
||||
// Exponent of (fp_t)a is the width of abs(a).
|
||||
const int exponent = (aWidth - 1) - __builtin_clz(a);
|
||||
rep_t result;
|
||||
|
||||
|
||||
// Shift a into the significand field, rounding if it is a right-shift
|
||||
if (exponent <= significandBits) {
|
||||
const int shift = significandBits - exponent;
|
||||
|
@ -44,7 +44,7 @@ __floatunsisf(unsigned int a) {
|
|||
if (round > signBit) result++;
|
||||
if (round == signBit) result += result & 1;
|
||||
}
|
||||
|
||||
|
||||
// Insert the exponent
|
||||
result += (rep_t)(exponent + exponentBias) << significandBits;
|
||||
return fromRep(result);
|
||||
|
|
2
third_party/compiler_rt/floatuntisf.c
vendored
2
third_party/compiler_rt/floatuntisf.c
vendored
|
@ -21,7 +21,7 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
/* Returns: convert a to a float, rounding toward even. */
|
||||
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
/* Assumption: float is a IEEE 32 bit floating point type
|
||||
* tu_int is a 128 bit integral type
|
||||
*/
|
||||
|
||||
|
|
2
third_party/compiler_rt/mulodi4.c
vendored
2
third_party/compiler_rt/mulodi4.c
vendored
|
@ -27,7 +27,7 @@ __mulodi4(di_int a, di_int b, int* overflow)
|
|||
const int N = (int)(sizeof(di_int) * CHAR_BIT);
|
||||
const di_int MIN = (di_int)1 << (N-1);
|
||||
const di_int MAX = ~MIN;
|
||||
*overflow = 0;
|
||||
*overflow = 0;
|
||||
di_int result = a * b;
|
||||
if (a == MIN)
|
||||
{
|
||||
|
|
2
third_party/compiler_rt/mulosi4.c
vendored
2
third_party/compiler_rt/mulosi4.c
vendored
|
@ -27,7 +27,7 @@ __mulosi4(si_int a, si_int b, int* overflow)
|
|||
const int N = (int)(sizeof(si_int) * CHAR_BIT);
|
||||
const si_int MIN = (si_int)1 << (N-1);
|
||||
const si_int MAX = ~MIN;
|
||||
*overflow = 0;
|
||||
*overflow = 0;
|
||||
si_int result = a * b;
|
||||
if (a == MIN)
|
||||
{
|
||||
|
|
2
third_party/compiler_rt/parityti2.c
vendored
2
third_party/compiler_rt/parityti2.c
vendored
|
@ -11,7 +11,7 @@
|
|||
* This file implements __parityti2 for the compiler_rt library.
|
||||
*
|
||||
* ===----------------------------------------------------------------------===
|
||||
*/
|
||||
*/
|
||||
|
||||
STATIC_YOINK("huge_compiler_rt_license");
|
||||
|
||||
|
|
2
third_party/compiler_rt/udivmoddi4.c
vendored
2
third_party/compiler_rt/udivmoddi4.c
vendored
|
@ -64,7 +64,7 @@ __udivmoddi4(du_int a, du_int b, du_int* rem)
|
|||
/* K X
|
||||
* ---
|
||||
* 0 0
|
||||
*/
|
||||
*/
|
||||
if (rem)
|
||||
*rem = n.s.high % d.s.low;
|
||||
return n.s.high / d.s.low;
|
||||
|
|
2
third_party/double-conversion/README.cosmo
vendored
2
third_party/double-conversion/README.cosmo
vendored
|
@ -1,6 +1,6 @@
|
|||
DESCRIPTION
|
||||
|
||||
Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.
|
||||
Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.
|
||||
|
||||
ORIGIN
|
||||
|
||||
|
|
|
@ -4681,7 +4681,7 @@ TEST(StringToFloatHexString) {
|
|||
CHECK_EQ(5.0f, StrToF(" + 0x5 ", flags, 0.0f, &processed, &all_used));
|
||||
CHECK(all_used);
|
||||
|
||||
CHECK_EQ(Single::NaN(), StrToF("- -0x5", flags, 0.0f,
|
||||
CHECK_EQ(Single::NaN(), StrToF("- -0x5", flags, 0.0f,
|
||||
&processed, &all_used));
|
||||
CHECK_EQ(0, processed);
|
||||
|
||||
|
@ -5949,7 +5949,7 @@ TEST(StringToTemplate) {
|
|||
// The double rounding example from TEST(StringToFloatHexString), which
|
||||
// yields a slightly different result from StringToFloat than from
|
||||
// StringToDouble. Allows testing that StringTo<float> behaves like
|
||||
// StringToFloat (rather than like StringToDouble).
|
||||
// StringToFloat (rather than like StringToDouble).
|
||||
const char buffer[] = "0x100000100000008";
|
||||
const int length = DOUBLE_CONVERSION_ARRAY_SIZE(buffer) - 1;
|
||||
|
||||
|
|
8
third_party/finger/display.c
vendored
8
third_party/finger/display.c
vendored
|
@ -89,18 +89,18 @@ fxputc(FILE *f, int ch)
|
|||
ch = ch&0xff;
|
||||
|
||||
/* on 7-bit terminals, strip high bit */
|
||||
if (!is8bit()) ch &= 0x7f;
|
||||
if (!is8bit()) ch &= 0x7f;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Assume anything that isn't a control character is printable.
|
||||
* We can't count on locale stuff to tell us what's printable
|
||||
* We can't count on locale stuff to tell us what's printable
|
||||
* because we might be looking at someone who uses different
|
||||
* locale settings or is on the other side of the planet. So,
|
||||
* strip 0-31, 127, 128-159, and 255. Note that not stripping
|
||||
* 128-159 is asking for trouble, as 155 (M-esc) is interpreted
|
||||
* as esc-[ by most terminals. Hopefully this won't break anyone's
|
||||
* charset.
|
||||
*
|
||||
*
|
||||
* It would be nice if we could set the terminal to display in the
|
||||
* right charset, but we have no way to know what it is. feh.
|
||||
*/
|
||||
|
|
2
third_party/finger/finger.1
vendored
2
third_party/finger/finger.1
vendored
|
@ -153,7 +153,7 @@ The
|
|||
.Fl l
|
||||
option is the only option that may be passed to a remote machine.
|
||||
.Pp
|
||||
If standard output is a socket,
|
||||
If standard output is a socket,
|
||||
.Nm finger
|
||||
will emit a carriage return (^M) before every linefeed (^J). This is
|
||||
for processing remote finger requests when invoked by
|
||||
|
|
2
third_party/finger/util.c
vendored
2
third_party/finger/util.c
vendored
|
@ -258,7 +258,7 @@ void enter_lastlog(PERSON *pn) {
|
|||
/*
|
||||
* and if it's not any of the current logins
|
||||
* can't use time comparison because there may be a small
|
||||
* discrepancy since login calls time() twice
|
||||
* discrepency since login calls time() twice
|
||||
*/
|
||||
for (w = pn->whead; doit && w != NULL; w = w->next)
|
||||
if (w->info == LOGGEDIN &&
|
||||
|
|
44
third_party/gcc/LICENSE.txt
vendored
44
third_party/gcc/LICENSE.txt
vendored
|
@ -479,7 +479,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -1518,7 +1518,7 @@ Public License instead of this License. But first, please read
|
|||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
|
@ -1619,7 +1619,7 @@ the following:
|
|||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
|
@ -4196,7 +4196,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -6764,7 +6764,7 @@ Public License instead of this License. But first, please read
|
|||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
|
@ -6865,7 +6865,7 @@ the following:
|
|||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
|
@ -8541,7 +8541,7 @@ Public License instead of this License. But first, please read
|
|||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
|
@ -8642,7 +8642,7 @@ the following:
|
|||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
|
@ -9188,7 +9188,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -10236,7 +10236,7 @@ Public License instead of this License. But first, please read
|
|||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
|
@ -10337,7 +10337,7 @@ the following:
|
|||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
|
@ -10923,16 +10923,16 @@ are met:
|
|||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
|
@ -12206,7 +12206,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -13331,7 +13331,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -14170,8 +14170,8 @@ so, subject to the following conditions:
|
|||
this list of conditions and the following disclaimers in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of Intel Corporation Threading Runtimes Team nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
* Neither the names of Intel Corporation Threading Runtimes Team nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this Software without specific prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
|
@ -14920,7 +14920,7 @@ Public License instead of this License. But first, please read
|
|||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
|
@ -15021,7 +15021,7 @@ the following:
|
|||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
|
|
2
third_party/gcc/README.cosmo
vendored
2
third_party/gcc/README.cosmo
vendored
|
@ -19,7 +19,7 @@ Author: Rich Felker <dalias@aerifal.cx>
|
|||
Date: Wed Dec 18 14:29:07 2019 -0500
|
||||
|
||||
switch linux kernel headers to 4.19.88 by default
|
||||
|
||||
|
||||
using slim headers-only version. this change is needed to support all
|
||||
future versions of musl on 32-bit archs, since prior to 4.16 the
|
||||
kernel headers had incompatibility with userspace time_t not matching
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
%{%:debug-level-gt(0):%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}
|
||||
|
||||
*asm_final:
|
||||
%{gsplit-dwarf:
|
||||
objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo}
|
||||
%{gsplit-dwarf:
|
||||
objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo}
|
||||
objcopy --strip-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} }
|
||||
|
||||
*asm_options:
|
||||
|
@ -137,5 +137,5 @@ collect2
|
|||
%{march=native:%>march=native %:local_cpu_detect(arch) %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}
|
||||
|
||||
*link_command:
|
||||
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %{fuse-linker-plugin: %e-fuse-linker-plugin is not supported in this configuration}%{flto|flto=*:%<fcompare-debug*} %{flto} %{fno-lto} %{flto=*} %l %{shared|r:;pie|static-pie:-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}} %{fuse-ld=*:-fuse-ld=%*} %{gz|gz=zlib:--compress-debug-sections=zlib} %{gz=none:--compress-debug-sections=none} %{gz=zlib-gnu:--compress-debug-sections=zlib-gnu} %X %{o*} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) %{fvtable-verify=none:} %{fvtable-verify=std: %e-fvtable-verify=std is not supported in this configuration} %{fvtable-verify=preinit: %e-fvtable-verify=preinit is not supported in this configuration} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address):%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}} %{%:sanitize(thread):%{!shared:libtsan_preinit%O%s} %{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}} %{%:sanitize(leak):%{!shared:liblsan_preinit%O%s} %{static-liblsan:%{!shared:-Bstatic --whole-archive -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:-llsan}}}}} %o %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): %:include(libgomp.spec)%(link_gomp)} %{fgnu-tm:%:include(libitm.spec)%(link_itm)} %(mflib) %{fsplit-stack: --wrap=pthread_create} %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address): %{static-libasan|static:%:include(libsanitizer.spec)%(link_libasan)} %{static:%ecannot specify -static with -fsanitize=address}} %{%:sanitize(thread): %{static-libtsan|static:%:include(libsanitizer.spec)%(link_libtsan)} %{static:%ecannot specify -static with -fsanitize=thread}} %{%:sanitize(undefined):%{static-libubsan:-Bstatic} -lubsan %{static-libubsan:-Bdynamic} %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}} %{%:sanitize(leak): %{static-liblsan|static:%:include(libsanitizer.spec)%(link_liblsan)}}}}} %{!nostdlib:%{!r:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}} %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*}
|
||||
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) %{fuse-linker-plugin: %e-fuse-linker-plugin is not supported in this configuration}%{flto|flto=*:%<fcompare-debug*} %{flto} %{fno-lto} %{flto=*} %l %{shared|r:;pie|static-pie:-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}} %{fuse-ld=*:-fuse-ld=%*} %{gz|gz=zlib:--compress-debug-sections=zlib} %{gz=none:--compress-debug-sections=none} %{gz=zlib-gnu:--compress-debug-sections=zlib-gnu} %X %{o*} %{e*} %{N} %{n} %{r} %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) %{fvtable-verify=none:} %{fvtable-verify=std: %e-fvtable-verify=std is not supported in this configuration} %{fvtable-verify=preinit: %e-fvtable-verify=preinit is not supported in this configuration} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address):%{!shared:libasan_preinit%O%s} %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}} %{%:sanitize(thread):%{!shared:libtsan_preinit%O%s} %{static-libtsan:%{!shared:-Bstatic --whole-archive -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}} %{%:sanitize(leak):%{!shared:liblsan_preinit%O%s} %{static-liblsan:%{!shared:-Bstatic --whole-archive -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:-llsan}}}}} %o %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): %:include(libgomp.spec)%(link_gomp)} %{fgnu-tm:%:include(libitm.spec)%(link_itm)} %(mflib) %{fsplit-stack: --wrap=pthread_create} %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} %{!nostdlib:%{!r:%{!nodefaultlibs:%{%:sanitize(address): %{static-libasan|static:%:include(libsanitizer.spec)%(link_libasan)} %{static:%ecannot specify -static with -fsanitize=address}} %{%:sanitize(thread): %{static-libtsan|static:%:include(libsanitizer.spec)%(link_libtsan)} %{static:%ecannot specify -static with -fsanitize=thread}} %{%:sanitize(undefined):%{static-libubsan:-Bstatic} -lubsan %{static-libubsan:-Bdynamic} %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}} %{%:sanitize(leak): %{static-liblsan|static:%:include(libsanitizer.spec)%(link_liblsan)}}}}} %{!nostdlib:%{!r:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}} %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*}
|
||||
%(post_link) }}}}}}
|
||||
|
|
22
third_party/libcxx/__string
vendored
22
third_party/libcxx/__string
vendored
|
@ -31,7 +31,7 @@ struct char_traits
|
|||
|
||||
static constexpr int compare(const char_type* s1, const char_type* s2, size_t n);
|
||||
static constexpr size_t length(const char_type* s);
|
||||
static constexpr const char_type*
|
||||
static constexpr const char_type*
|
||||
find(const char_type* s, size_t n, const char_type& a);
|
||||
static char_type* move(char_type* s1, const char_type* s2, size_t n);
|
||||
static char_type* copy(char_type* s1, const char_type* s2, size_t n);
|
||||
|
@ -424,19 +424,19 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t>
|
|||
|
||||
static constexpr
|
||||
size_t length(const char_type* __s) _NOEXCEPT;
|
||||
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY static constexpr
|
||||
const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
|
||||
|
||||
|
||||
static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
|
||||
{return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);}
|
||||
|
||||
|
||||
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
|
||||
{
|
||||
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
|
||||
return __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
|
||||
}
|
||||
|
||||
|
||||
static char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
|
||||
{return __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);}
|
||||
|
||||
|
@ -744,7 +744,7 @@ char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a) _NOEXCE
|
|||
// __str_find
|
||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
__str_find(const _CharT *__p, _SizeT __sz,
|
||||
__str_find(const _CharT *__p, _SizeT __sz,
|
||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||
{
|
||||
if (__pos >= __sz)
|
||||
|
@ -796,7 +796,7 @@ __search_substring(const _CharT *__first1, const _CharT *__last1,
|
|||
|
||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
__str_find(const _CharT *__p, _SizeT __sz,
|
||||
__str_find(const _CharT *__p, _SizeT __sz,
|
||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||
{
|
||||
if (__pos > __sz)
|
||||
|
@ -818,7 +818,7 @@ __str_find(const _CharT *__p, _SizeT __sz,
|
|||
|
||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||
_CharT __c, _SizeT __pos) _NOEXCEPT
|
||||
{
|
||||
if (__sz < 1)
|
||||
|
@ -837,7 +837,7 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
|
|||
|
||||
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
|
||||
inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||
__str_rfind(const _CharT *__p, _SizeT __sz,
|
||||
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
|
||||
{
|
||||
__pos = _VSTD::min(__pos, __sz);
|
||||
|
@ -846,7 +846,7 @@ __str_rfind(const _CharT *__p, _SizeT __sz,
|
|||
else
|
||||
__pos = __sz;
|
||||
const _CharT* __r = _VSTD::__find_end(
|
||||
__p, __p + __pos, __s, __s + __n, _Traits::eq,
|
||||
__p, __p + __pos, __s, __s + __n, _Traits::eq,
|
||||
random_access_iterator_tag(), random_access_iterator_tag());
|
||||
if (__n > 0 && __r == __p + __pos)
|
||||
return __npos;
|
||||
|
@ -975,7 +975,7 @@ struct __quoted_output_proxy
|
|||
|
||||
__quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e)
|
||||
: __first(__f), __last(__l), __delim(__d), __escape(__e) {}
|
||||
// This would be a nice place for a string_ref
|
||||
// This would be a nice place for a string_ref
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
2
third_party/libcxx/__threading_support
vendored
2
third_party/libcxx/__threading_support
vendored
|
@ -453,7 +453,7 @@ public:
|
|||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __reset() { __id_ = 0; }
|
||||
|
||||
|
||||
template<class _CharT, class _Traits>
|
||||
friend
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
|
4
third_party/libcxx/bit
vendored
4
third_party/libcxx/bit
vendored
|
@ -42,7 +42,7 @@ namespace std {
|
|||
template<class T>
|
||||
constexpr int popcount(T x) noexcept; // C++20
|
||||
|
||||
// 20.15.9, endian
|
||||
// 20.15.9, endian
|
||||
enum class endian {
|
||||
little = see below, // C++20
|
||||
big = see below, // C++20
|
||||
|
@ -350,7 +350,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
|||
bool __ispow2(_Tp __t) _NOEXCEPT
|
||||
{
|
||||
static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned");
|
||||
return __t != 0 && (((__t & (__t - 1)) == 0));
|
||||
return __t != 0 && (((__t & (__t - 1)) == 0));
|
||||
}
|
||||
|
||||
|
||||
|
|
4
third_party/libcxx/ctime
vendored
4
third_party/libcxx/ctime
vendored
|
@ -18,7 +18,7 @@ Macros:
|
|||
NULL
|
||||
CLOCKS_PER_SEC
|
||||
TIME_UTC // C++17
|
||||
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
|
@ -29,7 +29,7 @@ Types:
|
|||
time_t
|
||||
tm
|
||||
timespec // C++17
|
||||
|
||||
|
||||
clock_t clock();
|
||||
double difftime(time_t time1, time_t time0);
|
||||
time_t mktime(tm* timeptr);
|
||||
|
|
2
third_party/libcxx/list
vendored
2
third_party/libcxx/list
vendored
|
@ -2211,7 +2211,7 @@ list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
|
|||
__i = __j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (__remove_return_type) __deleted_nodes.size();
|
||||
}
|
||||
|
||||
|
|
2
third_party/lua/test/attrib.lua
vendored
2
third_party/lua/test/attrib.lua
vendored
|
@ -435,7 +435,7 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 ==
|
|||
|
||||
|
||||
|
||||
-- test of large float/integer indices
|
||||
-- test of large float/integer indices
|
||||
|
||||
-- compute maximum integer where all bits fit in a float
|
||||
local maxint = math.maxinteger
|
||||
|
|
6
third_party/lua/test/big.lua
vendored
6
third_party/lua/test/big.lua
vendored
|
@ -7,7 +7,7 @@ end
|
|||
|
||||
print "testing large tables"
|
||||
|
||||
local debug = require"debug"
|
||||
local debug = require"debug"
|
||||
|
||||
local lim = 2^18 + 1000
|
||||
local prog = { "local y = {0" }
|
||||
|
@ -46,7 +46,7 @@ getmetatable(env).__newindex = function () end
|
|||
local e, m = pcall(f)
|
||||
assert(not e and m:find("global 'X'"))
|
||||
|
||||
-- errors in metamethods
|
||||
-- errors in metamethods
|
||||
getmetatable(env).__newindex = function () error("hi") end
|
||||
local e, m = xpcall(f, debug.traceback)
|
||||
assert(not e and m:find("'newindex'"))
|
||||
|
@ -55,7 +55,7 @@ f, X = nil
|
|||
|
||||
coroutine.yield'b'
|
||||
|
||||
if 2^32 == 0 then -- (small integers) {
|
||||
if 2^32 == 0 then -- (small integers) {
|
||||
|
||||
print "testing string length overflow"
|
||||
|
||||
|
|
4
third_party/lua/test/closure.lua
vendored
4
third_party/lua/test/closure.lua
vendored
|
@ -162,7 +162,7 @@ do
|
|||
X = function () return b end -- closure with upvalue
|
||||
if a then break end
|
||||
end
|
||||
|
||||
|
||||
do
|
||||
local b = 20
|
||||
Y = function () return b end -- closure with upvalue
|
||||
|
@ -172,7 +172,7 @@ do
|
|||
assert(X() == 10 and Y() == 20)
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- testing closures x repeat-until
|
||||
|
||||
local a = {}
|
||||
|
|
12
third_party/lua/test/coroutine.lua
vendored
12
third_party/lua/test/coroutine.lua
vendored
|
@ -467,7 +467,7 @@ else
|
|||
print "testing yields inside hooks"
|
||||
|
||||
local turn
|
||||
|
||||
|
||||
function fact (t, x)
|
||||
assert(turn == t)
|
||||
if x == 0 then return 1
|
||||
|
@ -591,7 +591,7 @@ else
|
|||
|
||||
|
||||
print "testing coroutine API"
|
||||
|
||||
|
||||
-- reusing a thread
|
||||
assert(T.testC([[
|
||||
newthread # create thread
|
||||
|
@ -870,7 +870,7 @@ do -- a few more tests for comparison operators
|
|||
until res ~= 10
|
||||
return res
|
||||
end
|
||||
|
||||
|
||||
local function test ()
|
||||
local a1 = setmetatable({x=1}, mt1)
|
||||
local a2 = setmetatable({x=2}, mt2)
|
||||
|
@ -882,7 +882,7 @@ do -- a few more tests for comparison operators
|
|||
assert(2 >= a2)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
run(test)
|
||||
|
||||
end
|
||||
|
@ -1042,11 +1042,11 @@ co = coroutine.wrap(function (...) return
|
|||
cannot be here!
|
||||
]],
|
||||
[[ # 1st continuation
|
||||
yieldk 0 3
|
||||
yieldk 0 3
|
||||
cannot be here!
|
||||
]],
|
||||
[[ # 2nd continuation
|
||||
yieldk 0 4
|
||||
yieldk 0 4
|
||||
cannot be here!
|
||||
]],
|
||||
[[ # 3th continuation
|
||||
|
|
14
third_party/lua/test/db.lua
vendored
14
third_party/lua/test/db.lua
vendored
|
@ -359,7 +359,7 @@ end
|
|||
function g(a,b) return (a+1) + f() end
|
||||
|
||||
assert(g(0,0) == 30)
|
||||
|
||||
|
||||
|
||||
debug.sethook(nil);
|
||||
assert(not debug.gethook())
|
||||
|
@ -411,7 +411,7 @@ debug.sethook(function (e)
|
|||
dostring("XX = 12") -- test dostring inside hooks
|
||||
-- testing errors inside hooks
|
||||
assert(not pcall(load("a='joao'+1")))
|
||||
debug.sethook(function (e, l)
|
||||
debug.sethook(function (e, l)
|
||||
assert(debug.getinfo(2, "l").currentline == l)
|
||||
local f,m,c = debug.gethook()
|
||||
assert(e == "line")
|
||||
|
@ -474,7 +474,7 @@ do print("testing inspection of parameters/returned values")
|
|||
local t = {}
|
||||
for i = ar.ftransfer, ar.ftransfer + ar.ntransfer - 1 do
|
||||
local _, v = debug.getlocal(2, i)
|
||||
t[#t + 1] = v
|
||||
t[#t + 1] = v
|
||||
end
|
||||
if event == "return" then
|
||||
out = t
|
||||
|
@ -528,7 +528,7 @@ assert(t.a == 1 and t.b == 2 and t.c == 3)
|
|||
assert(debug.setupvalue(foo1, 1, "xuxu") == "b")
|
||||
assert(({debug.getupvalue(foo2, 3)})[2] == "xuxu")
|
||||
-- upvalues of C functions are allways "called" "" (the empty string)
|
||||
assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "")
|
||||
assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "")
|
||||
|
||||
|
||||
-- testing count hooks
|
||||
|
@ -960,7 +960,7 @@ end
|
|||
do -- tests for 'source' in binary dumps
|
||||
local prog = [[
|
||||
return function (x)
|
||||
return function (y)
|
||||
return function (y)
|
||||
return x + y
|
||||
end
|
||||
end
|
||||
|
@ -975,7 +975,7 @@ do -- tests for 'source' in binary dumps
|
|||
local h = g(3)
|
||||
assert(h(5) == 8)
|
||||
assert(debug.getinfo(f).source == name and -- all functions have 'source'
|
||||
debug.getinfo(g).source == name and
|
||||
debug.getinfo(g).source == name and
|
||||
debug.getinfo(h).source == name)
|
||||
-- again, without debug info
|
||||
local c = string.dump(p, true)
|
||||
|
@ -985,7 +985,7 @@ do -- tests for 'source' in binary dumps
|
|||
local h = g(30)
|
||||
assert(h(50) == 80)
|
||||
assert(debug.getinfo(f).source == '=?' and -- no function has 'source'
|
||||
debug.getinfo(g).source == '=?' and
|
||||
debug.getinfo(g).source == '=?' and
|
||||
debug.getinfo(h).source == '=?')
|
||||
end
|
||||
|
||||
|
|
4
third_party/lua/test/errors.lua
vendored
4
third_party/lua/test/errors.lua
vendored
|
@ -493,7 +493,7 @@ if not _soft then
|
|||
f(3)
|
||||
|
||||
local function loop (x,y,z) return 1 + loop(x, y, z) end
|
||||
|
||||
|
||||
local res, msg = xpcall(loop, function (m)
|
||||
assert(string.find(m, "stack overflow"))
|
||||
checkerr("error handling", loop)
|
||||
|
@ -526,7 +526,7 @@ do
|
|||
-- 'assert' with extra arguments
|
||||
res, msg = pcall(assert, false, "X", t)
|
||||
assert(not res and msg == "X")
|
||||
|
||||
|
||||
-- 'assert' with no message
|
||||
res, msg = pcall(function () assert(false) end)
|
||||
local line = string.match(msg, "%w+%.lua:(%d+): assertion failed!$")
|
||||
|
|
4
third_party/lua/test/heavy.lua
vendored
4
third_party/lua/test/heavy.lua
vendored
|
@ -74,7 +74,7 @@ end
|
|||
function hugeid ()
|
||||
print("loading chunk with huge identifier")
|
||||
local st, msg = loadrep("a", "chars")
|
||||
assert(not st and
|
||||
assert(not st and
|
||||
(string.find(msg, "lexical element too long") or
|
||||
string.find(msg, "not enough memory")))
|
||||
print('+')
|
||||
|
@ -158,7 +158,7 @@ function toomanyidx ()
|
|||
print("expected error: ", msg)
|
||||
print("size:", #a)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- teststring()
|
||||
|
|
2
third_party/lua/test/libs/lib1.c
vendored
2
third_party/lua/test/libs/lib1.c
vendored
|
@ -32,7 +32,7 @@ LUAMOD_API int anotherfunc (lua_State *L) {
|
|||
lua_pushfstring(L, "%d%%%d\n", (int)lua_tointeger(L, 1),
|
||||
(int)lua_tointeger(L, 2));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LUAMOD_API int luaopen_lib1_sub (lua_State *L) {
|
||||
|
|
4
third_party/lua/test/math.lua
vendored
4
third_party/lua/test/math.lua
vendored
|
@ -140,7 +140,7 @@ assert(eqT(3.5 // 1.5, 2.0))
|
|||
assert(eqT(3.5 // -1.5, -3.0))
|
||||
|
||||
do -- tests for different kinds of opcodes
|
||||
local x, y
|
||||
local x, y
|
||||
x = 1; assert(x // 0.0 == 1/0)
|
||||
x = 1.0; assert(x // 0 == 1/0)
|
||||
x = 3.5; assert(eqT(x // 1, 3.0))
|
||||
|
@ -618,7 +618,7 @@ assert(minint % -1 == 0)
|
|||
assert(minint % -2 == 0)
|
||||
assert(maxint % -2 == -1)
|
||||
|
||||
-- non-portable tests because Windows C library cannot compute
|
||||
-- non-portable tests because Windows C library cannot compute
|
||||
-- fmod(1, huge) correctly
|
||||
if not _port then
|
||||
local function anan (x) assert(isNaN(x)) end -- assert Not a Number
|
||||
|
|
6
third_party/lua/test/sort.lua
vendored
6
third_party/lua/test/sort.lua
vendored
|
@ -79,7 +79,7 @@ end
|
|||
print "testing pack"
|
||||
|
||||
a = table.pack()
|
||||
assert(a[1] == undef and a.n == 0)
|
||||
assert(a[1] == undef and a.n == 0)
|
||||
|
||||
a = table.pack(table)
|
||||
assert(a[1] == table and a.n == 1)
|
||||
|
@ -94,8 +94,8 @@ do
|
|||
checkerror("table expected", table.move, 1, 2, 3, 4)
|
||||
|
||||
local function eqT (a, b)
|
||||
for k, v in pairs(a) do assert(b[k] == v) end
|
||||
for k, v in pairs(b) do assert(a[k] == v) end
|
||||
for k, v in pairs(a) do assert(b[k] == v) end
|
||||
for k, v in pairs(b) do assert(a[k] == v) end
|
||||
end
|
||||
|
||||
local a = table.move({10,20,30}, 1, 3, 2) -- move forward
|
||||
|
|
2
third_party/lua/test/strings.lua
vendored
2
third_party/lua/test/strings.lua
vendored
|
@ -331,7 +331,7 @@ do print("testing 'format %a %A'")
|
|||
assert(string.find(string.format("%a", 0/0), "^%-?nan"))
|
||||
assert(string.find(string.format("%a", -0.0), "^%-0x0"))
|
||||
end
|
||||
|
||||
|
||||
if not pcall(string.format, "%.3a", 0) then
|
||||
(Message or print)("\n >>> modifiers for format '%a' not available <<<\n")
|
||||
else
|
||||
|
|
8
third_party/lua/test/tpack.lua
vendored
8
third_party/lua/test/tpack.lua
vendored
|
@ -173,7 +173,7 @@ else
|
|||
assert(pack("f", 24) == pack(">f", 24))
|
||||
end
|
||||
|
||||
print "testing pack/unpack of floating-point numbers"
|
||||
print "testing pack/unpack of floating-point numbers"
|
||||
|
||||
for _, n in ipairs{0, -1.1, 1.9, 1/0, -1/0, 1e20, -1e20, 0.1, 2000.7} do
|
||||
assert(unpack("n", pack("n", n)) == n)
|
||||
|
@ -243,7 +243,7 @@ do
|
|||
assert(#x == packsize("<b h b f d f n i"))
|
||||
local a, b, c, d, e, f, g, h = unpack("<b h b f d f n i", x)
|
||||
assert(a == 1 and b == 2 and c == 3 and d == 4 and e == 5 and f == 6 and
|
||||
g == 7 and h == 8)
|
||||
g == 7 and h == 8)
|
||||
end
|
||||
|
||||
print "testing alignment"
|
||||
|
@ -253,7 +253,7 @@ do
|
|||
assert(#x == packsize(">!8 b Xh i4 i8 c1 Xi8"))
|
||||
assert(x == "\xf4" .. "\0\0\0" ..
|
||||
"\0\0\0\100" ..
|
||||
"\0\0\0\0\0\0\0\xC8" ..
|
||||
"\0\0\0\0\0\0\0\xC8" ..
|
||||
"\xEC" .. "\0\0\0\0\0\0\0")
|
||||
local a, b, c, d, pos = unpack(">!8 c1 Xh i4 i8 b Xi8 XI XH", x)
|
||||
assert(a == "\xF4" and b == 100 and c == 200 and d == -20 and (pos - 1) == #x)
|
||||
|
@ -315,7 +315,7 @@ do -- testing initial position
|
|||
assert(unpack("c0", x, i) == "")
|
||||
end
|
||||
checkerror("out of string", unpack, "c0", x, #x + 2)
|
||||
|
||||
|
||||
end
|
||||
|
||||
print "OK"
|
||||
|
|
6
third_party/lz4cli/util.h
vendored
6
third_party/lz4cli/util.h
vendored
|
@ -32,9 +32,9 @@ extern "C" {
|
|||
******************************************/
|
||||
|
||||
#include "third_party/lz4cli/platform.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/errno.h"
|
||||
|
|
2
third_party/mbedtls/base64.c
vendored
2
third_party/mbedtls/base64.c
vendored
|
@ -48,7 +48,7 @@ static const unsigned char base64_dec_map[128] =
|
|||
#define BASE64_SIZE_T_MAX ( (size_t) -1 ) /* SIZE_T_MAX is not standard */
|
||||
|
||||
/*
|
||||
* Constant flow conditional assignment to unsigned char
|
||||
* Constant flow conditional assignment to unsigned char
|
||||
*/
|
||||
forceinline void mbedtls_base64_cond_assign_uchar( unsigned char * dest,
|
||||
const unsigned char * const src,
|
||||
|
|
2
third_party/mbedtls/bigshift.c
vendored
2
third_party/mbedtls/bigshift.c
vendored
|
@ -80,7 +80,7 @@ int mbedtls_mpi_shift_l(mbedtls_mpi *X, size_t k)
|
|||
m = k / biL;
|
||||
k = k % biL;
|
||||
z = X->n;
|
||||
if (n > X->n && (r = mbedtls_mpi_grow(X, n)))
|
||||
if (n > X->n && (r = mbedtls_mpi_grow(X, n)))
|
||||
return r;
|
||||
if (k)
|
||||
{
|
||||
|
|
2
third_party/mbedtls/cipher.c
vendored
2
third_party/mbedtls/cipher.c
vendored
|
@ -469,7 +469,7 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i
|
|||
*olen = ilen;
|
||||
|
||||
if( ( ret = ctx->cipher_info->base->ecb_func( ctx->cipher_ctx,
|
||||
ctx->operation,
|
||||
ctx->operation,
|
||||
input, output ) ) )
|
||||
{
|
||||
return( ret );
|
||||
|
|
4
third_party/mbedtls/dhm.c
vendored
4
third_party/mbedtls/dhm.c
vendored
|
@ -312,7 +312,7 @@ cleanup:
|
|||
* Pick a random R in the range [2, M) for blinding purposes
|
||||
*/
|
||||
static int dhm_random_below( mbedtls_mpi *R, const mbedtls_mpi *M,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng )
|
||||
{
|
||||
int ret, count;
|
||||
|
@ -342,7 +342,7 @@ cleanup:
|
|||
* Berlin Heidelberg, 1996. p. 104-113.
|
||||
*/
|
||||
static int dhm_update_blinding( mbedtls_dhm_context *ctx,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng )
|
||||
{
|
||||
int ret;
|
||||
|
|
2
third_party/mbedtls/ecp.c
vendored
2
third_party/mbedtls/ecp.c
vendored
|
@ -125,7 +125,7 @@ static inline int ecp_drbg_random( void *p_rng,
|
|||
|
||||
/* DRBG context seeding */
|
||||
static int ecp_drbg_seed( ecp_drbg_context *ctx,
|
||||
const mbedtls_mpi *secret,
|
||||
const mbedtls_mpi *secret,
|
||||
size_t secret_len )
|
||||
{
|
||||
int ret;
|
||||
|
|
2
third_party/mbedtls/ecp_internal.h
vendored
2
third_party/mbedtls/ecp_internal.h
vendored
|
@ -210,7 +210,7 @@ int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
|
|||
*/
|
||||
#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT)
|
||||
int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_point *P,
|
||||
mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng );
|
||||
#endif
|
||||
|
|
2
third_party/mbedtls/md.c
vendored
2
third_party/mbedtls/md.c
vendored
|
@ -365,7 +365,7 @@ int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_inf
|
|||
ctx->md_info = md_info;
|
||||
ctx->md_ctx = NULL;
|
||||
ctx->hmac_ctx = NULL;
|
||||
if ((csize = GetMdContextSize(md_info->type)) < 0)
|
||||
if ((csize = GetMdContextSize(md_info->type)) < 0)
|
||||
return( csize );
|
||||
if( !( ctx->md_ctx = mbedtls_calloc( 1, csize ) ) )
|
||||
return( MBEDTLS_ERR_MD_ALLOC_FAILED );
|
||||
|
|
10
third_party/mbedtls/md.h
vendored
10
third_party/mbedtls/md.h
vendored
|
@ -178,7 +178,7 @@ forceinline int mbedtls_md_starts( mbedtls_md_context_t *ctx )
|
|||
* \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
|
||||
* failure.
|
||||
*/
|
||||
forceinline int mbedtls_md_update( mbedtls_md_context_t *ctx,
|
||||
forceinline int mbedtls_md_update( mbedtls_md_context_t *ctx,
|
||||
const unsigned char *input, size_t ilen )
|
||||
{
|
||||
if( !ctx || !ctx->md_info )
|
||||
|
@ -204,7 +204,7 @@ forceinline int mbedtls_md_update( mbedtls_md_context_t *ctx,
|
|||
* \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
|
||||
* failure.
|
||||
*/
|
||||
forceinline int mbedtls_md_finish( mbedtls_md_context_t *ctx,
|
||||
forceinline int mbedtls_md_finish( mbedtls_md_context_t *ctx,
|
||||
unsigned char *output )
|
||||
{
|
||||
if( !ctx || !ctx->md_info )
|
||||
|
@ -230,7 +230,7 @@ forceinline int mbedtls_md_finish( mbedtls_md_context_t *ctx,
|
|||
* \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
|
||||
* failure.
|
||||
*/
|
||||
forceinline int mbedtls_md( const mbedtls_md_info_t *md_info,
|
||||
forceinline int mbedtls_md( const mbedtls_md_info_t *md_info,
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char *output )
|
||||
{
|
||||
|
@ -264,8 +264,8 @@ int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key,
|
|||
* \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
|
||||
* failure.
|
||||
*/
|
||||
forceinline int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx,
|
||||
const unsigned char *input,
|
||||
forceinline int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx,
|
||||
const unsigned char *input,
|
||||
size_t ilen )
|
||||
{
|
||||
if( ctx == NULL || ctx->md_info == NULL || ctx->hmac_ctx == NULL )
|
||||
|
|
2
third_party/mbedtls/pk.c
vendored
2
third_party/mbedtls/pk.c
vendored
|
@ -475,7 +475,7 @@ int mbedtls_pk_sign_restartable( mbedtls_pk_context *ctx,
|
|||
mbedtls_md_type_t md_alg,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t *sig_len,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng, mbedtls_pk_restart_ctx *rs_ctx )
|
||||
{
|
||||
PK_VALIDATE_RET( ctx );
|
||||
|
|
2
third_party/mbedtls/pk_wrap.c
vendored
2
third_party/mbedtls/pk_wrap.c
vendored
|
@ -309,7 +309,7 @@ cleanup:
|
|||
static int eckey_sign_rs_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t *sig_len,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng, void *rs_ctx )
|
||||
{
|
||||
int ret = MBEDTLS_ERR_THIS_CORRUPTION;
|
||||
|
|
6
third_party/mbedtls/ssl.h
vendored
6
third_party/mbedtls/ssl.h
vendored
|
@ -1514,7 +1514,7 @@ void mbedtls_ssl_set_verify( mbedtls_ssl_context *, int (*)(void *, mbedtls_x509
|
|||
* MBEDTLS_ERR_XXX_ALLOC_FAILED on memory allocation error.
|
||||
*/
|
||||
forceinline int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
|
||||
int endpoint, int transport,
|
||||
int endpoint, int transport,
|
||||
int preset ) {
|
||||
int mbedtls_ssl_config_defaults_impl(mbedtls_ssl_config *, int, int, int,
|
||||
int (*)(mbedtls_ssl_context *));
|
||||
|
@ -1522,13 +1522,13 @@ forceinline int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
|
|||
#if defined(MBEDTLS_SSL_CLI_C)
|
||||
case MBEDTLS_SSL_IS_CLIENT:
|
||||
return mbedtls_ssl_config_defaults_impl(
|
||||
conf, endpoint, transport, preset,
|
||||
conf, endpoint, transport, preset,
|
||||
mbedtls_ssl_handshake_client_step);
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_SRV_C)
|
||||
case MBEDTLS_SSL_IS_SERVER:
|
||||
return mbedtls_ssl_config_defaults_impl(
|
||||
conf, endpoint, transport, preset,
|
||||
conf, endpoint, transport, preset,
|
||||
mbedtls_ssl_handshake_server_step);
|
||||
#endif
|
||||
default:
|
||||
|
|
2
third_party/mbedtls/ssl_ciphersuites.c
vendored
2
third_party/mbedtls/ssl_ciphersuites.c
vendored
|
@ -31,7 +31,7 @@ asm(".include \"libc/disclaimer.inc\"");
|
|||
|
||||
/*
|
||||
* CRYPTOGRAPHY 101
|
||||
*
|
||||
*
|
||||
* OK WEAK BROKEN
|
||||
* ------------------ ------ ------
|
||||
* ECDHE > ECDH > DHE
|
||||
|
|
2
third_party/mbedtls/ssl_srv.c
vendored
2
third_party/mbedtls/ssl_srv.c
vendored
|
@ -1762,7 +1762,7 @@ read_record_header:
|
|||
MBEDTLS_SSL_DEBUG_BUF( 3, "client hello, session id", buf + 35, sess_len );
|
||||
|
||||
ssl->session_negotiate->id_len = sess_len;
|
||||
mbedtls_platform_zeroize( ssl->session_negotiate->id,
|
||||
mbedtls_platform_zeroize( ssl->session_negotiate->id,
|
||||
sizeof( ssl->session_negotiate->id ) );
|
||||
memcpy( ssl->session_negotiate->id, buf + 35,
|
||||
ssl->session_negotiate->id_len );
|
||||
|
|
|
@ -17,25 +17,4 @@ TkwxETAPBgNVBAoTCFBvbGFyU1NMMRwwGgYDVQQDExNQb2xhcnNzbCBUZXN0IEVD
|
|||
IENBggkAwUPifmJDzOgwCgYIKoZIzj0EAwQDaQAwZgIxAL/VFrDIYUECsS0rVpAy
|
||||
6zt/CqeAZ1sa/l5LTaG1XW286n2Kibipr6EpkYZNYIQILgIxAI0wb3Py1DHPWpYf
|
||||
/BFBH7C3KYq+nWTrLeEnhrjU1LzG/CiQ8lnuskya6lw/P3lJ/A==
|
||||
-----END X509 CRL----- M third_party/mbedtls/base64.c
|
||||
M third_party/mbedtls/bigshift.c
|
||||
M third_party/mbedtls/cipher.c
|
||||
M third_party/mbedtls/dhm.c
|
||||
M third_party/mbedtls/ecp.c
|
||||
M third_party/mbedtls/ecp_internal.h
|
||||
M third_party/mbedtls/md.c
|
||||
M third_party/mbedtls/md.h
|
||||
M third_party/mbedtls/pk.c
|
||||
M third_party/mbedtls/pk_wrap.c
|
||||
M third_party/mbedtls/ssl.h
|
||||
M third_party/mbedtls/ssl_ciphersuites.c
|
||||
M third_party/mbedtls/ssl_srv.c
|
||||
M third_party/mbedtls/test/data/crl-malformed-trailing-spaces.pem
|
||||
M third_party/mbedtls/test/data/dir4/Readme
|
||||
M third_party/mbedtls/test/data/server10_int3_int-ca2_ca.crt
|
||||
M third_party/mbedtls/test/data/server7_trailing_space.crt
|
||||
M third_party/mbedtls/test/data/server9-with-ca.crt
|
||||
M third_party/mbedtls/test/test_suite_ssl.c
|
||||
M third_party/mbedtls/x509.h
|
||||
M third_party/mbedtls/x509write_crt.c
|
||||
|
||||
-----END X509 CRL-----
|
||||
|
|
6
third_party/mbedtls/test/data/dir4/Readme
vendored
6
third_party/mbedtls/test/data/dir4/Readme
vendored
|
@ -1,4 +1,4 @@
|
|||
This directory contains the certificates for the tests targeting the enforcement of the policy indicated by the *pathLenConstraint* field. All leaf elements were generated with *is_ca* unset and all roots with the *selfsign=1* option.
|
||||
This directory contains the certificates for the tests targeting the enforcement of the policy indicated by the *pathLenConstraint* field. All leaf elements were generated with *is_ca* unset and all roots with the *selfsign=1* option.
|
||||
|
||||
1. zero pathlen constraint on an intermediate CA (invalid)
|
||||
```
|
||||
|
@ -17,7 +17,7 @@ cert31.crt (max_pathlen=1) -> cert32.crt -> cert33.crt -> cert34.crt
|
|||
|
||||
4. nonzero pathlen constraint on an intermediate CA (invalid)
|
||||
```
|
||||
cert41.crt -> cert42.crt (max_pathlen=1) -> cert43.crt -> cert44.crt -> cert45.crt
|
||||
cert41.crt -> cert42.crt (max_pathlen=1) -> cert43.crt -> cert44.crt -> cert45.crt
|
||||
```
|
||||
|
||||
5. nonzero pathlen constraint on an intermediate CA with maximum number of elements in the chain (valid)
|
||||
|
@ -30,7 +30,7 @@ cert51.crt -> cert52.crt (max_pathlen=1) -> cert53.crt -> cert54.crt
|
|||
cert61.crt (max_pathlen=1) -> cert62.crt -> cert63.crt
|
||||
```
|
||||
|
||||
7. pathlen constraint on the root CA with maximum number of elements and a self signed certificate in the chain (valid)
|
||||
7. pathlen constraint on the root CA with maximum number of elements and a self signed certificate in the chain (valid)
|
||||
(This situation happens for example when a root of some hierarchy gets integrated into another hierarchy. In this case the certificates issued before the integration will have an intermadiate self signed certificate in their chain)
|
||||
```
|
||||
cert71.crt (max_pathlen=1) -> cert72.crt -> cert73.crt (self signed) -> cert74.crt -> cert74.crt
|
||||
|
|
|
@ -72,11 +72,11 @@ Certificate:
|
|||
a2:d5
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Basic Constraints:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
X509v3 Subject Key Identifier:
|
||||
X509v3 Subject Key Identifier:
|
||||
B4:5A:E4:A5:B3:DE:D2:52:F6:B9:D5:A6:95:0F:EB:3E:BC:C7:FD:FF
|
||||
X509v3 Authority Key Identifier:
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:B4:5A:E4:A5:B3:DE:D2:52:F6:B9:D5:A6:95:0F:EB:3E:BC:C7:FD:FF
|
||||
DirName:/C=NL/O=PolarSSL/CN=PolarSSL Test CA
|
||||
serial:00
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDwjCCAaqgAwIBAgIBEDANBgkqhkiG9w0BAQsFADBIMQswCQYDVQQGEwJOTDER
|
||||
MA8GA1UEChMIUG9sYXJTU0wxJjAkBgNVBAMTHVBvbGFyU1NMIFRlc3QgSW50ZXJt
|
||||
ZWRpYXRlIENBMB4XDTEzMDkyNDE2MTIyNFoXDTIzMDkyMjE2MTIyNFowNDELMAkG
|
||||
A1UEBhMCTkwxETAPBgNVBAoTCFBvbGFyU1NMMRIwEAYDVQQDEwlsb2NhbGhvc3Qw
|
||||
WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQcbffp2qXqoZyychmoCRxzrd4Vu96m
|
||||
47NPBehtEC46aTeXgDnBdf++znABrAtfXBRNQz8ARIeYBmskr22rlKjyo4GVMIGS
|
||||
MAkGA1UdEwQCMAAwHQYDVR0OBBYEFNIK06V3H85VsFxGoo5zbL+hYCa7MGYGA1Ud
|
||||
IwRfMF2AFDh32Gt3nCh3gotO2BupHveUFrcOoUKkQDA+MQswCQYDVQQGEwJOTDER
|
||||
MA8GA1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0GC
|
||||
AQ4wDQYJKoZIhvcNAQELBQADggIBADRoQ5fHKw+vkl0D3aqLX1XrZidb+25AWbhr
|
||||
FYXdaskN219PrXBL3cV8x5tK6qsPKSyyw1lue80OmhXs/w7PJkOHHUSWRnmTv7lr
|
||||
8Us3Zr/yOF/VVqzdGs7DlOTpyzEBdugI9uar/aCqHDoltN8wOduOoQB9aojYpROj
|
||||
+gjlEO0mgt/87XpjYOig1o0jv44QYDQZQzpj1zeIn6WMe6xk9YDwCLMjRIpg++c7
|
||||
QyxvcEJTn80wX1SaEBM2gau97G7bORLMwBVkMT4oSY+iKYgpPpawOnMJbqUP73Dm
|
||||
yfJExDdrW/BbWZ/vKIcSqSZIbkHdkNjUDVHczyVwQxZxzvLFw/B1k9s7jYFsi5eK
|
||||
TNAdXFa4et1H2sd+uhu24GxsjmJioDrftixcgzPVBjDCjH8QWkBEX292WJ58on0e
|
||||
deWLpZUnzPdE1B4rsiPw1Vg28mGgr2O1xgBQr/fx6A+8ItNTzAXbZfEcult9ypwM
|
||||
0b6YDNe5IvdKk8iwz3mof0VNy47K6xoCaE/fxxWkjoXK8x2wfswGeP2QgUzQE93b
|
||||
OtjdHpsG1c7gIVFQmKATyAPUz4vqmezgNRleXU0oL0PYtoCmKQ51UjNMUfmO9xCj
|
||||
VJaNa2iTQ5Dgic+CW4TYAgj5/9g9X3WfwnDNxrZ0UxxawGElczHXqbrNleTtPaKp
|
||||
a8Si6UK5
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEATCCA4egAwIBAgIBDjAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G
|
||||
A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN
|
||||
MTMwOTI0MTU1NTE0WhcNMjMwOTIyMTU1NTE0WjBIMQswCQYDVQQGEwJOTDERMA8G
|
||||
A1UEChMIUG9sYXJTU0wxJjAkBgNVBAMTHVBvbGFyU1NMIFRlc3QgSW50ZXJtZWRp
|
||||
YXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo1Oc8nr6fMTq
|
||||
vowV+CpC55i5BZGFGc50Eb4RLBSRTH1e7JepdFjAVbBtyQRJSiY1ja0tgLQDDKZR
|
||||
wfEI+b4azse460InPHv7C1TN0upXlxuj6m9B1IlP+sBaM7WBC6dVfPO+jVMIxgkF
|
||||
CaBCLhhdK1Fjf8HjkT/PkctWnho8NTwivc9+nqRZjXe/eIcqm5HwjDDhu+gz+o0g
|
||||
Vz9MfZNi1JyCrOyNZcy+cr2QeNnNVGnFq8xTxtu6dLunhpmLFj2mm0Vjwa7Ypj5q
|
||||
AjpqTMtDvqbRuToyoyzajhMNcCAf7gwzIupJJFVdjdtgYAcQwzikwF5HoITJzzJ2
|
||||
qgxF7CmvGZNb7G99mLdLdhtclH3wAQKHYwEGJo7XKyNEuHPQgB+e0cg1SD1HqlAM
|
||||
uCfGGTWQ6me7Bjan3t0NzoTdDq6IpKTesbaY+/9e2xn8DCrhBKLXQMZFDZqUoLYA
|
||||
kGPOEGgvlPnIIXAawouxCaNYEh5Uw871YMSPT28rLdFr49dwYOtDg9foA8hDIW2P
|
||||
d6KXbrZteesvA1nYzEOs+3AjrbT79Md2W8Bz9bqBVNlNOESSqm4kiCJFmslm/6br
|
||||
Np0MSQd+o22PQ4xRtmP6UsTfU0ueiMpYc8TYYhMbfnfFyo4m707ebcflPbBEN2dg
|
||||
updQ66cvfCJB0QJt9upafY0lpdV1qUkCAwEAAaOBoDCBnTAdBgNVHQ4EFgQUOHfY
|
||||
a3ecKHeCi07YG6ke95QWtw4wbgYDVR0jBGcwZYAUnW0gJEkBPyvLeLUZvH4kydv7
|
||||
NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UE
|
||||
AxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAwGA1UdEwQFMAMBAf8w
|
||||
CgYIKoZIzj0EAwIDaAAwZQIxAPyE+u+eP7gRrSFjQicmpYg8jiFUCYEowWY2zuOG
|
||||
i1HXYwmpDHfasQ3rNSuf/gHvjwIwbSSjumDk+uYNci/KMELDsD0MFHxZhhBc9Hp9
|
||||
Af5cNR8KhzegznL6amRObGGKmX1F
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDwjCCAaqgAwIBAgIBEDANBgkqhkiG9w0BAQsFADBIMQswCQYDVQQGEwJOTDER
|
||||
MA8GA1UEChMIUG9sYXJTU0wxJjAkBgNVBAMTHVBvbGFyU1NMIFRlc3QgSW50ZXJt
|
||||
ZWRpYXRlIENBMB4XDTEzMDkyNDE2MTIyNFoXDTIzMDkyMjE2MTIyNFowNDELMAkG
|
||||
A1UEBhMCTkwxETAPBgNVBAoTCFBvbGFyU1NMMRIwEAYDVQQDEwlsb2NhbGhvc3Qw
|
||||
WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQcbffp2qXqoZyychmoCRxzrd4Vu96m
|
||||
47NPBehtEC46aTeXgDnBdf++znABrAtfXBRNQz8ARIeYBmskr22rlKjyo4GVMIGS
|
||||
MAkGA1UdEwQCMAAwHQYDVR0OBBYEFNIK06V3H85VsFxGoo5zbL+hYCa7MGYGA1Ud
|
||||
IwRfMF2AFDh32Gt3nCh3gotO2BupHveUFrcOoUKkQDA+MQswCQYDVQQGEwJOTDER
|
||||
MA8GA1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0GC
|
||||
AQ4wDQYJKoZIhvcNAQELBQADggIBADRoQ5fHKw+vkl0D3aqLX1XrZidb+25AWbhr
|
||||
FYXdaskN219PrXBL3cV8x5tK6qsPKSyyw1lue80OmhXs/w7PJkOHHUSWRnmTv7lr
|
||||
8Us3Zr/yOF/VVqzdGs7DlOTpyzEBdugI9uar/aCqHDoltN8wOduOoQB9aojYpROj
|
||||
+gjlEO0mgt/87XpjYOig1o0jv44QYDQZQzpj1zeIn6WMe6xk9YDwCLMjRIpg++c7
|
||||
QyxvcEJTn80wX1SaEBM2gau97G7bORLMwBVkMT4oSY+iKYgpPpawOnMJbqUP73Dm
|
||||
yfJExDdrW/BbWZ/vKIcSqSZIbkHdkNjUDVHczyVwQxZxzvLFw/B1k9s7jYFsi5eK
|
||||
TNAdXFa4et1H2sd+uhu24GxsjmJioDrftixcgzPVBjDCjH8QWkBEX292WJ58on0e
|
||||
deWLpZUnzPdE1B4rsiPw1Vg28mGgr2O1xgBQr/fx6A+8ItNTzAXbZfEcult9ypwM
|
||||
0b6YDNe5IvdKk8iwz3mof0VNy47K6xoCaE/fxxWkjoXK8x2wfswGeP2QgUzQE93b
|
||||
OtjdHpsG1c7gIVFQmKATyAPUz4vqmezgNRleXU0oL0PYtoCmKQ51UjNMUfmO9xCj
|
||||
VJaNa2iTQ5Dgic+CW4TYAgj5/9g9X3WfwnDNxrZ0UxxawGElczHXqbrNleTtPaKp
|
||||
a8Si6UK5
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEATCCA4egAwIBAgIBDjAKBggqhkjOPQQDAjA+MQswCQYDVQQGEwJOTDERMA8G
|
||||
A1UEChMIUG9sYXJTU0wxHDAaBgNVBAMTE1BvbGFyc3NsIFRlc3QgRUMgQ0EwHhcN
|
||||
MTMwOTI0MTU1NTE0WhcNMjMwOTIyMTU1NTE0WjBIMQswCQYDVQQGEwJOTDERMA8G
|
||||
A1UEChMIUG9sYXJTU0wxJjAkBgNVBAMTHVBvbGFyU1NMIFRlc3QgSW50ZXJtZWRp
|
||||
YXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo1Oc8nr6fMTq
|
||||
vowV+CpC55i5BZGFGc50Eb4RLBSRTH1e7JepdFjAVbBtyQRJSiY1ja0tgLQDDKZR
|
||||
wfEI+b4azse460InPHv7C1TN0upXlxuj6m9B1IlP+sBaM7WBC6dVfPO+jVMIxgkF
|
||||
CaBCLhhdK1Fjf8HjkT/PkctWnho8NTwivc9+nqRZjXe/eIcqm5HwjDDhu+gz+o0g
|
||||
Vz9MfZNi1JyCrOyNZcy+cr2QeNnNVGnFq8xTxtu6dLunhpmLFj2mm0Vjwa7Ypj5q
|
||||
AjpqTMtDvqbRuToyoyzajhMNcCAf7gwzIupJJFVdjdtgYAcQwzikwF5HoITJzzJ2
|
||||
qgxF7CmvGZNb7G99mLdLdhtclH3wAQKHYwEGJo7XKyNEuHPQgB+e0cg1SD1HqlAM
|
||||
uCfGGTWQ6me7Bjan3t0NzoTdDq6IpKTesbaY+/9e2xn8DCrhBKLXQMZFDZqUoLYA
|
||||
kGPOEGgvlPnIIXAawouxCaNYEh5Uw871YMSPT28rLdFr49dwYOtDg9foA8hDIW2P
|
||||
d6KXbrZteesvA1nYzEOs+3AjrbT79Md2W8Bz9bqBVNlNOESSqm4kiCJFmslm/6br
|
||||
Np0MSQd+o22PQ4xRtmP6UsTfU0ueiMpYc8TYYhMbfnfFyo4m707ebcflPbBEN2dg
|
||||
updQ66cvfCJB0QJt9upafY0lpdV1qUkCAwEAAaOBoDCBnTAdBgNVHQ4EFgQUOHfY
|
||||
a3ecKHeCi07YG6ke95QWtw4wbgYDVR0jBGcwZYAUnW0gJEkBPyvLeLUZvH4kydv7
|
||||
NnyhQqRAMD4xCzAJBgNVBAYTAk5MMREwDwYDVQQKEwhQb2xhclNTTDEcMBoGA1UE
|
||||
AxMTUG9sYXJzc2wgVGVzdCBFQyBDQYIJAMFD4n5iQ8zoMAwGA1UdEwQFMAMBAf8w
|
||||
CgYIKoZIzj0EAwIDaAAwZQIxAPyE+u+eP7gRrSFjQicmpYg8jiFUCYEowWY2zuOG
|
||||
i1HXYwmpDHfasQ3rNSuf/gHvjwIwbSSjumDk+uYNci/KMELDsD0MFHxZhhBc9Hp9
|
||||
Af5cNR8KhzegznL6amRObGGKmX1F
|
||||
-----END CERTIFICATE-----
|
||||
|
|
|
@ -51,11 +51,11 @@ Certificate:
|
|||
a2:d5
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Basic Constraints:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
X509v3 Subject Key Identifier:
|
||||
X509v3 Subject Key Identifier:
|
||||
B4:5A:E4:A5:B3:DE:D2:52:F6:B9:D5:A6:95:0F:EB:3E:BC:C7:FD:FF
|
||||
X509v3 Authority Key Identifier:
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:B4:5A:E4:A5:B3:DE:D2:52:F6:B9:D5:A6:95:0F:EB:3E:BC:C7:FD:FF
|
||||
DirName:/C=NL/O=PolarSSL/CN=PolarSSL Test CA
|
||||
serial:00
|
||||
|
|
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
|
@ -1038,7 +1038,7 @@ int mbedtls_move_handshake_to_state( mbedtls_ssl_context *ssl,
|
|||
enum { BUFFSIZE = 1024 };
|
||||
int max_steps = 1000;
|
||||
int ret = 0;
|
||||
|
||||
|
||||
if( ssl == NULL || second_ssl == NULL )
|
||||
{
|
||||
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
||||
|
|
2
third_party/mbedtls/x509.h
vendored
2
third_party/mbedtls/x509.h
vendored
|
@ -6,7 +6,7 @@
|
|||
#include "third_party/mbedtls/rsa.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
/* clang-format off */
|
||||
|
||||
|
||||
#define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE -0x2080 /*< Unavailable feature, e.g. RSA hashing/encryption combination. */
|
||||
#define MBEDTLS_ERR_X509_UNKNOWN_OID -0x2100 /*< Requested OID is unknown. */
|
||||
#define MBEDTLS_ERR_X509_INVALID_FORMAT -0x2180 /*< The CRT/CRL/CSR format is invalid, e.g. different type expected. */
|
||||
|
|
2
third_party/mbedtls/x509write_crt.c
vendored
2
third_party/mbedtls/x509write_crt.c
vendored
|
@ -237,7 +237,7 @@ int mbedtls_x509write_crt_set_validity( mbedtls_x509write_cert *ctx,
|
|||
*/
|
||||
int mbedtls_x509write_crt_set_extension( mbedtls_x509write_cert *ctx,
|
||||
const char *oid, size_t oid_len,
|
||||
int critical, const unsigned char *val,
|
||||
int critical, const unsigned char *val,
|
||||
size_t val_len )
|
||||
{
|
||||
return( mbedtls_x509_set_extension( &ctx->extensions, oid, oid_len,
|
||||
|
|
118
third_party/python/Include/Python-ast.h
generated
vendored
118
third_party/python/Include/Python-ast.h
generated
vendored
|
@ -51,19 +51,19 @@ struct _mod {
|
|||
struct {
|
||||
asdl_seq *body;
|
||||
} Module;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *body;
|
||||
} Interactive;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty body;
|
||||
} Expression;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *body;
|
||||
} Suite;
|
||||
|
||||
|
||||
} v;
|
||||
};
|
||||
|
||||
|
@ -85,7 +85,7 @@ struct _stmt {
|
|||
asdl_seq *decorator_list;
|
||||
expr_ty returns;
|
||||
} FunctionDef;
|
||||
|
||||
|
||||
struct {
|
||||
identifier name;
|
||||
arguments_ty args;
|
||||
|
@ -93,7 +93,7 @@ struct _stmt {
|
|||
asdl_seq *decorator_list;
|
||||
expr_ty returns;
|
||||
} AsyncFunctionDef;
|
||||
|
||||
|
||||
struct {
|
||||
identifier name;
|
||||
asdl_seq *bases;
|
||||
|
@ -101,108 +101,108 @@ struct _stmt {
|
|||
asdl_seq *body;
|
||||
asdl_seq *decorator_list;
|
||||
} ClassDef;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} Return;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *targets;
|
||||
} Delete;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *targets;
|
||||
expr_ty value;
|
||||
} Assign;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty target;
|
||||
operator_ty op;
|
||||
expr_ty value;
|
||||
} AugAssign;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty target;
|
||||
expr_ty annotation;
|
||||
expr_ty value;
|
||||
int simple;
|
||||
} AnnAssign;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty target;
|
||||
expr_ty iter;
|
||||
asdl_seq *body;
|
||||
asdl_seq *orelse;
|
||||
} For;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty target;
|
||||
expr_ty iter;
|
||||
asdl_seq *body;
|
||||
asdl_seq *orelse;
|
||||
} AsyncFor;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty test;
|
||||
asdl_seq *body;
|
||||
asdl_seq *orelse;
|
||||
} While;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty test;
|
||||
asdl_seq *body;
|
||||
asdl_seq *orelse;
|
||||
} If;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *items;
|
||||
asdl_seq *body;
|
||||
} With;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *items;
|
||||
asdl_seq *body;
|
||||
} AsyncWith;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty exc;
|
||||
expr_ty cause;
|
||||
} Raise;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *body;
|
||||
asdl_seq *handlers;
|
||||
asdl_seq *orelse;
|
||||
asdl_seq *finalbody;
|
||||
} Try;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty test;
|
||||
expr_ty msg;
|
||||
} Assert;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *names;
|
||||
} Import;
|
||||
|
||||
|
||||
struct {
|
||||
identifier module;
|
||||
asdl_seq *names;
|
||||
int level;
|
||||
} ImportFrom;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *names;
|
||||
} Global;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *names;
|
||||
} Nonlocal;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} Expr;
|
||||
|
||||
|
||||
} v;
|
||||
int lineno;
|
||||
int col_offset;
|
||||
|
@ -224,145 +224,145 @@ struct _expr {
|
|||
boolop_ty op;
|
||||
asdl_seq *values;
|
||||
} BoolOp;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty left;
|
||||
operator_ty op;
|
||||
expr_ty right;
|
||||
} BinOp;
|
||||
|
||||
|
||||
struct {
|
||||
unaryop_ty op;
|
||||
expr_ty operand;
|
||||
} UnaryOp;
|
||||
|
||||
|
||||
struct {
|
||||
arguments_ty args;
|
||||
expr_ty body;
|
||||
} Lambda;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty test;
|
||||
expr_ty body;
|
||||
expr_ty orelse;
|
||||
} IfExp;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *keys;
|
||||
asdl_seq *values;
|
||||
} Dict;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *elts;
|
||||
} Set;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty elt;
|
||||
asdl_seq *generators;
|
||||
} ListComp;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty elt;
|
||||
asdl_seq *generators;
|
||||
} SetComp;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty key;
|
||||
expr_ty value;
|
||||
asdl_seq *generators;
|
||||
} DictComp;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty elt;
|
||||
asdl_seq *generators;
|
||||
} GeneratorExp;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} Await;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} Yield;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} YieldFrom;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty left;
|
||||
asdl_int_seq *ops;
|
||||
asdl_seq *comparators;
|
||||
} Compare;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty func;
|
||||
asdl_seq *args;
|
||||
asdl_seq *keywords;
|
||||
} Call;
|
||||
|
||||
|
||||
struct {
|
||||
object n;
|
||||
} Num;
|
||||
|
||||
|
||||
struct {
|
||||
string s;
|
||||
} Str;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
int conversion;
|
||||
expr_ty format_spec;
|
||||
} FormattedValue;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *values;
|
||||
} JoinedStr;
|
||||
|
||||
|
||||
struct {
|
||||
bytes s;
|
||||
} Bytes;
|
||||
|
||||
|
||||
struct {
|
||||
singleton value;
|
||||
} NameConstant;
|
||||
|
||||
|
||||
struct {
|
||||
constant value;
|
||||
} Constant;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
identifier attr;
|
||||
expr_context_ty ctx;
|
||||
} Attribute;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
slice_ty slice;
|
||||
expr_context_ty ctx;
|
||||
} Subscript;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
expr_context_ty ctx;
|
||||
} Starred;
|
||||
|
||||
|
||||
struct {
|
||||
identifier id;
|
||||
expr_context_ty ctx;
|
||||
} Name;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *elts;
|
||||
expr_context_ty ctx;
|
||||
} List;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *elts;
|
||||
expr_context_ty ctx;
|
||||
} Tuple;
|
||||
|
||||
|
||||
} v;
|
||||
int lineno;
|
||||
int col_offset;
|
||||
|
@ -377,15 +377,15 @@ struct _slice {
|
|||
expr_ty upper;
|
||||
expr_ty step;
|
||||
} Slice;
|
||||
|
||||
|
||||
struct {
|
||||
asdl_seq *dims;
|
||||
} ExtSlice;
|
||||
|
||||
|
||||
struct {
|
||||
expr_ty value;
|
||||
} Index;
|
||||
|
||||
|
||||
} v;
|
||||
};
|
||||
|
||||
|
@ -405,7 +405,7 @@ struct _excepthandler {
|
|||
identifier name;
|
||||
asdl_seq *body;
|
||||
} ExceptHandler;
|
||||
|
||||
|
||||
} v;
|
||||
int lineno;
|
||||
int col_offset;
|
||||
|
|
8
third_party/python/Include/Python.h
vendored
8
third_party/python/Include/Python.h
vendored
|
@ -2,9 +2,9 @@
|
|||
#define Py_PYTHON_H
|
||||
/* clang-format off */
|
||||
|
||||
/*
|
||||
* PYTHON DIAMOND DEPENDENCY HEADER
|
||||
*
|
||||
/*
|
||||
* PYTHON DIAMOND DEPENDENCY HEADER
|
||||
*
|
||||
* If your editor isn't able to automatically insert #include lines,
|
||||
* then this header can make development easier. It's also great for
|
||||
* making beginner's tutorials simpler and more attractive.
|
||||
|
@ -12,7 +12,7 @@
|
|||
* However it's sloppy to use something like this in the long term since
|
||||
* it's not a scalable dependency model. It makes builds slower, because
|
||||
* changing any single header will invalidate all the build artifacts.
|
||||
*
|
||||
*
|
||||
* So please consider doing the conscientious thing and avoid using it!
|
||||
*/
|
||||
|
||||
|
|
|
@ -454,8 +454,8 @@ inline T _Py_ANNOTATE_UNPROTECTED_READ(const volatile T &x) {
|
|||
#define _Py_ANNOTATE_HAPPENS_BEFORE(obj)
|
||||
#define _Py_ANNOTATE_HAPPENS_AFTER(obj)
|
||||
#define _Py_ANNOTATE_PUBLISH_MEMORY_RANGE(address, size)
|
||||
#define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size)
|
||||
#define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size)
|
||||
#define _Py_ANNOTATE_UNPUBLISH_MEMORY_RANGE(address, size)
|
||||
#define _Py_ANNOTATE_SWAP_MEMORY_RANGE(address, size)
|
||||
#define _Py_ANNOTATE_PCQ_CREATE(pcq)
|
||||
#define _Py_ANNOTATE_PCQ_DESTROY(pcq)
|
||||
#define _Py_ANNOTATE_PCQ_PUT(pcq)
|
||||
|
|
|
@ -28,6 +28,6 @@ class x(Command):
|
|||
|
||||
def finalize_options(self):
|
||||
if self.x is None:
|
||||
self.x =
|
||||
self.x =
|
||||
|
||||
def run(self):
|
||||
|
|
|
@ -14,7 +14,7 @@ PORTTIME = -lporttime
|
|||
#--EndConfig
|
||||
|
||||
#DEBUG = -C-W -C-Wall
|
||||
DEBUG =
|
||||
DEBUG =
|
||||
|
||||
#the following modules are optional. you will want to compile
|
||||
#everything you can, but you can ignore ones you don't have
|
||||
|
@ -31,8 +31,8 @@ scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
|
|||
_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
|
||||
pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
|
||||
|
||||
GFX = src/SDL_gfx/SDL_gfxPrimitives.c
|
||||
#GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
|
||||
GFX = src/SDL_gfx/SDL_gfxPrimitives.c
|
||||
#GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
|
||||
gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
|
||||
|
||||
|
||||
|
|
102
third_party/python/Lib/test/cfgparser.2
vendored
102
third_party/python/Lib/test/cfgparser.2
vendored
|
@ -3,19 +3,19 @@
|
|||
# here. Samba has a huge number of configurable options (perhaps too
|
||||
# many!) most of which are not shown in this example
|
||||
#
|
||||
# Any line which starts with a ; (semi-colon) or a # (hash)
|
||||
# Any line which starts with a ; (semi-colon) or a # (hash)
|
||||
# is a comment and is ignored. In this example we will use a #
|
||||
# for commentry and a ; for parts of the config file that you
|
||||
# may wish to enable
|
||||
#
|
||||
# NOTE: Whenever you modify this file you should run the command #"testparm" # to check that you have not made any basic syntactic #errors.
|
||||
# NOTE: Whenever you modify this file you should run the command #"testparm" # to check that you have not made any basic syntactic #errors.
|
||||
#
|
||||
#======================= Global Settings =====================================
|
||||
[global]
|
||||
|
||||
# 1. Server Naming Options:
|
||||
# workgroup = NT-Domain-Name or Workgroup-Name
|
||||
|
||||
|
||||
workgroup = MDKGROUP
|
||||
|
||||
# netbios name is the name you will see in "Network Neighbourhood",
|
||||
|
@ -24,7 +24,7 @@
|
|||
; netbios name = <name_of_this_server>
|
||||
|
||||
# server string is the equivalent of the NT Description field
|
||||
|
||||
|
||||
server string = Samba Server %v
|
||||
|
||||
# Message command is run by samba when a "popup" message is sent to it.
|
||||
|
@ -36,20 +36,20 @@
|
|||
# (as cups is now used in linux-mandrake 7.2 by default)
|
||||
# if you want to automatically load your printer list rather
|
||||
# than setting them up individually then you'll need this
|
||||
|
||||
|
||||
printcap name = lpstat
|
||||
load printers = yes
|
||||
|
||||
# It should not be necessary to spell out the print system type unless
|
||||
# yours is non-standard. Currently supported print systems include:
|
||||
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
|
||||
|
||||
|
||||
printing = cups
|
||||
|
||||
# Samba 2.2 supports the Windows NT-style point-and-print feature. To
|
||||
# use this, you need to be able to upload print drivers to the samba
|
||||
# server. The printer admins (or root) may install drivers onto samba.
|
||||
# Note that this feature uses the print$ share, so you will need to
|
||||
# Note that this feature uses the print$ share, so you will need to
|
||||
# enable it below.
|
||||
# This parameter works like domain admin group:
|
||||
# printer admin = @<group> <user>
|
||||
|
@ -92,7 +92,7 @@
|
|||
|
||||
# Use password server option only with security = server or security = # domain
|
||||
# When using security = domain, you should use password server = *
|
||||
; password server =
|
||||
; password server =
|
||||
; password server = *
|
||||
|
||||
# Password Level allows matching of _n_ characters of the password for
|
||||
|
@ -122,7 +122,7 @@
|
|||
# enable pam password change
|
||||
; pam password change = yes
|
||||
; passwd program = /usr/bin/passwd %u
|
||||
; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password*
|
||||
; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password*
|
||||
# %n\n
|
||||
;*passwd:*all*authentication*tokens*updated*successfully*
|
||||
|
||||
|
@ -137,7 +137,7 @@
|
|||
# Options for using winbind. Winbind allows you to do all account and
|
||||
# authentication from a Windows or samba domain controller, creating
|
||||
# accounts on the fly, and maintaining a mapping of Windows RIDs to
|
||||
# unix uid's
|
||||
# unix uid's
|
||||
# and gid's. winbind uid and winbind gid are the only required
|
||||
# parameters.
|
||||
#
|
||||
|
@ -163,8 +163,8 @@
|
|||
; template homedir = /home/%D/%U
|
||||
|
||||
# When using winbind, you may want to have samba create home
|
||||
# directories on the fly for authenticated users. Ensure that
|
||||
# /etc/pam.d/samba is using 'service=system-auth-winbind' in pam_stack
|
||||
# directories on the fly for authenticated users. Ensure that
|
||||
# /etc/pam.d/samba is using 'service=system-auth-winbind' in pam_stack
|
||||
# modules, and then enable obedience of pam restrictions below:
|
||||
; obey pam restrictions = yes
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
|||
# Configure Samba to use multiple interfaces
|
||||
# If you have multiple network interfaces then you must list them
|
||||
# here. See the man page for details.
|
||||
; interfaces = 192.168.12.2/24 192.168.13.2/24
|
||||
; interfaces = 192.168.12.2/24 192.168.13.2/24
|
||||
|
||||
# Configure remote browse list synchronisation here
|
||||
# request announcement to, or browse list sync from:
|
||||
|
@ -201,14 +201,14 @@
|
|||
# Domain Master specifies Samba to be the Domain Master Browser. This
|
||||
# allows Samba to collate browse lists between subnets. Don't use this
|
||||
# if you already have a Windows NT domain controller doing this job
|
||||
; domain master = yes
|
||||
; domain master = yes
|
||||
|
||||
# Preferred Master causes Samba to force a local browser election on
|
||||
# startup and gives it a slightly higher chance of winning the election
|
||||
; preferred master = yes
|
||||
|
||||
# 6. Domain Control Options:
|
||||
# Enable this if you want Samba to be a domain logon server for
|
||||
# Enable this if you want Samba to be a domain logon server for
|
||||
# Windows95 workstations or Primary Domain Controller for WinNT and
|
||||
# Win2k
|
||||
|
||||
|
@ -232,16 +232,16 @@
|
|||
; logon home = \\%L\%U\.profile
|
||||
|
||||
# The add user script is used by a domain member to add local user
|
||||
# accounts that have been authenticated by the domain controller, or by
|
||||
# the domain controller to add local machine accounts when adding
|
||||
# accounts that have been authenticated by the domain controller, or by
|
||||
# the domain controller to add local machine accounts when adding
|
||||
# machines to the domain.
|
||||
# The script must work from the command line when replacing the macros,
|
||||
# or the operation will fail. Check that groups exist if forcing a
|
||||
# or the operation will fail. Check that groups exist if forcing a
|
||||
# group.
|
||||
# Script for domain controller for adding machines:
|
||||
; add user script = /usr/sbin/useradd -d /dev/null -g machines –c
|
||||
# 'Machine Account' -s /bin/false -M %u
|
||||
# Script for domain controller with LDAP backend for adding machines
|
||||
# Script for domain controller with LDAP backend for adding machines
|
||||
#(please
|
||||
# configure in /etc/samba/smbldap_conf.pm first):
|
||||
; add user script = /usr/share/samba/scripts/smbldap-useradd.pl -w –d
|
||||
|
@ -264,7 +264,7 @@
|
|||
# LDAP configuration for Domain Controlling:
|
||||
# The account (dn) that samba uses to access the LDAP server
|
||||
# This account needs to have write access to the LDAP tree
|
||||
# You will need to give samba the password for this dn, by
|
||||
# You will need to give samba the password for this dn, by
|
||||
# running 'smbpasswd -w mypassword'
|
||||
; ldap admin dn = cn=root,dc=mydomain,dc=com
|
||||
; ldap ssl = start_tls
|
||||
|
@ -277,16 +277,16 @@
|
|||
# 7. Name Resolution Options:
|
||||
# All NetBIOS names must be resolved to IP Addresses
|
||||
# 'Name Resolve Order' allows the named resolution mechanism to be
|
||||
# specified the default order is "host lmhosts wins bcast". "host"
|
||||
# means use the unix system gethostbyname() function call that will use
|
||||
# either /etc/hosts OR DNS or NIS depending on the settings of
|
||||
# specified the default order is "host lmhosts wins bcast". "host"
|
||||
# means use the unix system gethostbyname() function call that will use
|
||||
# either /etc/hosts OR DNS or NIS depending on the settings of
|
||||
# /etc/host.config, /etc/nsswitch.conf
|
||||
# and the /etc/resolv.conf file. "host" therefore is system
|
||||
# configuration dependent. This parameter is most often of use to
|
||||
# and the /etc/resolv.conf file. "host" therefore is system
|
||||
# configuration dependent. This parameter is most often of use to
|
||||
# prevent DNS lookups
|
||||
# in order to resolve NetBIOS names to IP Addresses. Use with care!
|
||||
# The example below excludes use of name resolution for machines that
|
||||
# are NOT on the local network segment - OR - are not deliberately to
|
||||
# are NOT on the local network segment - OR - are not deliberately to
|
||||
# be known via lmhosts or via WINS.
|
||||
; name resolve order = wins lmhosts bcast
|
||||
|
||||
|
@ -296,7 +296,7 @@
|
|||
; wins support = yes
|
||||
|
||||
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
|
||||
# Note: Samba can be either a WINS Server, or a WINS Client, but
|
||||
# Note: Samba can be either a WINS Server, or a WINS Client, but
|
||||
# NOT both
|
||||
; wins server = w.x.y.z
|
||||
|
||||
|
@ -305,11 +305,11 @@
|
|||
# at least one WINS Server on the network. The default is NO.
|
||||
; wins proxy = yes
|
||||
|
||||
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
|
||||
# names via DNS nslookups. The built-in default for versions 1.9.17 is
|
||||
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS
|
||||
# names via DNS nslookups. The built-in default for versions 1.9.17 is
|
||||
# yes, this has been changed in version 1.9.18 to no.
|
||||
|
||||
dns proxy = no
|
||||
dns proxy = no
|
||||
|
||||
# 8. File Naming Options:
|
||||
# Case Preservation can be handy - system default is _no_
|
||||
|
@ -325,7 +325,7 @@
|
|||
# you can match a Windows code page with a UNIX character set.
|
||||
# Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),
|
||||
# 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),
|
||||
# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean
|
||||
# 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean
|
||||
# Hangul),
|
||||
# 950 (Trad. Chin.).
|
||||
# UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
|
||||
|
@ -373,7 +373,7 @@
|
|||
; guest ok = yes
|
||||
|
||||
|
||||
# NOTE: If you have a CUPS print system there is no need to
|
||||
# NOTE: If you have a CUPS print system there is no need to
|
||||
# specifically define each individual printer.
|
||||
# You must configure the samba printers with the appropriate Windows
|
||||
# drivers on your Windows clients. On the Samba server no filtering is
|
||||
|
@ -395,9 +395,9 @@
|
|||
# print command: see above for details.
|
||||
# =====================================
|
||||
|
||||
print command = lpr-cups -P %p -o raw %s -r
|
||||
print command = lpr-cups -P %p -o raw %s -r
|
||||
# using client side printer drivers.
|
||||
; print command = lpr-cups -P %p %s
|
||||
; print command = lpr-cups -P %p %s
|
||||
# using cups own drivers (use generic PostScript on clients).
|
||||
# The following two commands are the samba defaults for printing=cups
|
||||
# change them only if you need different options:
|
||||
|
@ -406,11 +406,11 @@
|
|||
|
||||
# This share is used for Windows NT-style point-and-print support.
|
||||
# To be able to install drivers, you need to be either root, or listed
|
||||
# in the printer admin parameter above. Note that you also need write
|
||||
# access to the directory and share definition to be able to upload the
|
||||
# in the printer admin parameter above. Note that you also need write
|
||||
# access to the directory and share definition to be able to upload the
|
||||
# drivers.
|
||||
# For more information on this, please see the Printing Support Section
|
||||
# of /usr/share/doc/samba-/docs/Samba-HOWTO-Collection.pdf
|
||||
# of /usr/share/doc/samba-/docs/Samba-HOWTO-Collection.pdf
|
||||
|
||||
[print$]
|
||||
path = /var/lib/samba/printers
|
||||
|
@ -419,7 +419,7 @@
|
|||
write list = @adm root
|
||||
|
||||
# A useful application of samba is to make a PDF-generation service
|
||||
# To streamline this, install windows postscript drivers (preferably
|
||||
# To streamline this, install windows postscript drivers (preferably
|
||||
# colour)on the samba server, so that clients can automatically install
|
||||
# them.
|
||||
|
||||
|
@ -455,11 +455,11 @@
|
|||
# Uncomment next line.
|
||||
; vfs object = /usr/lib/samba/vfs/audit.so
|
||||
|
||||
# Other examples.
|
||||
# Other examples.
|
||||
#
|
||||
# A private printer, usable only by Fred. Spool data will be placed in
|
||||
# Fred's
|
||||
# home directory. Note that fred must have write access to the spool
|
||||
# home directory. Note that fred must have write access to the spool
|
||||
# directory,
|
||||
# wherever it is.
|
||||
;[fredsprn]
|
||||
|
@ -473,7 +473,7 @@
|
|||
|
||||
|
||||
-----------------------------------------------------------
|
||||
# A private directory, usable only by Fred. Note that Fred requires
|
||||
# A private directory, usable only by Fred. Note that Fred requires
|
||||
# write access to the directory.
|
||||
|
||||
;[fredsdir]
|
||||
|
@ -493,8 +493,8 @@
|
|||
|
||||
-----------------------------------------------------------
|
||||
|
||||
# a service which has a different directory for each machine that
|
||||
# connects this allows you to tailor configurations to incoming
|
||||
# a service which has a different directory for each machine that
|
||||
# connects this allows you to tailor configurations to incoming
|
||||
# machines. You could also use the %u option to tailor it by user name.
|
||||
# The %m gets replaced with the machine name that is connecting.
|
||||
;[pchome]
|
||||
|
@ -506,10 +506,10 @@
|
|||
|
||||
-----------------------------------------------------------
|
||||
# A publicly accessible directory, read/write to all users. Note that
|
||||
# all files created in the directory by users will be owned by the
|
||||
# default user, so any user with access can delete any other user's
|
||||
# files. Obviously this directory must be writable by the default user.
|
||||
# Another user could of course be specified, in which case all files
|
||||
# all files created in the directory by users will be owned by the
|
||||
# default user, so any user with access can delete any other user's
|
||||
# files. Obviously this directory must be writable by the default user.
|
||||
# Another user could of course be specified, in which case all files
|
||||
# would be owned by that user instead.
|
||||
|
||||
;[public]
|
||||
|
@ -521,10 +521,10 @@
|
|||
|
||||
-----------------------------------------------------------
|
||||
|
||||
# The following two entries demonstrate how to share a directory so
|
||||
# that two users can place files there that will be owned by the
|
||||
# specific users. In this setup, the directory should be writable by
|
||||
# both users and should have the sticky bit set on it to prevent abuse.
|
||||
# The following two entries demonstrate how to share a directory so
|
||||
# that two users can place files there that will be owned by the
|
||||
# specific users. In this setup, the directory should be writable by
|
||||
# both users and should have the sticky bit set on it to prevent abuse.
|
||||
# Obviously this could be extended to as many users as required.
|
||||
|
||||
;[myshare]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue