Skip to content

Commit 6c389ef

Browse files
committed
shard.c: fix clang warnings
Fix the following warning that are seen when compiling with clang: make[4]: Entering directory '/home/ykaul/github/glusterfs/xlators/features/shard/src' CC shard.lo shard.c:1292:38: warning: cast to smaller integer type 'shard_internal_dir_type_t' from 'void *' [-Wvoid-pointer-to-enum-cast] 1292 | shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ shard.c:1373:38: warning: cast to smaller integer type 'shard_internal_dir_type_t' from 'void *' [-Wvoid-pointer-to-enum-cast] 1373 | shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ shard.c:5892:38: warning: cast to smaller integer type 'shard_internal_dir_type_t' from 'void *' [-Wvoid-pointer-to-enum-cast] 5892 | shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Yaniv Kaul <[email protected]>
1 parent 3e0a8cb commit 6c389ef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

xlators/features/shard/src/shard.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,8 @@ shard_refresh_internal_dir_cbk(call_frame_t *frame, void *cookie,
12891289
{
12901290
shard_local_t *local = NULL;
12911291
inode_t *linked_inode = NULL;
1292-
shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie;
1292+
shard_internal_dir_type_t type = (shard_internal_dir_type_t)(unsigned long)
1293+
cookie;
12931294

12941295
local = frame->local;
12951296

@@ -1370,7 +1371,8 @@ shard_lookup_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
13701371
{
13711372
inode_t *link_inode = NULL;
13721373
shard_local_t *local = NULL;
1373-
shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie;
1374+
shard_internal_dir_type_t type = (shard_internal_dir_type_t)(unsigned long)
1375+
cookie;
13741376

13751377
local = frame->local;
13761378

@@ -5889,7 +5891,8 @@ shard_mkdir_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
58895891
{
58905892
inode_t *link_inode = NULL;
58915893
shard_local_t *local = NULL;
5892-
shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie;
5894+
shard_internal_dir_type_t type = (shard_internal_dir_type_t)(unsigned long)
5895+
cookie;
58935896

58945897
local = frame->local;
58955898

0 commit comments

Comments
 (0)