From 2b52511f3f595e0932e7f9c55bed243e8fe0f4f8 Mon Sep 17 00:00:00 2001 From: Daniel Rall Date: Wed, 10 Sep 2008 08:56:01 +0200 Subject: [PATCH] Allow fio headers to be included by a C++ build The attached patch allows fio 1.17.2 header files to be included by a C++ build without generating compile errors due to C-ism. Specifically, due to: - use of the keyword "new" as a parameter name - a cast of a return value to void *, when the function signature returns a different type Signed-off-by: Jens Axboe --- flist.h | 21 +++++++++++---------- os/os-linux.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/flist.h b/flist.h index f28a5ab7..e62f4b29 100644 --- a/flist.h +++ b/flist.h @@ -41,33 +41,34 @@ struct flist_head { * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __flist_add(struct flist_head *new, +static inline void __flist_add(struct flist_head *new_entry, struct flist_head *prev, struct flist_head *next) { - next->prev = new; - new->next = next; - new->prev = prev; - prev->next = new; + next->prev = new_entry; + new_entry->next = next; + new_entry->prev = prev; + prev->next = new_entry; } /** * flist_add - add a new entry - * @new: new entry to be added + * @new_entry: new entry to be added * @head: list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ -static inline void flist_add(struct flist_head *new, struct flist_head *head) +static inline void flist_add(struct flist_head *new_entry, + struct flist_head *head) { - __flist_add(new, head, head->next); + __flist_add(new_entry, head, head->next); } -static inline void flist_add_tail(struct flist_head *new, +static inline void flist_add_tail(struct flist_head *new_entry, struct flist_head *head) { - __flist_add(new, head->prev, head); + __flist_add(new_entry, head->prev, head); } /* diff --git a/os/os-linux.h b/os/os-linux.h index 791ec7a7..c0f53276 100644 --- a/os/os-linux.h +++ b/os/os-linux.h @@ -116,7 +116,7 @@ struct async_head_user; static inline struct syslet_uatom * async_exec(struct syslet_uatom *atom, struct async_head_user *ahu) { - return (void *) syscall(__NR_async_exec, atom, ahu); + return (struct syslet_uatom *) syscall(__NR_async_exec, atom, ahu); } static inline long -- 2.25.1