]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Include the SPDX license identifier 0BSD to generated files.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 12 Feb 2024 15:09:10 +0000 (17:09 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 14 Feb 2024 16:31:16 +0000 (18:31 +0200)
Perhaps the generated files aren't even copyrightable but
using the same license for them as for the rest of the liblzma
keeps things more consistent for tools that look for license info.

src/liblzma/check/crc32_table_be.h
src/liblzma/check/crc32_table_le.h
src/liblzma/check/crc32_tablegen.c
src/liblzma/check/crc64_table_be.h
src/liblzma/check/crc64_table_le.h
src/liblzma/check/crc64_tablegen.c
src/liblzma/lz/lz_encoder_hash_table.h
src/liblzma/lzma/fastpos_table.c
src/liblzma/lzma/fastpos_tablegen.c
src/liblzma/rangecoder/price_table.c
src/liblzma/rangecoder/price_tablegen.c

index c483cb670dcbbf16ce31d5d53fe1cd6df45705ed..505c23074c1136beed71e051a5f0f4800b1e7c30 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
 
 const uint32_t lzma_crc32_table[8][256] = {
        {
index 25f4fc44353746abef8eda95e0da3e2b58b96852..e89c21a7b23d6bf64b221a3331fbb1d1618967d3 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
 
 const uint32_t lzma_crc32_table[8][256] = {
        {
index 81042e727e275dd41f533dee69d05ed9cb8070ec..01047d3eca4716daa6488ad94f25582013d5571c 100644 (file)
@@ -53,9 +53,11 @@ init_crc32_table(void)
 static void
 print_crc32_table(void)
 {
-       printf("/* This file has been automatically generated by "
-                       "crc32_tablegen.c. */\n\n"
-                       "const uint32_t lzma_crc32_table[8][256] = {\n\t{");
+       // Split the SPDX string so that it won't accidentally match
+       // when tools search for the string.
+       printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+               "// This file has been generated by crc32_tablegen.c.\n\n"
+               "const uint32_t lzma_crc32_table[8][256] = {\n\t{");
 
        for (size_t s = 0; s < 8; ++s) {
                for (size_t b = 0; b < 256; ++b) {
@@ -81,9 +83,11 @@ print_crc32_table(void)
 static void
 print_lz_table(void)
 {
-       printf("/* This file has been automatically generated by "
-                       "crc32_tablegen.c. */\n\n"
-                       "const uint32_t lzma_lz_hash_table[256] = {");
+       // Split the SPDX string so that it won't accidentally match
+       // when tools search for the string.
+       printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+               "// This file has been generated by crc32_tablegen.c.\n\n"
+               "const uint32_t lzma_lz_hash_table[256] = {");
 
        for (size_t b = 0; b < 256; ++b) {
                if ((b % 4) == 0)
index ea074f397a70bc1a347668e9bdbd8c9d5131b1ae..db76cc70e07c74ca1b6b06eb7b4f5158207189a3 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc64_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc64_tablegen.c.
 
 const uint64_t lzma_crc64_table[4][256] = {
        {
index 1196b31e13236f67aacc64a6531f5005314f2822..e40a8c82105ea391b76cf08b511c1c15adc04597 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc64_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc64_tablegen.c.
 
 const uint64_t lzma_crc64_table[4][256] = {
        {
index 2c45516b559fe46cf19c0c1936f1f5a09aaa0695..af93e011ca21d00f5bcbe2f2b21cf5f024482662 100644 (file)
@@ -52,9 +52,11 @@ init_crc64_table(void)
 static void
 print_crc64_table(void)
 {
-       printf("/* This file has been automatically generated by "
-                       "crc64_tablegen.c. */\n\n"
-                       "const uint64_t lzma_crc64_table[4][256] = {\n\t{");
+       // Split the SPDX string so that it won't accidentally match
+       // when tools search for the string.
+       printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+               "// This file has been generated by crc64_tablegen.c.\n\n"
+               "const uint64_t lzma_crc64_table[4][256] = {\n\t{");
 
        for (size_t s = 0; s < 4; ++s) {
                for (size_t b = 0; b < 256; ++b) {
index 8c51717d704fe5ca56368e847be015cb7d127333..2b3a60e43e80168a238beaf0d1478c8df9e51088 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
 
 const uint32_t lzma_lz_hash_table[256] = {
        0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
index 6a3ceac0e90ac112142bc9c139161f040163eb2a..4e10e3795e294d1ff4ba1e82e9accdcb03597a27 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by fastpos_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by fastpos_tablegen.c.
 
 #include "common.h"
 #include "fastpos.h"
index cb8e3eb9544b9e512dffe7f2f247bb95de9b5e95..957ccb7a6436276bc801b8f1b7a0800406d48c0d 100644 (file)
@@ -34,11 +34,13 @@ main(void)
                        fastpos[c] = slot_fast;
        }
 
-       printf("/* This file has been automatically generated "
-                       "by fastpos_tablegen.c. */\n\n"
-                       "#include \"common.h\"\n"
-                       "#include \"fastpos.h\"\n\n"
-                       "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {");
+       // Split the SPDX string so that it won't accidentally match
+       // when tools search for the string.
+       printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+               "// This file has been generated by fastpos_tablegen.c.\n\n"
+               "#include \"common.h\"\n"
+               "#include \"fastpos.h\"\n\n"
+               "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {");
 
        for (size_t i = 0; i < (1 << FASTPOS_BITS); ++i) {
                if (i % 16 == 0)
index ac64bf62c767248cb113b3e15355bc4c7fdc65a3..c33433f718ca32224da5a29c1458ad9b8380e157 100644 (file)
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by price_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by price_tablegen.c.
 
 #include "range_encoder.h"
 
index 3ab587ebcfdbeac24801ae6dbcfbd13ca31a0939..4b6ca37efadfcb16e8e12168e6d86ac30f44120a 100644 (file)
@@ -58,11 +58,13 @@ init_price_table(void)
 static void
 print_price_table(void)
 {
-       printf("/* This file has been automatically generated by "
-                       "price_tablegen.c. */\n\n"
-                       "#include \"range_encoder.h\"\n\n"
-                       "const uint8_t lzma_rc_prices["
-                       "RC_PRICE_TABLE_SIZE] = {");
+       // Split the SPDX string so that it won't accidentally match
+       // when tools search for the string.
+       printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+               "// This file has been generated by price_tablegen.c.\n\n"
+               "#include \"range_encoder.h\"\n\n"
+               "const uint8_t lzma_rc_prices["
+               "RC_PRICE_TABLE_SIZE] = {");
 
        const size_t array_size = sizeof(lzma_rc_prices)
                        / sizeof(lzma_rc_prices[0]);