Skip to content

Commit 71c3678

Browse files
lorddoskiaskdave
authored andcommitted
lib/zstd: convert constants to defines
These constants are really used internally by zstd and including linux/zstd.h into users results in the following warnings: In file included from fs/btrfs/zstd.c:19: ./include/linux/zstd.h:798:21: warning: ‘ZSTD_skippableHeaderSize’ defined but not used [-Wunused-const-variable=] 798 | static const size_t ZSTD_skippableHeaderSize = 8; | ^~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/zstd.h:796:21: warning: ‘ZSTD_frameHeaderSize_max’ defined but not used [-Wunused-const-variable=] 796 | static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX; | ^~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/zstd.h:795:21: warning: ‘ZSTD_frameHeaderSize_min’ defined but not used [-Wunused-const-variable=] 795 | static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN; | ^~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/zstd.h:794:21: warning: ‘ZSTD_frameHeaderSize_prefix’ defined but not used [-Wunused-const-variable=] 794 | static const size_t ZSTD_frameHeaderSize_prefix = 5; So fix those warnings by turning the constants into defines. Reviewed-by: Nick Terrell <terrelln@fb.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 8c31a3d commit 71c3678

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/linux/zstd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,11 +791,11 @@ size_t ZSTD_DStreamOutSize(void);
791791
/* for static allocation */
792792
#define ZSTD_FRAMEHEADERSIZE_MAX 18
793793
#define ZSTD_FRAMEHEADERSIZE_MIN 6
794-
static const size_t ZSTD_frameHeaderSize_prefix = 5;
795-
static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
796-
static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
794+
#define ZSTD_frameHeaderSize_prefix 5
795+
#define ZSTD_frameHeaderSize_min ZSTD_FRAMEHEADERSIZE_MIN
796+
#define ZSTD_frameHeaderSize_max ZSTD_FRAMEHEADERSIZE_MAX
797797
/* magic number + skippable frame length */
798-
static const size_t ZSTD_skippableHeaderSize = 8;
798+
#define ZSTD_skippableHeaderSize 8
799799

800800

801801
/*-*************************************

0 commit comments

Comments
 (0)