Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf7849f

Browse files
author
Neil Conway
committed
License cleanup: crypt.c and qsort.c to latest NetBSD CVS sources, to
pickup license clarification (3-clause BSD is now used). Add licenseterms to memcmp.c (also from NetBSD), which previously had none.Finally, pickup an upstream fix to crypt.c (const-ify some arrays).
1 parent1b7f214 commitaf7849f

File tree

3 files changed

+62
-40
lines changed

3 files changed

+62
-40
lines changed

‎src/port/crypt.c

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@
1111
* modification, are permitted provided that the following conditions
1212
* are met:
1313
* 1. Redistributions of source code must retain the above copyright
14-
* notice, this list of conditions and the following disclaimer.
14+
* notice, this list of conditions and the following disclaimer.
1515
* 2. Redistributions in binary form must reproduce the above copyright
16-
* notice, this list of conditions and the following disclaimer in the
17-
* documentation and/or other materials provided with the distribution.
18-
* 3. All advertising materials mentioning features or use of this software
19-
* must display the following acknowledgement:
20-
*This product includes software developed by the University of
21-
*California, Berkeley and its contributors.
22-
* 4. Neither the name of the University nor the names of its contributors
23-
* may be used to endorse or promote products derived from this software
24-
* without specific prior written permission.
16+
* notice, this list of conditions and the following disclaimer in the
17+
* documentation and/or other materials provided with the distribution.
18+
* 3. Neither the name of the University nor the names of its contributors
19+
* may be used to endorse or promote products derived from this software
20+
* without specific prior written permission.
2521
*
2622
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2723
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2824
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29-
* ARE DISCLAIMED.IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25+
* ARE DISCLAIMED.IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3026
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3127
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3228
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -337,7 +333,7 @@ intchars_in;
337333

338334
/* ===== (mostly) Standard DES Tables ==================== */
339335

