diff options
-rw-r--r-- | checksum.c | 24 | ||||
-rw-r--r-- | compat.c | 20 | ||||
-rw-r--r-- | rsync.h | 2 |
3 files changed, 25 insertions, 21 deletions
@@ -42,21 +42,23 @@ extern int protocol_version; extern int proper_seed_order; extern const char *checksum_choice; -struct name_num_obj valid_checksums = { - "checksum", NULL, NULL, 0, 0, { +struct name_num_item valid_checksums_items[] = { #ifdef SUPPORT_XXH3 - { CSUM_XXH3_128, "xxh128", NULL }, - { CSUM_XXH3_64, "xxh3", NULL }, + { CSUM_XXH3_128, "xxh128", NULL }, + { CSUM_XXH3_64, "xxh3", NULL }, #endif #ifdef SUPPORT_XXHASH - { CSUM_XXH64, "xxh64", NULL }, - { CSUM_XXH64, "xxhash", NULL }, + { CSUM_XXH64, "xxh64", NULL }, + { CSUM_XXH64, "xxhash", NULL }, #endif - { CSUM_MD5, "md5", NULL }, - { CSUM_MD4, "md4", NULL }, - { CSUM_NONE, "none", NULL }, - { 0, NULL, NULL } - } + { CSUM_MD5, "md5", NULL }, + { CSUM_MD4, "md4", NULL }, + { CSUM_NONE, "none", NULL }, + { 0, NULL, NULL } +}; + +struct name_num_obj valid_checksums = { + "checksum", NULL, NULL, 0, 0, valid_checksums_items }; int xfersum_type = 0; /* used for the file transfer checksums */ @@ -91,19 +91,21 @@ int filesfrom_convert = 0; #define MAX_NSTR_STRLEN 256 -struct name_num_obj valid_compressions = { - "compress", NULL, NULL, 0, 0, { +struct name_num_item valid_compressions_items[] = { #ifdef SUPPORT_ZSTD - { CPRES_ZSTD, "zstd", NULL }, + { CPRES_ZSTD, "zstd", NULL }, #endif #ifdef SUPPORT_LZ4 - { CPRES_LZ4, "lz4", NULL }, + { CPRES_LZ4, "lz4", NULL }, #endif - { CPRES_ZLIBX, "zlibx", NULL }, - { CPRES_ZLIB, "zlib", NULL }, - { CPRES_NONE, "none", NULL }, - { 0, NULL, NULL } - } + { CPRES_ZLIBX, "zlibx", NULL }, + { CPRES_ZLIB, "zlib", NULL }, + { CPRES_NONE, "none", NULL }, + { 0, NULL, NULL } +}; + +struct name_num_obj valid_compressions = { + "compress", NULL, NULL, 0, 0, valid_compressions_items }; #define CF_INC_RECURSE (1<<0) @@ -1172,7 +1172,7 @@ struct name_num_obj { uchar *saw; int saw_len; int negotiated_num; - struct name_num_item list[10]; /* we'll get a compile error/warning if this is ever too small */ + struct name_num_item *list; }; #ifdef EXTERNAL_ZLIB |