mirror of
				https://git.tukaani.org/xz.git
				synced 2025-11-04 07:22:55 +00:00 
			
		
		
		
	liblzma: Move lzma_crcXX_table[][] declarations to crc_common.h
LZ encoder needs lzma_crc32_table[0] but otherwise those tables are private to the CRC code. In contrast, the other things in check.h are needed in several places.
This commit is contained in:
		
							parent
							
								
									85b081f5d4
								
							
						
					
					
						commit
						7484d37538
					
				@ -95,24 +95,6 @@ typedef struct {
 | 
			
		||||
} lzma_check_state;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// lzma_crc32_table[0] is needed by LZ encoder so we need to keep
 | 
			
		||||
/// the array two-dimensional.
 | 
			
		||||
#ifdef HAVE_SMALL
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern uint32_t lzma_crc32_table[1][256];
 | 
			
		||||
 | 
			
		||||
extern void lzma_crc32_init(void);
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern const uint32_t lzma_crc32_table[8][256];
 | 
			
		||||
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern const uint64_t lzma_crc64_table[4][256];
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// \brief      Initialize *check depending on type
 | 
			
		||||
extern void lzma_check_init(lzma_check_state *check, lzma_check type);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -10,8 +10,11 @@
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#include "check.h"
 | 
			
		||||
#include "crc_common.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// The table is used by the LZ encoder too, thus it's not static like
 | 
			
		||||
// in crc64_small.c.
 | 
			
		||||
uint32_t lzma_crc32_table[1][256];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -38,6 +38,24 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// lzma_crc32_table[0] is needed by LZ encoder so we need to keep
 | 
			
		||||
/// the array two-dimensional.
 | 
			
		||||
#ifdef HAVE_SMALL
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern uint32_t lzma_crc32_table[1][256];
 | 
			
		||||
 | 
			
		||||
extern void lzma_crc32_init(void);
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern const uint32_t lzma_crc32_table[8][256];
 | 
			
		||||
 | 
			
		||||
lzma_attr_visibility_hidden
 | 
			
		||||
extern const uint64_t lzma_crc64_table[4][256];
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Keep this in sync with changes to crc32_arm64.h
 | 
			
		||||
#if defined(_WIN32) || defined(HAVE_GETAUXVAL) \
 | 
			
		||||
		|| defined(HAVE_ELF_AUX_INFO) \
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,8 @@
 | 
			
		||||
#ifndef LZMA_LZ_ENCODER_HASH_H
 | 
			
		||||
#define LZMA_LZ_ENCODER_HASH_H
 | 
			
		||||
 | 
			
		||||
// We need to know if CRC32_GENERIC is defined.
 | 
			
		||||
// We need to know if CRC32_GENERIC is defined and we may need the declaration
 | 
			
		||||
// of lzma_crc32_table[][].
 | 
			
		||||
#include "crc_common.h"
 | 
			
		||||
 | 
			
		||||
// If HAVE_SMALL is defined, then lzma_crc32_table[][] exists and
 | 
			
		||||
@ -28,7 +29,6 @@
 | 
			
		||||
// then lzma_crc32_table[][] doesn't exist.
 | 
			
		||||
#if defined(HAVE_SMALL) \
 | 
			
		||||
		|| (defined(CRC32_GENERIC) && !defined(WORDS_BIGENDIAN))
 | 
			
		||||
#	include "check.h"
 | 
			
		||||
#	define hash_table lzma_crc32_table[0]
 | 
			
		||||
#else
 | 
			
		||||
	// lz_encoder.c takes care of including the actual table.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user