340-
staticunsignedcharIP[]= {/* initial permutation */
336+
staticconstunsignedcharIP[]= {/* initial permutation */
341337
58,50,42,34,26,18,10,2,
342338
60,52,44,36,28,20,12,4,
343339
62,54,46,38,30,22,14,6,
@@ -350,7 +346,7 @@ static unsigned char IP[] = {/* initial permutation */
350346

351347
/* The final permutation is the inverse of IP - no table is necessary */
352348

353-
staticunsignedcharExpandTr[]= {/* expansion operation */
349+
staticconstunsignedcharExpandTr[]= {/* expansion operation */
354350
32,1,2,3,4,5,
355351
4,5,6,7,8,9,
356352
8,9,10,11,12,13,
@@ -361,7 +357,7 @@ static unsigned char ExpandTr[] = {/* expansion operation */
361357
28,29,30,31,32,1,
362358
};
363359

364-
staticunsignedcharPC1[]= {/* permuted choice table 1 */
360+
staticconstunsignedcharPC1[]= {/* permuted choice table 1 */
365361
57,49,41,33,25,17,9,
366362
1,58,50,42,34,26,18,
367363
10,2,59,51,43,35,27,
@@ -373,12 +369,12 @@ static unsigned char PC1[] = {/* permuted choice table 1 */
373369
21,13,5,28,20,12,4,
374370
};
375371

376-
staticunsignedcharRotates[]= {/* PC1 rotation schedule */
372+
staticconstunsignedcharRotates[]= {/* PC1 rotation schedule */
377373
1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1,
378374
};
379375

380376
/* note: each "row" of PC2 is left-padded with bits that make it invertible */
381-
staticunsignedcharPC2[]= {/* permuted choice table 2 */
377+
staticconstunsignedcharPC2[]= {/* permuted choice table 2 */
382378
9,18,14,17,11,24,1,5,
383379
22,25,3,28,15,6,21,10,
384380
35,38,23,19,12,4,26,8,
@@ -390,7 +386,7 @@ static unsigned char PC2[] = {/* permuted choice table 2 */
390386
0,0,46,42,50,36,29,32,
391387
};
392388

393-
staticunsignedcharS[8][64]= {/* 48->32 bit substitution tables */
389+
staticconstunsignedcharS[8][64]= {/* 48->32 bit substitution tables */
394390
/* S[1]*/
395391
{14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,
396392
0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,
@@ -433,7 +429,7 @@ static unsigned char S[8][64] = {/* 48->32 bit substitution tables */
433429
2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11}
434430
};
435431

436-
staticunsignedcharP32Tr[]= {/* 32-bit permutation function */
432+
staticconstunsignedcharP32Tr[]= {/* 32-bit permutation function */
437433
16,7,20,21,
438434
29,12,28,17,
439435
1,15,23,26,
@@ -444,7 +440,7 @@ static unsigned char P32Tr[] = {/* 32-bit permutation function */
444440
22,11,4,25,
445441
};
446442

447-
staticunsignedcharCIFP[]= {/* compressed/interleaved permutation */
443+
staticconstunsignedcharCIFP[]= {/* compressed/interleaved permutation */
448444
1,2,3,4,17,18,19,20,
449445
5,6,7,8,21,22,23,24,
450446
9,10,11,12,25,26,27,28,
@@ -456,7 +452,7 @@ static unsigned char CIFP[] = { /* compressed/interleaved permutation */
456452
45,46,47,48,61,62,63,64,
457453
};
458454

459-
staticunsignedcharitoa64[]=/* 0..63 => ascii-64 */
455+
staticconstunsignedcharitoa64[]=/* 0..63 => ascii-64 */
460456
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
461457

462458

‎src/port/memcmp.c

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,46 @@
44
* compares memory bytes
55
*
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
7-
* Portions Copyright (c) 1994, Regents of the University of California
87
*
98
*
109
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/port/memcmp.c,v 1.5 2004/08/29 04:13:12 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/memcmp.c,v 1.6 2004/10/05 00:12:49 neilc Exp $
1211
*
1312
* This file was taken from NetBSD and is used by SunOS because memcmp
14-
* on that platform does not properly compare negative bytes.
13+
* on that platform does not properly compare negative bytes. The
14+
* NetBSD copyright terms follow.
15+
*/
16+
17+
/*-
18+
* Copyright (c) 1990, 1993
19+
*The Regents of the University of California. All rights reserved.
20+
*
21+
* This code is derived from software contributed to Berkeley by
22+
* Chris Torek.
23+
*
24+
* Redistribution and use in source and binary forms, with or without
25+
* modification, are permitted provided that the following conditions
26+
* are met:
27+
* 1. Redistributions of source code must retain the above copyright
28+
* notice, this list of conditions and the following disclaimer.
29+
* 2. Redistributions in binary form must reproduce the above copyright
30+
* notice, this list of conditions and the following disclaimer in the
31+
* documentation and/or other materials provided with the distribution.
32+
* 3. Neither the name of the University nor the names of its contributors
33+
* may be used to endorse or promote products derived from this software
34+
* without specific prior written permission.
1535
*
16-
*-------------------------------------------------------------------------
36+
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
37+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39+
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
40+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46+
* SUCH DAMAGE.
1747
*/
1848

1949
#include<string.h>

‎src/port/qsort.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
2-
*Copied from NetBSDCVS, 2002-07-19, bjm
3-
*Add do ... while() macro fix
4-
*Remove __inline, _DIAGASSERTs, __P
2+
*Modifications fromvanillaNetBSDsource:
3+
*Add do ... while() macro fix
4+
*Remove __inline, _DIAGASSERTs, __P
55
*
6-
*$PostgreSQL: pgsql/src/port/qsort.c,v 1.4 2003/11/29 19:52:13 pgsql Exp $
6+
*$PostgreSQL: pgsql/src/port/qsort.c,v 1.5 2004/10/05 00:12:49 neilc Exp $
77
*/
88

9-
/*$NetBSD: qsort.c,v 1.12 1999/09/20 04:39:40 lukem Exp $*/
9+
/*$NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $*/
1010

1111
/*-
1212
* Copyright (c) 1992, 1993
@@ -16,22 +16,18 @@
1616
* modification, are permitted provided that the following conditions
1717
* are met:
1818
* 1. Redistributions of source code must retain the above copyright
19-
* notice, this list of conditions and the following disclaimer.
19+
* notice, this list of conditions and the following disclaimer.
2020
* 2. Redistributions in binary form must reproduce the above copyright
21-
* notice, this list of conditions and the following disclaimer in the
22-
* documentation and/or other materials provided with the distribution.
23-
* 3. All advertising materials mentioning features or use of this software
24-
* must display the following acknowledgement:
25-
*This product includes software developed by the University of
26-
*California, Berkeley and its contributors.
27-
* 4. Neither the name of the University nor the names of its contributors
28-
* may be used to endorse or promote products derived from this software
29-
* without specific prior written permission.
21+
* notice, this list of conditions and the following disclaimer in the
22+
* documentation and/or other materials provided with the distribution.
23+
* 3. Neither the name of the University nor the names of its contributors
24+
* may be used to endorse or promote products derived from this software
25+
* without specific prior written permission.
3026
*
3127
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
3228
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3329
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34-
* ARE DISCLAIMED.IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30+
* ARE DISCLAIMED.IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3531
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3632
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3733
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp