From caf80c99c5fb0a27050bbcab311927149fd303f8 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Thu, 14 May 2009 02:19:34 +0200 Subject: [PATCH] Removed extraordinary use of inline keyword in functions declarations. The use of inline for functions implemented in C source file and included in library breaks C99/GNU99 build with FFMpeg library. Signed-off-by: Pavel Pisa --- fwp/lib/fwp/fwp_msgb.c | 14 +++++++------- fwp/lib/fwp/fwp_msgb.h | 14 +++++++------- fwp/lib/fwp/fwp_utils.c | 4 ++-- fwp/lib/fwp/fwp_utils.h | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fwp/lib/fwp/fwp_msgb.c b/fwp/lib/fwp/fwp_msgb.c index 77143a2..c5193c7 100644 --- a/fwp/lib/fwp/fwp_msgb.c +++ b/fwp/lib/fwp/fwp_msgb.c @@ -103,7 +103,7 @@ void fwp_msgb_free(struct fwp_msgb *msgb) * \return Previous tail pointer * */ -inline unsigned char* fwp_msgb_put(struct fwp_msgb *msgb, unsigned int len) +unsigned char* fwp_msgb_put(struct fwp_msgb *msgb, unsigned int len) { unsigned char *tmp= msgb->tail; @@ -121,7 +121,7 @@ inline unsigned char* fwp_msgb_put(struct fwp_msgb *msgb, unsigned int len) * \return Previous tail pointer on NULL in case of lack of space in the buffer. * */ -inline unsigned char* fwp_msgb_pull(struct fwp_msgb *msgb, unsigned int len) +unsigned char* fwp_msgb_pull(struct fwp_msgb *msgb, unsigned int len) { if (len > msgb->len) return NULL; @@ -139,14 +139,14 @@ inline unsigned char* fwp_msgb_pull(struct fwp_msgb *msgb, unsigned int len) * \return Current data pointer * */ -inline unsigned char* fwp_msgb_push(struct fwp_msgb* msgb, unsigned int len) +unsigned char* fwp_msgb_push(struct fwp_msgb* msgb, unsigned int len) { msgb->data-=len; msgb->len+=len; return msgb->data; } -inline unsigned char* fwp_msgb_shift(struct fwp_msgb *msgb, unsigned int len) +unsigned char* fwp_msgb_shift(struct fwp_msgb *msgb, unsigned int len) { if (msgb->data + len > msgb->tail) return NULL; @@ -160,7 +160,7 @@ inline unsigned char* fwp_msgb_shift(struct fwp_msgb *msgb, unsigned int len) * \param msgb Pointer to msgb * */ -inline void fwp_msgb_reset_data_pointer(struct fwp_msgb *msgb) +void fwp_msgb_reset_data_pointer(struct fwp_msgb *msgb) { msgb->data = (unsigned char*) msgb + sizeof(struct fwp_msgb); } @@ -170,7 +170,7 @@ inline void fwp_msgb_reset_data_pointer(struct fwp_msgb *msgb) * * \param msgb Pointer to msgb */ -inline void fwp_msgb_reset_data(struct fwp_msgb* msgb) +void fwp_msgb_reset_data(struct fwp_msgb* msgb) { msgb->len = 0; msgb->data = (unsigned char*) msgb + sizeof(struct fwp_msgb); @@ -183,7 +183,7 @@ inline void fwp_msgb_reset_data(struct fwp_msgb* msgb) * \param msgb Pointer to msgb * \param len The lenght data */ -inline void fwp_msgb_reserve(fwp_msgb_t *msgb, unsigned int len) +void fwp_msgb_reserve(fwp_msgb_t *msgb, unsigned int len) { msgb->data+=len; msgb->tail+=len; diff --git a/fwp/lib/fwp/fwp_msgb.h b/fwp/lib/fwp/fwp_msgb.h index a49d884..95b683d 100644 --- a/fwp/lib/fwp/fwp_msgb.h +++ b/fwp/lib/fwp/fwp_msgb.h @@ -74,13 +74,13 @@ struct fwp_msgb { struct fwp_msgb* fwp_msgb_alloc(size_t buf_size); void fwp_msgb_free(struct fwp_msgb* msgb); -inline unsigned char* fwp_msgb_put(struct fwp_msgb *msgb, unsigned int len); -inline unsigned char* fwp_msgb_pull(struct fwp_msgb *msgb, unsigned int len); -inline unsigned char* fwp_msgb_push(struct fwp_msgb* msgb, unsigned int len); -inline void fwp_msgb_reset_data_pointer(struct fwp_msgb* msgb); -inline void fwp_msgb_reset_data(struct fwp_msgb* msgb); -inline unsigned char* fwp_msgb_shift(struct fwp_msgb* msgb, unsigned int len); -inline void fwp_msgb_reserve(fwp_msgb_t *msgb, unsigned int len); +unsigned char* fwp_msgb_put(struct fwp_msgb *msgb, unsigned int len); +unsigned char* fwp_msgb_pull(struct fwp_msgb *msgb, unsigned int len); +unsigned char* fwp_msgb_push(struct fwp_msgb* msgb, unsigned int len); +void fwp_msgb_reset_data_pointer(struct fwp_msgb* msgb); +void fwp_msgb_reset_data(struct fwp_msgb* msgb); +unsigned char* fwp_msgb_shift(struct fwp_msgb* msgb, unsigned int len); +void fwp_msgb_reserve(fwp_msgb_t *msgb, unsigned int len); /*struct fwp_socketaddr* fwp_socket_create(struct sockaddr *_addr, socklen_t _addrlen); inline void fwp_socket_set(struct fwp_socketaddr *fwpsock, struct sockaddr *_addr, diff --git a/fwp/lib/fwp/fwp_utils.c b/fwp/lib/fwp/fwp_utils.c index 28ef3ab..83f6106 100644 --- a/fwp/lib/fwp/fwp_utils.c +++ b/fwp/lib/fwp/fwp_utils.c @@ -54,7 +54,7 @@ const char *ac_to_text[4] = {[AC_VO] = "AC_VO", [AC_VI] = "AC_VI", [AC_BE] = "AC_BE", [AC_BK] = "AC_BK", }; */ -inline void fwp_timespec_add (struct timespec *sum, const struct timespec *left, +void fwp_timespec_add (struct timespec *sum, const struct timespec *left, const struct timespec *right) { sum->tv_sec = left->tv_sec + right->tv_sec; @@ -66,7 +66,7 @@ inline void fwp_timespec_add (struct timespec *sum, const struct timespec *left, } } -inline void fwp_timespec_sub (struct timespec *diff, const struct timespec *left, +void fwp_timespec_sub (struct timespec *diff, const struct timespec *left, const struct timespec *right) { diff->tv_sec = left->tv_sec - right->tv_sec; diff --git a/fwp/lib/fwp/fwp_utils.h b/fwp/lib/fwp/fwp_utils.h index c99ec65..3a12946 100644 --- a/fwp/lib/fwp/fwp_utils.h +++ b/fwp/lib/fwp/fwp_utils.h @@ -128,9 +128,9 @@ _fwp_recv(int s, void *buf, size_t len, int flags) return ret; } -inline void fwp_timespec_add (struct timespec *sum, const struct timespec *left, +void fwp_timespec_add (struct timespec *sum, const struct timespec *left, const struct timespec *right); -inline void fwp_timespec_sub (struct timespec *diff, const struct timespec *left, +void fwp_timespec_sub (struct timespec *diff, const struct timespec *left, const struct timespec *right); void fwp_timespec_modulo(struct timespec *dividend, struct timespec *dividor, struct timespec *remainder); -- 2.39.2