]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Simplify ST_DEV_MSB
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Aug 2024 06:30:42 +0000 (23:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 Aug 2024 08:41:43 +0000 (01:41 -0700)
* src/incremen.c (ST_DEV_MSB):
Use TYPE_WIDTH rather than computing it by hand.

src/incremen.c

index 41dc8b1053bc35f3ec97d3154ae6069c87a074cf..5d14e5b876da20c8e0acfcb71b51a51fd4689406 100644 (file)
@@ -216,7 +216,7 @@ static Hash_table *directory_meta_table;
   static char const nfs_string[] = "nfs";
 # define NFS_FILE_STAT(st) (strcmp ((st).st_fstype, nfs_string) == 0)
 #else
-# define ST_DEV_MSB(st) (~ (dev_t) 0 << (sizeof (st).st_dev * CHAR_BIT - 1))
+# define ST_DEV_MSB(st) (~ (dev_t) 0 << (TYPE_WIDTH ((st).st_dev) - 1))
 # define NFS_FILE_STAT(st) (((st).st_dev & ST_DEV_MSB (st)) != 0)
 #endif