]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs.h: fix unnecessary forward declarations
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 17 Mar 2015 21:58:19 +0000 (22:58 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 15 Apr 2015 10:24:12 +0000 (12:24 +0200)
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 <danny.al-gaaf@bisect.de>
src/include/cephfs/libcephfs.h

index 0db77deb8eceb31a9eabcdcb7acfdc95f52b63c4..26e09a288e77a114d101bd2de4334b87847793ef 100644 (file)
@@ -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;