eina: add intermediate inline function for eina_crc.

This is necessary to make my life easier when adding assembling implementation
of eina_crc.
This commit is contained in:
Cedric BAIL 2015-08-02 21:56:08 +02:00
parent 868d0fb2e8
commit a07c526460
4 changed files with 35 additions and 2 deletions

View File

@ -89,6 +89,7 @@ lib/eina/eina_thread_queue.h \
lib/eina/eina_matrix.h \
lib/eina/eina_quad.h \
lib/eina/eina_crc.h \
lib/eina/eina_inline_crc.x \
lib/eina/eina_evlog.h \
lib/eina/eina_util.h \
lib/eina/eina_quaternion.h

View File

@ -288,7 +288,7 @@ static const unsigned int table[8][256] =
};
EAPI unsigned int
eina_crc(const char *data, int len, unsigned int seed, Eina_Bool start_stream)
_eina_crc(const char *data, int len, unsigned int seed, Eina_Bool start_stream)
{
unsigned int crc;
unsigned int* curr = (unsigned int*) data;

View File

@ -40,6 +40,8 @@
*
* @since 1.15
*/
EAPI unsigned int eina_crc(const char *key, int len, unsigned int seed, Eina_Bool start_stream) EINA_ARG_NONNULL(2, 3);
static inline unsigned int eina_crc(const char *key, int len, unsigned int seed, Eina_Bool start_stream) EINA_ARG_NONNULL(2, 3);
#include "eina_inline_crc.x"
#endif

View File

@ -0,0 +1,30 @@
/* EINA - EFL data type library
* Copyright (C) 20015 Cedric BAIL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EINA_INLINE_CRC_X_
#define EINA_INLINE_CRC_X_
EAPI unsigned int _eina_crc(const char *data, int len, unsigned int seed, Eina_Bool start_stream);
static inline unsigned int
eina_crc(const char *key, int len, unsigned int seed, Eina_Bool start_stream)
{
return _eina_crc(key, len, seed, start_stream);
}
#endif