From 53c9dd4d2dcc77acbbaa0050f2d8617ad79d9fd3 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 17 Mar 2015 22:58:19 +0100 Subject: [PATCH] libcephfs.h: fix unnecessary forward declarations This is an issue in case non-cpp code. Move the declaration of inodeno_t and vinodeno_t structs into __cplusplus block where they are needed. Fix for cppcheck issue: [src/include/cephfs/libcephfs.h:89] -> [src/include/cephfs/libcephfs.h:74]: The struct 'inodeno_t' forward declaration is unnecessary. Type struct is already declared earlier. [src/include/cephfs/libcephfs.h:93] -> [src/include/cephfs/libcephfs.h:83]: The struct 'vinodeno_t' forward declaration is unnecessary. Type struct is already declared earlier. Signed-off-by: Danny Al-Gaaf --- src/include/cephfs/libcephfs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index 0db77deb8eceb..26e09a288e77a 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -76,7 +76,7 @@ struct ceph_file_layout { } __attribute__ ((packed)); -typedef struct _inodeno_t { +typedef struct inodeno_t { uint64_t val; } inodeno_t; @@ -90,15 +90,17 @@ typedef struct vinodeno_t { } vinodeno_t; typedef struct Fh Fh; +#else /* _cplusplus */ + +struct inodeno_t; +struct vinodeno_t; +typedef struct vinodeno_t vinodeno; #endif /* ! __cplusplus */ -struct inodeno_t; struct Inode; typedef struct Inode Inode; -struct vinodeno_t; -typedef struct vinodeno_t vinodeno; struct ceph_mount_info; struct ceph_dir_result; struct CephContext; -- 2.39.5