Loading fs/src/adafs_ops/access.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ int chk_access(const Metadata& md, int mask) { //check user leftmost 3 bits for rwx in md->mode if (md.uid() == fuse_get_context()->uid) { // Because mode comes only with the first 3 bits used, the user bits have to be shifted to the right to compare if ((mask & md.mode() >> 6) == (unsigned int) mask) if ((mask & md.mode() >> 6) == static_cast<unsigned int>(mask)) return 0; else return -EACCES; Loading @@ -31,7 +31,7 @@ int chk_access(const Metadata& md, int mask) { //check group middle 3 bits for rwx in md->mode if (md.gid() == fuse_get_context()->gid) { if ((mask & md.mode() >> 3) == (unsigned int) mask) if ((mask & md.mode() >> 3) == static_cast<unsigned int>(mask)) return 0; else return -EACCES; Loading @@ -39,7 +39,7 @@ int chk_access(const Metadata& md, int mask) { //check other rightmost 3 bits for rwx in md->mode. // Because they are the rightmost bits they don't need to be shifted if ((mask & md.mode()) == (unsigned int) mask) { if ((mask & md.mode()) == static_cast<unsigned int>(mask)) { return 0; } Loading fs/src/adafs_ops/io.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int init_chunk_space(const unsigned long hash) { chnk_path /= "data"s; bfs::ofstream ofs{chnk_path}; return bfs::exists(chnk_path); return static_cast<int>(bfs::exists(chnk_path)); } /** * Remove the directory in the chunk dir of a file. Loading @@ -39,5 +39,5 @@ int destroy_chunk_space(const unsigned long hash) { // create chunk dir bfs::remove_all(chnk_path); return !bfs::exists(chnk_path); return static_cast<int>(!bfs::exists(chnk_path)); } fs/src/fuse_ops/io.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -76,10 +76,10 @@ int adafs_write(const char* p, const char* buf, size_t size, off_t offset, struc // Set new size of the file if (fi->flags & O_APPEND) { truncate(chnk_path.c_str(), md->size() + size); md->size(md->size() + (uint32_t) size); md->size(md->size() + static_cast<uint32_t>(size)); } else { truncate(chnk_path.c_str(), size); md->size((uint32_t) size); md->size(static_cast<uint32_t>(size)); } close(fd); Loading fs/src/main.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ struct adafs_data { int32_t blocksize; }; #define ADAFS_DATA ((struct adafs_data*) fuse_get_context()->private_data) #define ADAFS_DATA ( static_cast<adafs_data*>(fuse_get_context()->private_data)) #define ADAFS_ROOT_INODE 1 namespace util { Loading Loading
fs/src/adafs_ops/access.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ int chk_access(const Metadata& md, int mask) { //check user leftmost 3 bits for rwx in md->mode if (md.uid() == fuse_get_context()->uid) { // Because mode comes only with the first 3 bits used, the user bits have to be shifted to the right to compare if ((mask & md.mode() >> 6) == (unsigned int) mask) if ((mask & md.mode() >> 6) == static_cast<unsigned int>(mask)) return 0; else return -EACCES; Loading @@ -31,7 +31,7 @@ int chk_access(const Metadata& md, int mask) { //check group middle 3 bits for rwx in md->mode if (md.gid() == fuse_get_context()->gid) { if ((mask & md.mode() >> 3) == (unsigned int) mask) if ((mask & md.mode() >> 3) == static_cast<unsigned int>(mask)) return 0; else return -EACCES; Loading @@ -39,7 +39,7 @@ int chk_access(const Metadata& md, int mask) { //check other rightmost 3 bits for rwx in md->mode. // Because they are the rightmost bits they don't need to be shifted if ((mask & md.mode()) == (unsigned int) mask) { if ((mask & md.mode()) == static_cast<unsigned int>(mask)) { return 0; } Loading
fs/src/adafs_ops/io.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int init_chunk_space(const unsigned long hash) { chnk_path /= "data"s; bfs::ofstream ofs{chnk_path}; return bfs::exists(chnk_path); return static_cast<int>(bfs::exists(chnk_path)); } /** * Remove the directory in the chunk dir of a file. Loading @@ -39,5 +39,5 @@ int destroy_chunk_space(const unsigned long hash) { // create chunk dir bfs::remove_all(chnk_path); return !bfs::exists(chnk_path); return static_cast<int>(!bfs::exists(chnk_path)); }
fs/src/fuse_ops/io.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -76,10 +76,10 @@ int adafs_write(const char* p, const char* buf, size_t size, off_t offset, struc // Set new size of the file if (fi->flags & O_APPEND) { truncate(chnk_path.c_str(), md->size() + size); md->size(md->size() + (uint32_t) size); md->size(md->size() + static_cast<uint32_t>(size)); } else { truncate(chnk_path.c_str(), size); md->size((uint32_t) size); md->size(static_cast<uint32_t>(size)); } close(fd); Loading
fs/src/main.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ struct adafs_data { int32_t blocksize; }; #define ADAFS_DATA ((struct adafs_data*) fuse_get_context()->private_data) #define ADAFS_DATA ( static_cast<adafs_data*>(fuse_get_context()->private_data)) #define ADAFS_ROOT_INODE 1 namespace util { Loading