Skip to content

Commit 2928918

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 6c48668 commit 2928918

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xlators/features/shard/src/shard.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ 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)cookie;
12931293

12941294
local = frame->local;
12951295

@@ -1370,7 +1370,7 @@ shard_lookup_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
13701370
{
13711371
inode_t *link_inode = NULL;
13721372
shard_local_t *local = NULL;
1373-
shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie;
1373+
shard_internal_dir_type_t type = (shard_internal_dir_type_t)(unsigned long)cookie;
13741374

13751375
local = frame->local;
13761376

@@ -5889,7 +5889,7 @@ shard_mkdir_internal_dir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
58895889
{
58905890
inode_t *link_inode = NULL;
58915891
shard_local_t *local = NULL;
5892-
shard_internal_dir_type_t type = (shard_internal_dir_type_t)cookie;
5892+
shard_internal_dir_type_t type = (shard_internal_dir_type_t)(unsigned long)cookie;
58935893

58945894
local = frame->local;
58955895

0 commit comments

Comments
 (0)