summaryrefslogtreecommitdiff
path: root/file.h
diff options
context:
space:
mode:
authorDaniel Gollub <daniel.gollub@t-online.de>2014-02-12 15:51:54 +0100
committerJens Axboe <axboe@fb.com>2014-02-12 08:23:23 -0700
commitbea5c23dfb5166931ff476a483fd66d5e5b10601 (patch)
tree7bfefb198b0b5424ccffb2de6f42d19b97b97eef /file.h
parente0739a728590d0890615a47988f3e79128e47a05 (diff)
downloadfio-bea5c23dfb5166931ff476a483fd66d5e5b10601.tar.gz
fio-bea5c23dfb5166931ff476a483fd66d5e5b10601.tar.bz2
Make file.h C++ safe by casting fio_file_flags
Fixes for g++ (4.7.2) following compiler errors when fio.h gets included (e.g. in an external C++ ioengine): --8<--- [...] os/../file.h: In function ‘void fio_file_set_open(fio_file*)’: os/../file.h:142:1: error: invalid conversion from ‘int’ to ‘fio_file_flags’ [-fpermissive] os/../file.h: In function ‘void fio_file_clear_open(fio_file*)’: os/../file.h:142:1: error: invalid conversion from ‘int’ to ‘fio_file_flags’ [-fpermissive] os/../file.h: In function ‘void fio_file_set_closing(fio_file*)’: [...] --->8--- Signed-off-by: Daniel Gollub <d.gollub@telekom.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'file.h')
-rw-r--r--file.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.h b/file.h
index 19413fc8..c1d02a5b 100644
--- a/file.h
+++ b/file.h
@@ -128,11 +128,11 @@ struct fio_file {
#define FILE_FLAG_FNS(name) \
static inline void fio_file_set_##name(struct fio_file *f) \
{ \
- (f)->flags |= FIO_FILE_##name; \
+ (f)->flags = (enum fio_file_flags) ((f)->flags | FIO_FILE_##name); \
} \
static inline void fio_file_clear_##name(struct fio_file *f) \
{ \
- (f)->flags &= ~FIO_FILE_##name; \
+ (f)->flags = (enum fio_file_flags) ((f)->flags & ~FIO_FILE_##name); \
} \
static inline int fio_file_##name(struct fio_file *f) \
{ \