Remove use of INLINE

It's #define'd to 'inline', and only used in the GLZ encoder.
This commit is contained in:
Alon Levy 2013-10-31 16:21:22 +02:00 committed by Frediano Ziglio
parent 5acc017638
commit 87c4def087
5 changed files with 18 additions and 20 deletions

View File

@ -28,10 +28,10 @@
/* if image_distance = 0, pixel_distance is the distance between the matching pixels.
Otherwise, it is the offset from the beginning of the referred image */
#if defined(GLZ_ENCODE_MATCH) /* actually performing the encoding */
static INLINE void encode_match(Encoder *encoder, uint32_t image_distance,
static inline void encode_match(Encoder *encoder, uint32_t image_distance,
size_t pixel_distance, size_t len)
#elif defined(GLZ_ENCODE_SIZE) /* compute the size of the encoding except for the match length*/
static INLINE int get_encode_ref_size(uint32_t image_distance, size_t pixel_distance)
static inline int get_encode_ref_size(uint32_t image_distance, size_t pixel_distance)
#endif
{
#if defined(GLZ_ENCODE_SIZE)

View File

@ -144,7 +144,7 @@
/* returns the length of the match. 0 if no match.
if image_distance = 0, pixel_distance is the distance between the matching pixels.
Otherwise, it is the offset from the beginning of the referred image */
static INLINE size_t FNAME(do_match)(SharedDictionary *dict,
static inline size_t FNAME(do_match)(SharedDictionary *dict,
WindowImageSegment *ref_seg, const PIXEL *ref,
const PIXEL *ref_limit,
WindowImageSegment *ip_seg, const PIXEL *ip,

View File

@ -50,7 +50,7 @@ typedef struct Encoder {
/**************************************************************************
* Handling writing the encoded image to the output buffer
***************************************************************************/
static INLINE int more_io_bytes(Encoder *encoder)
static inline int more_io_bytes(Encoder *encoder)
{
uint8_t *io_ptr;
int num_io_bytes = encoder->usr->more_space(encoder->usr, &io_ptr);
@ -60,7 +60,7 @@ static INLINE int more_io_bytes(Encoder *encoder)
return num_io_bytes;
}
static INLINE void encode(Encoder *encoder, uint8_t byte)
static inline void encode(Encoder *encoder, uint8_t byte)
{
if (encoder->io.now == encoder->io.end) {
if (more_io_bytes(encoder) <= 0) {
@ -73,7 +73,7 @@ static INLINE void encode(Encoder *encoder, uint8_t byte)
*(encoder->io.now++) = byte;
}
static INLINE void encode_32(Encoder *encoder, unsigned int word)
static inline void encode_32(Encoder *encoder, unsigned int word)
{
encode(encoder, (uint8_t)(word >> 24));
encode(encoder, (uint8_t)(word >> 16) & 0x0000ff);
@ -81,26 +81,26 @@ static INLINE void encode_32(Encoder *encoder, unsigned int word)
encode(encoder, (uint8_t)(word & 0x0000ff));
}
static INLINE void encode_64(Encoder *encoder, uint64_t word)
static inline void encode_64(Encoder *encoder, uint64_t word)
{
encode_32(encoder, (uint32_t)(word >> 32));
encode_32(encoder, (uint32_t)(word & 0xffffff));
}
static INLINE void encode_copy_count(Encoder *encoder, uint8_t copy_count)
static inline void encode_copy_count(Encoder *encoder, uint8_t copy_count)
{
encode(encoder, copy_count);
encoder->io.last_copy = encoder->io.now - 1; // io_now cannot be the first byte of the buffer
}
static INLINE void update_copy_count(Encoder *encoder, uint8_t copy_count)
static inline void update_copy_count(Encoder *encoder, uint8_t copy_count)
{
GLZ_ASSERT(encoder->usr, encoder->io.last_copy);
*(encoder->io.last_copy) = copy_count;
}
// decrease the io ptr by 1
static INLINE void compress_output_prev(Encoder *encoder)
static inline void compress_output_prev(Encoder *encoder)
{
// io_now cannot be the first byte of the buffer
encoder->io.now--;

View File

@ -55,7 +55,5 @@ struct GlzEncoderUsrContext {
#endif
#define INLINE inline
#endif

View File

@ -27,7 +27,7 @@
/* turning all used images to free ones. If they are alive, calling the free_image callback for
each one */
static INLINE void __glz_dictionary_window_reset_images(SharedDictionary *dict)
static inline void __glz_dictionary_window_reset_images(SharedDictionary *dict)
{
WindowImage *tmp;
@ -108,7 +108,7 @@ static void glz_dictionary_window_reset(SharedDictionary *dict)
__glz_dictionary_window_reset_images(dict);
}
static INLINE void glz_dictionary_reset_hash(SharedDictionary *dict)
static inline void glz_dictionary_reset_hash(SharedDictionary *dict)
{
memset(dict->htab, 0, sizeof(HashEntry) * HASH_SIZE * HASH_CHAIN_SIZE);
#ifdef CHAINED_HASH
@ -116,7 +116,7 @@ static INLINE void glz_dictionary_reset_hash(SharedDictionary *dict)
#endif
}
static INLINE void glz_dictionary_window_destroy(SharedDictionary *dict)
static inline void glz_dictionary_window_destroy(SharedDictionary *dict)
{
__glz_dictionary_window_reset_images(dict);
@ -139,7 +139,7 @@ static INLINE void glz_dictionary_window_destroy(SharedDictionary *dict)
}
/* logic removal only */
static INLINE void glz_dictionary_window_kill_image(SharedDictionary *dict, WindowImage *image)
static inline void glz_dictionary_window_kill_image(SharedDictionary *dict, WindowImage *image)
{
image->is_alive = FALSE;
}
@ -255,7 +255,7 @@ void glz_enc_dictionary_remove_image(GlzEncDictContext *opaque_dict,
Mutators of the window. Should be called by the encoder before and after encoding.
***********************************************************************************/
static INLINE int __get_pixels_num(LzImageType image_type, unsigned int num_lines, int stride)
static inline int __get_pixels_num(LzImageType image_type, unsigned int num_lines, int stride)
{
if (IS_IMAGE_TYPE_RGB[image_type]) {
return num_lines * stride / RGB_BYTES_PER_PIXEL[image_type];
@ -356,7 +356,7 @@ static uint32_t __glz_dictionary_window_alloc_image_seg(SharedDictionary *dict)
}
/* moves image to free list and "kill" it. Calls the free_image callback if was alive. */
static INLINE void __glz_dictionary_window_free_image(SharedDictionary *dict, WindowImage *image)
static inline void __glz_dictionary_window_free_image(SharedDictionary *dict, WindowImage *image)
{
if (image->is_alive) {
dict->cur_usr->free_image(dict->cur_usr, image->usr_context);
@ -367,7 +367,7 @@ static INLINE void __glz_dictionary_window_free_image(SharedDictionary *dict, Wi
}
/* moves all the segments that were associated with the images to the free segments */
static INLINE void __glz_dictionary_window_free_image_segs(SharedDictionary *dict,
static inline void __glz_dictionary_window_free_image_segs(SharedDictionary *dict,
WindowImage *image)
{
uint32_t old_free_head = dict->window.free_segs_head;
@ -423,7 +423,7 @@ static WindowImage *glz_dictionary_window_get_new_head(SharedDictionary *dict, i
return cur_head;
}
static INLINE int glz_dictionary_is_in_use(SharedDictionary *dict)
static inline int glz_dictionary_is_in_use(SharedDictionary *dict)
{
uint32_t i = 0;
for (i = 0; i < dict->max_encoders; i++) {