- Add upstream commits to fix various gcc 10 warnings (bcl)
This commit is contained in:
parent
28a7decb69
commit
633c371306
30
0014-t6001-psep-modify-device-manage-support-detection.patch
Normal file
30
0014-t6001-psep-modify-device-manage-support-detection.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 0eef2b04caad4a7b251ecf5e1c58ad33582da6e5 Mon Sep 17 00:00:00 2001
|
||||
From: Joe Slater <joe.slater@windriver.com>
|
||||
Date: Thu, 20 Jun 2019 14:33:04 -0700
|
||||
Subject: [PATCH 14/42] t6001-psep: modify device manage support detection
|
||||
|
||||
Use the method other tests use -- test an environment variable.
|
||||
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
tests/t6001-psep.sh | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh
|
||||
index e350bd2..73f2d1c 100644
|
||||
--- a/tests/t6001-psep.sh
|
||||
+++ b/tests/t6001-psep.sh
|
||||
@@ -21,7 +21,8 @@
|
||||
require_root_
|
||||
require_udevadm_settle_
|
||||
|
||||
-(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
|
||||
+test "x$ENABLE_DEVICE_MAPPER" = xyes \
|
||||
+ || skip_ "no device-mapper support"
|
||||
|
||||
# Device maps names - should be random to not conflict with existing ones on
|
||||
# the system
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,59 @@
|
||||
From 04ca93351a4e25c35562ef705b3d96c3743609ff Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 25 Jun 2019 09:37:32 -0700
|
||||
Subject: [PATCH 15/42] tests: Update all the dmsetup tests to use
|
||||
ENABLE_DEVICE_MAPPER
|
||||
|
||||
---
|
||||
tests/t6004-dm-many-partitions.sh | 4 +++-
|
||||
tests/t6005-dm-uuid.sh | 4 +++-
|
||||
tests/t6006-dm-512b-sectors.sh | 3 ++-
|
||||
3 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/t6004-dm-many-partitions.sh b/tests/t6004-dm-many-partitions.sh
|
||||
index b4be975..636c837 100755
|
||||
--- a/tests/t6004-dm-many-partitions.sh
|
||||
+++ b/tests/t6004-dm-many-partitions.sh
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
require_root_
|
||||
require_udevadm_settle_
|
||||
-(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
|
||||
+
|
||||
+test "x$ENABLE_DEVICE_MAPPER" = xyes \
|
||||
+ || skip_ "no device-mapper support"
|
||||
|
||||
ss=$sector_size_
|
||||
ns=300
|
||||
diff --git a/tests/t6005-dm-uuid.sh b/tests/t6005-dm-uuid.sh
|
||||
index 4266747..790c23f 100755
|
||||
--- a/tests/t6005-dm-uuid.sh
|
||||
+++ b/tests/t6005-dm-uuid.sh
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
require_root_
|
||||
require_udevadm_settle_
|
||||
-(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
|
||||
+
|
||||
+test "x$ENABLE_DEVICE_MAPPER" = xyes \
|
||||
+ || skip_ "no device-mapper support"
|
||||
|
||||
ss=$sector_size_
|
||||
ns=300
|
||||
diff --git a/tests/t6006-dm-512b-sectors.sh b/tests/t6006-dm-512b-sectors.sh
|
||||
index bf32135..c0de382 100644
|
||||
--- a/tests/t6006-dm-512b-sectors.sh
|
||||
+++ b/tests/t6006-dm-512b-sectors.sh
|
||||
@@ -25,7 +25,8 @@ require_scsi_debug_module_
|
||||
grep '^#define USE_BLKID 1' "$CONFIG_HEADER" > /dev/null ||
|
||||
skip_ 'this system lacks a new-enough libblkid'
|
||||
|
||||
-(dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed"
|
||||
+test "x$ENABLE_DEVICE_MAPPER" = xyes \
|
||||
+ || skip_ "no device-mapper support"
|
||||
|
||||
# Device maps names - should be random to not conflict with existing ones on
|
||||
# the system
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,51 @@
|
||||
From f75af2cfbbd1a2d82ed3df4955014f73737ae13e Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:18 +0900
|
||||
Subject: [PATCH 16/42] libparted: Fix a GCC warning -Wunused-but-set-variable
|
||||
|
||||
GCC warns that a variable 'prealloc' defined for _generic_affs_probe() in
|
||||
fs/amiga/affs.c is set but its value is never used.
|
||||
|
||||
CC amiga/affs.lo
|
||||
amiga/affs.c: In function '_generic_affs_probe':
|
||||
amiga/affs.c:54:35: warning: variable 'prealloc' set but not used [-Wunused-but-set-variable]
|
||||
54 | int blocksize = 1, reserved = 2, prealloc = 0;
|
||||
| ^~~~~~~~
|
||||
Remove the variable for simplicity and to avoid the warning.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/amiga/affs.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/amiga/affs.c b/libparted/fs/amiga/affs.c
|
||||
index 1fde17c..e7c2e47 100644
|
||||
--- a/libparted/fs/amiga/affs.c
|
||||
+++ b/libparted/fs/amiga/affs.c
|
||||
@@ -52,20 +52,19 @@ _generic_affs_probe (PedGeometry* geom, uint32_t kind)
|
||||
uint32_t *block;
|
||||
PedSector root, len, pos;
|
||||
struct PartitionBlock * part;
|
||||
- int blocksize = 1, reserved = 2, prealloc = 0;
|
||||
+ int blocksize = 1, reserved = 2;
|
||||
|
||||
PED_ASSERT (geom != NULL);
|
||||
PED_ASSERT (geom->dev != NULL);
|
||||
if (geom->dev->sector_size != 512)
|
||||
return NULL;
|
||||
- /* Finds the blocksize, prealloc and reserved values of the partition block */
|
||||
+ /* Finds the blocksize and reserved values of the partition block */
|
||||
if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
|
||||
ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
|
||||
_("%s : Failed to allocate partition block\n"), __func__);
|
||||
goto error_part;
|
||||
}
|
||||
if (amiga_find_part(geom, part) != NULL) {
|
||||
- prealloc = PED_BE32_TO_CPU (part->de_PreAlloc);
|
||||
reserved = PED_BE32_TO_CPU (part->de_Reserved);
|
||||
reserved = reserved == 0 ? 1 : reserved;
|
||||
blocksize = PED_BE32_TO_CPU (part->de_SizeBlock)
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,67 @@
|
||||
From d51921b05c32287238b1b0447d7e952884f63eb5 Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:19 +0900
|
||||
Subject: [PATCH 17/42] libparted: Fix warnings from GCC 8 -Wunused-variable
|
||||
and -Warray-bounds
|
||||
|
||||
GCC 8 reports two warnings as follows.
|
||||
|
||||
r/fat/bootsector.c: In function 'fat_boot_sector_set_boot_code':
|
||||
r/fat/bootsector.c:274:15: warning: unused variable 'fs_info' [-Wunused-variable]
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
^~~~~~~
|
||||
In function 'memcpy',
|
||||
inlined from 'fat_boot_sector_set_boot_code' at r/fat/bootsector.c:283:2:
|
||||
/usr/include/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' forming offset [126, 128] is out of the bounds [0, 125] [-Warray-bounds]
|
||||
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To avoid the warnings, remove the unused variable. Use strcpy in place of
|
||||
memcpy checking copy length.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/r/fat/bootsector.c | 5 ++---
|
||||
libparted/fs/r/fat/bootsector.h | 2 --
|
||||
2 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/fat/bootsector.c b/libparted/fs/r/fat/bootsector.c
|
||||
index 46d5926..9130900 100644
|
||||
--- a/libparted/fs/r/fat/bootsector.c
|
||||
+++ b/libparted/fs/r/fat/bootsector.c
|
||||
@@ -271,8 +271,6 @@ fat_boot_sector_analyse (FatBootSector* bs, PedFileSystem* fs)
|
||||
int
|
||||
fat_boot_sector_set_boot_code (FatBootSector** bsp, const PedFileSystem* fs)
|
||||
{
|
||||
- FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
-
|
||||
PED_ASSERT (bsp != NULL);
|
||||
*bsp = ped_malloc (fs->geom->dev->sector_size);
|
||||
FatBootSector *bs = *bsp;
|
||||
@@ -280,7 +278,8 @@ fat_boot_sector_set_boot_code (FatBootSector** bsp, const PedFileSystem* fs)
|
||||
|
||||
memset (bs, 0, 512);
|
||||
memcpy (bs->boot_jump, FAT_BOOT_JUMP, 3);
|
||||
- memcpy (bs->u.fat32.boot_code, FAT_BOOT_CODE, FAT_BOOT_CODE_LENGTH);
|
||||
+ PED_ASSERT (sizeof(FAT_BOOT_CODE) < sizeof(bs->u.fat32.boot_code));
|
||||
+ strcpy (bs->u.fat32.boot_code, FAT_BOOT_CODE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff --git a/libparted/fs/r/fat/bootsector.h b/libparted/fs/r/fat/bootsector.h
|
||||
index 6b0363f..42fc3f2 100644
|
||||
--- a/libparted/fs/r/fat/bootsector.h
|
||||
+++ b/libparted/fs/r/fat/bootsector.h
|
||||
@@ -57,8 +57,6 @@ typedef struct _FatInfoSector FatInfoSector;
|
||||
/* message: */ \
|
||||
FAT_BOOT_MESSAGE
|
||||
|
||||
-#define FAT_BOOT_CODE_LENGTH 128
|
||||
-
|
||||
struct __attribute__ ((packed)) _FatBootSector {
|
||||
uint8_t boot_jump[3]; /* 00: Boot strap short or near jump */
|
||||
uint8_t system_id[8]; /* 03: system name */
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,44 @@
|
||||
From 5449d1b1ee763e8ae1057fb7d18f7fbccb7a6fe0 Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:17 +0900
|
||||
Subject: [PATCH 18/42] libparted: Fix warnings from GCC's
|
||||
-Wimplicit-fallthrough
|
||||
|
||||
Two case statements have intentional fall-throughs but do not have
|
||||
comments to note it. GCC detects and warns those case statements. To
|
||||
avoid the warning, add fall-through comments.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/amiga/amiga.c | 1 +
|
||||
libparted/fs/r/hfs/reloc.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/libparted/fs/amiga/amiga.c b/libparted/fs/amiga/amiga.c
|
||||
index be10dae..eb63f24 100644
|
||||
--- a/libparted/fs/amiga/amiga.c
|
||||
+++ b/libparted/fs/amiga/amiga.c
|
||||
@@ -217,6 +217,7 @@ _amiga_read_block (PedDevice *dev, struct AmigaBlock *blk, PedSector block, stru
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
+ /* FALLTHROUGH */
|
||||
case PED_EXCEPTION_IGNORE :
|
||||
case PED_EXCEPTION_UNHANDLED :
|
||||
default :
|
||||
diff --git a/libparted/fs/r/hfs/reloc.c b/libparted/fs/r/hfs/reloc.c
|
||||
index 0b8ddc1..d0477ae 100644
|
||||
--- a/libparted/fs/r/hfs/reloc.c
|
||||
+++ b/libparted/fs/r/hfs/reloc.c
|
||||
@@ -224,6 +224,7 @@ hfs_do_move (PedFileSystem* fs, unsigned int *ptr_src,
|
||||
priv_data->catalog_file
|
||||
->cache[ref->ref_index].start_block =
|
||||
PED_CPU_TO_BE16(new_start);
|
||||
+ /* FALLTHROUGH */
|
||||
case CR_BTREE_EXT_0 :
|
||||
file = priv_data->extent_file;
|
||||
goto CR_BTREE;
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,61 @@
|
||||
From bed9c6a17ee82c87bf47981149e224f2e34baedb Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:23 +0900
|
||||
Subject: [PATCH 19/42] libparted: Avoid a GCC warning for unused functions
|
||||
|
||||
libparted/fs/r/hfs/hfs.c has a '#if 0' block. The block refers two
|
||||
functions hfsplus_clobber() and hfs_clobber(). It have GCC report a
|
||||
warning below.
|
||||
|
||||
CC r/hfs/hfs.lo
|
||||
r/hfs/hfs.c:343:1: warning: 'hfsplus_clobber' defined but not used [-Wunused-function]
|
||||
343 | hfsplus_clobber (PedGeometry* geom)
|
||||
| ^~~~~~~~~~~~~~~
|
||||
|
||||
To avoid the warning, add two more '#if 0' to disable the two functions.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/r/hfs/hfs.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
|
||||
index 6be0390..0aababd 100644
|
||||
--- a/libparted/fs/r/hfs/hfs.c
|
||||
+++ b/libparted/fs/r/hfs/hfs.c
|
||||
@@ -59,6 +59,7 @@ static PedFileSystemType hfsplus_type;
|
||||
|
||||
/* ----- HFS ----- */
|
||||
|
||||
+#if 0
|
||||
/* This is a very unundoable operation */
|
||||
/* Maybe I shouldn't touch the alternate MDB ? */
|
||||
/* Anyway clobber is call before other fs creation */
|
||||
@@ -78,6 +79,7 @@ hfs_clobber (PedGeometry* geom)
|
||||
(!!ped_geometry_write (geom, buf, geom->length - 1, 1)) &
|
||||
(!!ped_geometry_sync (geom));
|
||||
}
|
||||
+#endif
|
||||
|
||||
PedFileSystem *
|
||||
hfs_open (PedGeometry* geom)
|
||||
@@ -339,6 +341,7 @@ hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
|
||||
#include "reloc_plus.h"
|
||||
#include "journal.h"
|
||||
|
||||
+#if 0
|
||||
static int
|
||||
hfsplus_clobber (PedGeometry* geom)
|
||||
{
|
||||
@@ -374,6 +377,7 @@ hfsplus_clobber (PedGeometry* geom)
|
||||
/* non-embedded or envelop destroy as hfs */
|
||||
return ( hfs_clobber (geom) && i );
|
||||
}
|
||||
+#endif
|
||||
|
||||
int
|
||||
hfsplus_close (PedFileSystem *fs)
|
||||
--
|
||||
2.26.2
|
||||
|
248
0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
Normal file
248
0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
Normal file
@ -0,0 +1,248 @@
|
||||
From 20c136159b37f11822b591941c077bb2be6ede05 Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:21 +0900
|
||||
Subject: [PATCH 20/42] libparted: Fix warnings from GCC 8
|
||||
-Wsuggest-attribute=pure
|
||||
|
||||
As GCC 8 suggests, add 'pure' attribute to 17 functions. After adding
|
||||
pure attributes, GCC suggested three more functions to add pure
|
||||
attributes. Add pure attribute to those functions also. In total, add
|
||||
pure attributes to 20 functions.
|
||||
|
||||
I read code of the functions and confirmed the 20 functions are pure:
|
||||
they have no effect except the return value, and their return value
|
||||
depend only on the parameters and/or global variables.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/fat/bootsector.c | 2 +-
|
||||
libparted/fs/r/fat/bootsector.c | 2 +-
|
||||
libparted/fs/r/fat/calc.c | 4 ++--
|
||||
libparted/fs/r/fat/context.c | 4 ++--
|
||||
libparted/fs/r/fat/count.c | 4 ++--
|
||||
libparted/fs/r/fat/table.c | 2 +-
|
||||
libparted/fs/r/fat/traverse.c | 14 +++++++-------
|
||||
libparted/fs/r/hfs/advfs.c | 4 ++--
|
||||
libparted/fs/r/hfs/advfs_plus.c | 4 ++--
|
||||
9 files changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/fat/bootsector.c b/libparted/fs/fat/bootsector.c
|
||||
index 0c3ae77..2a03696 100644
|
||||
--- a/libparted/fs/fat/bootsector.c
|
||||
+++ b/libparted/fs/fat/bootsector.c
|
||||
@@ -86,7 +86,7 @@ fat_boot_sector_read (FatBootSector** bsp, const PedGeometry *geom)
|
||||
/*
|
||||
Don't trust the FAT12, FAT16 or FAT32 label string.
|
||||
*/
|
||||
-FatType
|
||||
+FatType _GL_ATTRIBUTE_PURE
|
||||
fat_boot_sector_probe_type (const FatBootSector* bs, const PedGeometry* geom)
|
||||
{
|
||||
PedSector logical_sector_size;
|
||||
diff --git a/libparted/fs/r/fat/bootsector.c b/libparted/fs/r/fat/bootsector.c
|
||||
index 9130900..34134cc 100644
|
||||
--- a/libparted/fs/r/fat/bootsector.c
|
||||
+++ b/libparted/fs/r/fat/bootsector.c
|
||||
@@ -85,7 +85,7 @@ fat_boot_sector_read (FatBootSector** bsp, const PedGeometry *geom)
|
||||
/*
|
||||
Don't trust the FAT12, FAT16 or FAT32 label string.
|
||||
*/
|
||||
-FatType
|
||||
+FatType _GL_ATTRIBUTE_PURE
|
||||
fat_boot_sector_probe_type (const FatBootSector* bs, const PedGeometry* geom)
|
||||
{
|
||||
PedSector logical_sector_size;
|
||||
diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c
|
||||
index e524007..60c6bac 100644
|
||||
--- a/libparted/fs/r/fat/calc.c
|
||||
+++ b/libparted/fs/r/fat/calc.c
|
||||
@@ -314,7 +314,7 @@ fat_calc_resize_sizes (
|
||||
friends, to allow room for this space. If too much of this space is left
|
||||
over, everyone will complain, so we have to be greedy, and use it all up...
|
||||
*/
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_PURE
|
||||
fat_calc_align_sectors (const PedFileSystem* new_fs,
|
||||
const PedFileSystem* old_fs)
|
||||
{
|
||||
@@ -359,7 +359,7 @@ fat_calc_align_sectors (const PedFileSystem* new_fs,
|
||||
return align;
|
||||
}
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
diff --git a/libparted/fs/r/fat/context.c b/libparted/fs/r/fat/context.c
|
||||
index 5c27d09..170094c 100644
|
||||
--- a/libparted/fs/r/fat/context.c
|
||||
+++ b/libparted/fs/r/fat/context.c
|
||||
@@ -124,7 +124,7 @@ fat_op_context_destroy (FatOpContext* ctx)
|
||||
free (ctx);
|
||||
}
|
||||
|
||||
-FatFragment
|
||||
+FatFragment _GL_ATTRIBUTE_PURE
|
||||
fat_op_context_map_static_fragment (const FatOpContext* ctx, FatFragment frag)
|
||||
{
|
||||
FatSpecific* new_fs_info = FAT_SPECIFIC (ctx->new_fs);
|
||||
@@ -160,7 +160,7 @@ fat_op_context_map_static_cluster (const FatOpContext* ctx, FatCluster clst)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-FatFragment
|
||||
+FatFragment _GL_ATTRIBUTE_PURE
|
||||
fat_op_context_map_fragment (const FatOpContext* ctx, FatFragment frag)
|
||||
{
|
||||
return ctx->remap [frag];
|
||||
diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c
|
||||
index 250e80d..2b65e72 100644
|
||||
--- a/libparted/fs/r/fat/count.c
|
||||
+++ b/libparted/fs/r/fat/count.c
|
||||
@@ -338,7 +338,7 @@ fat_collect_cluster_info (PedFileSystem* fs) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
-FatClusterFlag
|
||||
+FatClusterFlag _GL_ATTRIBUTE_PURE
|
||||
fat_get_cluster_flag (PedFileSystem* fs, FatCluster cluster)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -346,7 +346,7 @@ fat_get_cluster_flag (PedFileSystem* fs, FatCluster cluster)
|
||||
return fs_info->cluster_info [cluster].flag;
|
||||
}
|
||||
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_PURE
|
||||
fat_get_cluster_usage (PedFileSystem* fs, FatCluster cluster)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
diff --git a/libparted/fs/r/fat/table.c b/libparted/fs/r/fat/table.c
|
||||
index fe8e040..98b0499 100644
|
||||
--- a/libparted/fs/r/fat/table.c
|
||||
+++ b/libparted/fs/r/fat/table.c
|
||||
@@ -371,7 +371,7 @@ fat_table_is_bad (const FatTable* ft, FatCluster cluster)
|
||||
/*
|
||||
returns true if <cluster> represents an EOF marker
|
||||
*/
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_table_is_eof (const FatTable* ft, FatCluster cluster)
|
||||
{
|
||||
return _test_code_eof (ft, cluster);
|
||||
diff --git a/libparted/fs/r/fat/traverse.c b/libparted/fs/r/fat/traverse.c
|
||||
index fc8a795..50b94bd 100644
|
||||
--- a/libparted/fs/r/fat/traverse.c
|
||||
+++ b/libparted/fs/r/fat/traverse.c
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static char tmp_buffer [4096];
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info)
|
||||
{
|
||||
return trav_info->buffer_size / sizeof (FatDirEntry);
|
||||
@@ -226,7 +226,7 @@ fat_traverse_next_dir_entry (FatTraverseInfo *trav_info)
|
||||
return trav_info->dir_entries + trav_info->current_entry;
|
||||
}
|
||||
|
||||
-FatCluster
|
||||
+FatCluster _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_get_first_cluster (FatDirEntry* dir_entry, PedFileSystem *fs)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -269,7 +269,7 @@ fat_dir_entry_set_first_cluster (FatDirEntry* dir_entry, PedFileSystem* fs,
|
||||
}
|
||||
}
|
||||
|
||||
-uint32_t
|
||||
+uint32_t _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_get_length (FatDirEntry* dir_entry)
|
||||
{
|
||||
return PED_LE32_TO_CPU (dir_entry->length);
|
||||
@@ -284,7 +284,7 @@ fat_dir_entry_is_null_term (const FatDirEntry* dir_entry)
|
||||
return memcmp (&null_entry, dir_entry, sizeof (null_entry)) == 0;
|
||||
}
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_is_active (FatDirEntry* dir_entry)
|
||||
{
|
||||
if ((unsigned char) dir_entry->name[0] == DELETED_FLAG) return 0;
|
||||
@@ -293,7 +293,7 @@ fat_dir_entry_is_active (FatDirEntry* dir_entry)
|
||||
return 1;
|
||||
}
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_is_file (FatDirEntry* dir_entry) {
|
||||
if (dir_entry->attributes == VFAT_ATTR) return 0;
|
||||
if (dir_entry->attributes & VOLUME_LABEL_ATTR) return 0;
|
||||
@@ -302,7 +302,7 @@ fat_dir_entry_is_file (FatDirEntry* dir_entry) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_is_system_file (FatDirEntry* dir_entry)
|
||||
{
|
||||
if (!fat_dir_entry_is_file (dir_entry)) return 0;
|
||||
@@ -310,7 +310,7 @@ fat_dir_entry_is_system_file (FatDirEntry* dir_entry)
|
||||
|| (dir_entry->attributes & HIDDEN_ATTR);
|
||||
}
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
fat_dir_entry_is_directory (FatDirEntry* dir_entry)
|
||||
{
|
||||
if (dir_entry->attributes == VFAT_ATTR) return 0;
|
||||
diff --git a/libparted/fs/r/hfs/advfs.c b/libparted/fs/r/hfs/advfs.c
|
||||
index d0afa30..0a39960 100644
|
||||
--- a/libparted/fs/r/hfs/advfs.c
|
||||
+++ b/libparted/fs/r/hfs/advfs.c
|
||||
@@ -239,7 +239,7 @@ errbb: hfs_free_bad_blocks_list(priv_data->bad_blocks_xtent_list);
|
||||
}
|
||||
|
||||
/* This function check if fblock is a bad block */
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
hfs_is_bad_block (const PedFileSystem *fs, unsigned int fblock)
|
||||
{
|
||||
HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
|
||||
@@ -304,7 +304,7 @@ hfs_get_empty_end (const PedFileSystem *fs)
|
||||
|
||||
/* return the block which should be used to pack data to have at
|
||||
least free fblock blocks at the end of the volume */
|
||||
-unsigned int
|
||||
+unsigned int _GL_ATTRIBUTE_PURE
|
||||
hfs_find_start_pack (const PedFileSystem *fs, unsigned int fblock)
|
||||
{
|
||||
HfsPrivateFSData* priv_data = (HfsPrivateFSData*)
|
||||
diff --git a/libparted/fs/r/hfs/advfs_plus.c b/libparted/fs/r/hfs/advfs_plus.c
|
||||
index 5453c25..2b6fd87 100644
|
||||
--- a/libparted/fs/r/hfs/advfs_plus.c
|
||||
+++ b/libparted/fs/r/hfs/advfs_plus.c
|
||||
@@ -247,7 +247,7 @@ errbbp: hfsplus_free_bad_blocks_list(priv_data->bad_blocks_xtent_list);
|
||||
}
|
||||
|
||||
/* This function check if fblock is a bad block */
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_PURE
|
||||
hfsplus_is_bad_block (const PedFileSystem *fs, unsigned int fblock)
|
||||
{
|
||||
HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
|
||||
@@ -358,7 +358,7 @@ hfsplus_get_min_size (const PedFileSystem *fs)
|
||||
|
||||
/* return the block which should be used to pack data to have
|
||||
at least free fblock blocks at the end of the volume */
|
||||
-unsigned int
|
||||
+unsigned int _GL_ATTRIBUTE_PURE
|
||||
hfsplus_find_start_pack (const PedFileSystem *fs, unsigned int fblock)
|
||||
{
|
||||
HfsPPrivateFSData* priv_data = (HfsPPrivateFSData*)
|
||||
--
|
||||
2.26.2
|
||||
|
104
0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
Normal file
104
0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
Normal file
@ -0,0 +1,104 @@
|
||||
From 34347779d3235186a68a040d3f3166ff45e65dac Mon Sep 17 00:00:00 2001
|
||||
From: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Date: Wed, 14 Aug 2019 10:59:20 +0900
|
||||
Subject: [PATCH 21/42] libparted: Fix warnings from GCC 8
|
||||
-Wsuggest-attribute=const
|
||||
|
||||
As GCC 8 suggests, add 'const' attribute to six functions. After adding
|
||||
const attributes, GCC suggested two more functions to add const
|
||||
attributes. Add const attributes to those functions also. In total, add
|
||||
const attributes to 8 functions.
|
||||
|
||||
I read code of the functions and confirmed they are const: they examine
|
||||
only their arguments and have no effect other than return value.
|
||||
|
||||
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
|
||||
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
||||
---
|
||||
libparted/fs/r/fat/calc.c | 14 +++++++-------
|
||||
libparted/fs/r/fat/table.c | 2 +-
|
||||
2 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c
|
||||
index 60c6bac..18e0455 100644
|
||||
--- a/libparted/fs/r/fat/calc.c
|
||||
+++ b/libparted/fs/r/fat/calc.c
|
||||
@@ -23,7 +23,7 @@
|
||||
#ifndef DISCOVER_ONLY
|
||||
|
||||
/* returns the minimum size of clusters for a given file system type */
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_CONST
|
||||
fat_min_cluster_size (FatType fat_type) {
|
||||
switch (fat_type) {
|
||||
case FAT_TYPE_FAT12: return 1;
|
||||
@@ -33,7 +33,7 @@ fat_min_cluster_size (FatType fat_type) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static PedSector
|
||||
+static PedSector _GL_ATTRIBUTE_CONST
|
||||
_smallest_power2_over (PedSector ceiling)
|
||||
{
|
||||
PedSector result = 1;
|
||||
@@ -45,7 +45,7 @@ _smallest_power2_over (PedSector ceiling)
|
||||
}
|
||||
|
||||
/* returns the minimum size of clusters for a given file system type */
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_CONST
|
||||
fat_recommend_min_cluster_size (FatType fat_type, PedSector size) {
|
||||
switch (fat_type) {
|
||||
case FAT_TYPE_FAT12: return 1;
|
||||
@@ -59,7 +59,7 @@ fat_recommend_min_cluster_size (FatType fat_type, PedSector size) {
|
||||
}
|
||||
|
||||
/* returns the maxmimum size of clusters for a given file system type */
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_CONST
|
||||
fat_max_cluster_size (FatType fat_type) {
|
||||
switch (fat_type) {
|
||||
case FAT_TYPE_FAT12: return 1; /* dunno... who cares? */
|
||||
@@ -70,7 +70,7 @@ fat_max_cluster_size (FatType fat_type) {
|
||||
}
|
||||
|
||||
/* returns the minimum number of clusters for a given file system type */
|
||||
-FatCluster
|
||||
+FatCluster _GL_ATTRIBUTE_CONST
|
||||
fat_min_cluster_count (FatType fat_type) {
|
||||
switch (fat_type) {
|
||||
case FAT_TYPE_FAT12:
|
||||
@@ -83,7 +83,7 @@ fat_min_cluster_count (FatType fat_type) {
|
||||
}
|
||||
|
||||
/* returns the maximum number of clusters for a given file system type */
|
||||
-FatCluster
|
||||
+FatCluster _GL_ATTRIBUTE_CONST
|
||||
fat_max_cluster_count (FatType fat_type) {
|
||||
switch (fat_type) {
|
||||
case FAT_TYPE_FAT12: return 0xff0;
|
||||
@@ -94,7 +94,7 @@ fat_max_cluster_count (FatType fat_type) {
|
||||
}
|
||||
|
||||
/* what is this supposed to be? What drugs are M$ on? (Can I have some? :-) */
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_CONST
|
||||
fat_min_reserved_sector_count (FatType fat_type)
|
||||
{
|
||||
return (fat_type == FAT_TYPE_FAT32) ? 32 : 1;
|
||||
diff --git a/libparted/fs/r/fat/table.c b/libparted/fs/r/fat/table.c
|
||||
index 98b0499..394a519 100644
|
||||
--- a/libparted/fs/r/fat/table.c
|
||||
+++ b/libparted/fs/r/fat/table.c
|
||||
@@ -462,7 +462,7 @@ fat_table_set_avail (FatTable* ft, FatCluster cluster)
|
||||
|
||||
#endif /* !DISCOVER_ONLY */
|
||||
|
||||
-int
|
||||
+int _GL_ATTRIBUTE_CONST
|
||||
fat_table_entry_size (FatType fat_type)
|
||||
{
|
||||
switch (fat_type) {
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,41 @@
|
||||
From b11bbb5a0b5c357816bff424c2a325806d60f20b Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Mon, 9 Nov 2020 14:33:37 -0800
|
||||
Subject: [PATCH 22/42] bsd: Fix gcc complaints when using boot_code pointer
|
||||
|
||||
---
|
||||
libparted/labels/bsd.c | 13 +++++--------
|
||||
1 file changed, 5 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
|
||||
index 6946563..8483641 100644
|
||||
--- a/libparted/labels/bsd.c
|
||||
+++ b/libparted/labels/bsd.c
|
||||
@@ -307,19 +307,16 @@ error:
|
||||
static void
|
||||
_probe_and_add_boot_code (const PedDisk* disk)
|
||||
{
|
||||
- char *old_boot_code;
|
||||
- BSDRawLabel *old_label;
|
||||
+ BSDDiskData *old_data;
|
||||
|
||||
void *s0;
|
||||
if (!ptt_read_sector (disk->dev, 0, &s0))
|
||||
return;
|
||||
- old_boot_code = ((BSDDiskData*) s0)->boot_code;
|
||||
- old_label = &((BSDDiskData*) s0)->label;
|
||||
-
|
||||
- if (old_boot_code [0]
|
||||
- && old_label->d_magic == PED_CPU_TO_LE32 (BSD_DISKMAGIC)) {
|
||||
+ old_data = (BSDDiskData*) s0;
|
||||
+ if (old_data->boot_code [0]
|
||||
+ && old_data->label.d_magic == PED_CPU_TO_LE32 (BSD_DISKMAGIC)) {
|
||||
BSDDiskData *bsd_specific = (BSDDiskData*) disk->disk_specific;
|
||||
- memcpy (bsd_specific, old_boot_code, sizeof (BSDDiskData));
|
||||
+ memcpy (bsd_specific, old_data, sizeof (BSDDiskData));
|
||||
}
|
||||
free (s0);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,25 @@
|
||||
From 1ff56b03ec960435d55e200300093581ba874d53 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Mon, 9 Nov 2020 15:09:07 -0800
|
||||
Subject: [PATCH 23/42] dos: Fix gcc complaints when using boot_code pointer
|
||||
|
||||
---
|
||||
libparted/labels/dos.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
|
||||
index d859b33..bfa253b 100644
|
||||
--- a/libparted/labels/dos.c
|
||||
+++ b/libparted/labels/dos.c
|
||||
@@ -1291,7 +1291,7 @@ msdos_write (const PedDisk* disk)
|
||||
DosRawTable *table = (DosRawTable *) s0;
|
||||
|
||||
if (!table->boot_code[0]) {
|
||||
- memset (table->boot_code, 0, 512);
|
||||
+ memset (table, 0, 512);
|
||||
memcpy (table->boot_code, MBR_BOOT_CODE, sizeof (MBR_BOOT_CODE));
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,38 @@
|
||||
From c3e648518235e1f77ca496c1234459e4bac300ad Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Mon, 9 Nov 2020 15:16:22 -0800
|
||||
Subject: [PATCH 24/42] linux: Fix gcc complains about signed sccanf variables
|
||||
|
||||
---
|
||||
libparted/arch/linux.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
|
||||
index 09ec781..4c17720 100644
|
||||
--- a/libparted/arch/linux.c
|
||||
+++ b/libparted/arch/linux.c
|
||||
@@ -720,9 +720,9 @@ _get_linux_version ()
|
||||
static int kver = -1;
|
||||
|
||||
struct utsname uts;
|
||||
- int major = 0;
|
||||
- int minor = 0;
|
||||
- int teeny = 0;
|
||||
+ unsigned int major = 0;
|
||||
+ unsigned int minor = 0;
|
||||
+ unsigned int teeny = 0;
|
||||
|
||||
if (kver != -1)
|
||||
return kver;
|
||||
@@ -2884,7 +2884,7 @@ _dm_get_partition_start_and_length(PedPartition const *part,
|
||||
char *params;
|
||||
char *target_type;
|
||||
dm_get_next_target(task, NULL, (uint64_t *)start, (uint64_t *)length, &target_type, ¶ms);
|
||||
- if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3)
|
||||
+ if (sscanf (params, "%d:%d %Lu", &major, &minor, start) != 3)
|
||||
goto err;
|
||||
rc = 1;
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
25
0025-tests-Fix-unsigned-warning-in-duplicate.c.patch
Normal file
25
0025-tests-Fix-unsigned-warning-in-duplicate.c.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 09fb0fc6dadde9982d243567cf92743149895102 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Mon, 9 Nov 2020 15:53:30 -0800
|
||||
Subject: [PATCH 25/42] tests: Fix unsigned warning in duplicate.c
|
||||
|
||||
---
|
||||
tests/duplicate.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/duplicate.c b/tests/duplicate.c
|
||||
index a9dde84..771faab 100644
|
||||
--- a/tests/duplicate.c
|
||||
+++ b/tests/duplicate.c
|
||||
@@ -134,7 +134,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
if (!ped_partition_is_flag_available(disk_part, flag))
|
||||
continue;
|
||||
- fprintf (stderr, "Checking partition flag %d\n", flag);
|
||||
+ fprintf (stderr, "Checking partition flag %u\n", flag);
|
||||
fprintf (stderr, "%d ? %d\n", ped_partition_get_flag (disk_part, flag),
|
||||
ped_partition_get_flag (copy_part, flag));
|
||||
assert (ped_partition_get_flag (disk_part, flag)
|
||||
--
|
||||
2.26.2
|
||||
|
41
0026-hfs-Fix-gcc-10-bounds-check-warning.patch
Normal file
41
0026-hfs-Fix-gcc-10-bounds-check-warning.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From b7ccc1b29674937ab4c97d0e1b7b5bfd6f366b92 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 10 Nov 2020 15:42:46 -0800
|
||||
Subject: [PATCH 26/42] hfs: Fix gcc 10 bounds check warning
|
||||
|
||||
binfo is actually a list of structs that cannot be known until runtime,
|
||||
so use a variable length array.
|
||||
---
|
||||
libparted/fs/hfs/hfs.h | 2 +-
|
||||
libparted/fs/r/hfs/hfs.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/hfs/hfs.h b/libparted/fs/hfs/hfs.h
|
||||
index 4fa2e95..0a9392a 100644
|
||||
--- a/libparted/fs/hfs/hfs.h
|
||||
+++ b/libparted/fs/hfs/hfs.h
|
||||
@@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader {
|
||||
uint32_t bytes_used;
|
||||
uint32_t checksum;
|
||||
uint32_t pad;
|
||||
- HfsJBlockInfo binfo[1];
|
||||
+ HfsJBlockInfo binfo[];
|
||||
};
|
||||
typedef struct _HfsJBlockListHeader HfsJBlockListHeader;
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/hfs.h b/libparted/fs/r/hfs/hfs.h
|
||||
index 4fa2e95..0a9392a 100644
|
||||
--- a/libparted/fs/r/hfs/hfs.h
|
||||
+++ b/libparted/fs/r/hfs/hfs.h
|
||||
@@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader {
|
||||
uint32_t bytes_used;
|
||||
uint32_t checksum;
|
||||
uint32_t pad;
|
||||
- HfsJBlockInfo binfo[1];
|
||||
+ HfsJBlockInfo binfo[];
|
||||
};
|
||||
typedef struct _HfsJBlockListHeader HfsJBlockListHeader;
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,74 @@
|
||||
From 868fab2fea9ad6422b2ee9b3c1ab9e69d5a4f9a7 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 10 Nov 2020 16:15:49 -0800
|
||||
Subject: [PATCH 27/42] hfs/advfs: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/advfs.c | 25 ++++++++++++++-----------
|
||||
1 file changed, 14 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/advfs.c b/libparted/fs/r/hfs/advfs.c
|
||||
index 0a39960..1ce4319 100644
|
||||
--- a/libparted/fs/r/hfs/advfs.c
|
||||
+++ b/libparted/fs/r/hfs/advfs.c
|
||||
@@ -87,12 +87,14 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
|
||||
HfsPrivateGenericKey* record_key = NULL;
|
||||
unsigned int node_number, record_number;
|
||||
int i;
|
||||
+ uint16_t record_pos;
|
||||
|
||||
/* Read the header node */
|
||||
if (!hfs_file_read_sector(b_tree_file, node, 0))
|
||||
return 0;
|
||||
- header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(PED_SECTOR_SIZE_DEFAULT-2))))));
|
||||
+ uint16_t offset;
|
||||
+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t));
|
||||
+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset));
|
||||
|
||||
/* Get the node number of the root */
|
||||
node_number = PED_BE32_TO_CPU(header->root_node);
|
||||
@@ -107,13 +109,13 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
|
||||
while (1) {
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = record_number; i; i--) {
|
||||
- record_key = (HfsPrivateGenericKey*)
|
||||
- (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t));
|
||||
+ record_pos = PED_BE16_TO_CPU(value);
|
||||
+ record_key = (HfsPrivateGenericKey*) (node + record_pos);
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)record_key - node < HFS_FIRST_REC)
|
||||
- || ((uint8_t*)record_key - node
|
||||
- >= PED_SECTOR_SIZE_DEFAULT
|
||||
+ if ((record_pos< HFS_FIRST_REC)
|
||||
+ || (record_pos>= PED_SECTOR_SIZE_DEFAULT
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
ped_exception_throw (
|
||||
PED_EXCEPTION_ERROR,
|
||||
@@ -129,8 +131,9 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
|
||||
unsigned int skip;
|
||||
|
||||
skip = (1 + record_key->key_length + 1) & ~1;
|
||||
- node_number = PED_BE32_TO_CPU (*((uint32_t *)
|
||||
- (((uint8_t *) record_key) + skip)));
|
||||
+ uint32_t value;
|
||||
+ memcpy(&value, node+record_pos+skip, sizeof(uint32_t));
|
||||
+ node_number = PED_BE32_TO_CPU(value);
|
||||
if (!hfs_file_read_sector(b_tree_file, node,
|
||||
node_number))
|
||||
return 0;
|
||||
@@ -146,7 +149,7 @@ hfs_btree_search (HfsPrivateFile* b_tree_file, HfsPrivateGenericKey* key,
|
||||
if (record_ref) {
|
||||
record_ref->node_size = 1; /* in sectors */
|
||||
record_ref->node_number = node_number;
|
||||
- record_ref->record_pos = (uint8_t*)record_key - node;
|
||||
+ record_ref->record_pos = record_pos;
|
||||
record_ref->record_number = i;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,75 @@
|
||||
From 6cb1ed79543f9a9425de2b334a41e08836edc6b8 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 10 Nov 2020 17:05:59 -0800
|
||||
Subject: [PATCH 28/42] hfs/advfs_plus: Fix gcc 10 warnings about cast
|
||||
alignment
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/advfs_plus.c | 22 ++++++++++++----------
|
||||
1 file changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/advfs_plus.c b/libparted/fs/r/hfs/advfs_plus.c
|
||||
index 2b6fd87..2141746 100644
|
||||
--- a/libparted/fs/r/hfs/advfs_plus.c
|
||||
+++ b/libparted/fs/r/hfs/advfs_plus.c
|
||||
@@ -80,6 +80,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
|
||||
HfsPPrivateGenericKey* record_key = NULL;
|
||||
unsigned int node_number, record_number, size, bsize;
|
||||
int i;
|
||||
+ uint16_t record_pos;
|
||||
|
||||
/* Read the header node */
|
||||
if (!hfsplus_file_read_sector(b_tree_file, node_1, 0))
|
||||
@@ -93,7 +94,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
|
||||
|
||||
/* Get the size of a node in sectors and allocate buffer */
|
||||
size = (bsize = PED_BE16_TO_CPU (header->node_size)) / PED_SECTOR_SIZE_DEFAULT;
|
||||
- node = (uint8_t*) ped_malloc (bsize);
|
||||
+ node = ped_malloc (bsize);
|
||||
if (!node)
|
||||
return 0;
|
||||
HfsPNodeDescriptor *desc = (HfsPNodeDescriptor*) node;
|
||||
@@ -107,13 +108,13 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
|
||||
while (1) {
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = record_number; i; i--) {
|
||||
- record_key = (HfsPPrivateGenericKey*)
|
||||
- (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(bsize - 2*i)))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t));
|
||||
+ record_pos = PED_BE16_TO_CPU(value);
|
||||
+ record_key = (HfsPPrivateGenericKey*) (node + record_pos);
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)record_key - node < HFS_FIRST_REC)
|
||||
- || ((uint8_t*)record_key - node
|
||||
- >= (signed)bsize
|
||||
+ if ((record_pos < HFS_FIRST_REC)
|
||||
+ || (record_pos >= (signed)bsize
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
ped_exception_throw (
|
||||
PED_EXCEPTION_ERROR,
|
||||
@@ -131,8 +132,9 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
|
||||
|
||||
skip = ( 2 + PED_BE16_TO_CPU (record_key->key_length)
|
||||
+ 1 ) & ~1;
|
||||
- node_number = PED_BE32_TO_CPU (*((uint32_t *)
|
||||
- (((uint8_t *) record_key) + skip)));
|
||||
+ uint32_t value;
|
||||
+ memcpy(&value, node+record_pos+skip, sizeof(uint32_t));
|
||||
+ node_number = PED_BE32_TO_CPU(value);
|
||||
if (!hfsplus_file_read(b_tree_file, node,
|
||||
(PedSector) node_number * size,
|
||||
size)) {
|
||||
@@ -151,7 +153,7 @@ hfsplus_btree_search (HfsPPrivateFile* b_tree_file, HfsPPrivateGenericKey* key,
|
||||
if (record_ref) {
|
||||
record_ref->node_size = size; /* in sectors */
|
||||
record_ref->node_number = node_number;
|
||||
- record_ref->record_pos = (uint8_t*)record_key - node;
|
||||
+ record_ref->record_pos = record_pos;
|
||||
record_ref->record_number = i;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
33
0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
33
0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 006ad756c70603212309157fa05c5d855e25f07e Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 13:33:36 -0800
|
||||
Subject: [PATCH 29/42] hfs/hfs: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/hfs.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
|
||||
index 0aababd..09899da 100644
|
||||
--- a/libparted/fs/r/hfs/hfs.c
|
||||
+++ b/libparted/fs/r/hfs/hfs.c
|
||||
@@ -891,12 +891,11 @@ hfsplus_wrapper_update (PedFileSystem* fs)
|
||||
ref.record_number = 1;
|
||||
}
|
||||
|
||||
- ref.record_pos =
|
||||
- PED_BE16_TO_CPU (*((uint16_t *)
|
||||
- (node + (PED_SECTOR_SIZE_DEFAULT
|
||||
- - 2*ref.record_number))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+PED_SECTOR_SIZE_DEFAULT - (2*ref.record_number), sizeof(uint16_t));
|
||||
+ ref.record_pos = PED_BE16_TO_CPU(value);
|
||||
ret_key = (HfsExtentKey*) (node + ref.record_pos);
|
||||
- ret_data = (HfsExtDescriptor*) ( node + ref.record_pos
|
||||
+ ret_data = (HfsExtDescriptor*) (node + ref.record_pos
|
||||
+ sizeof (HfsExtentKey) );
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
47
0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
47
0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 1e086dba260630b63e0822731522ce04c081d95e Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Tue, 10 Nov 2020 14:39:06 -0800
|
||||
Subject: [PATCH 30/42] ext2: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/ext2/ext2_fs.h | 2 +-
|
||||
libparted/fs/ext2/interface.c | 7 ++++---
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/ext2/ext2_fs.h b/libparted/fs/ext2/ext2_fs.h
|
||||
index ac1b6a0..362f8bc 100644
|
||||
--- a/libparted/fs/ext2/ext2_fs.h
|
||||
+++ b/libparted/fs/ext2/ext2_fs.h
|
||||
@@ -173,7 +173,7 @@ struct ext2_inode
|
||||
|
||||
#define i_size_high i_dir_acl
|
||||
|
||||
-struct ext2_super_block
|
||||
+struct __attribute__ ((packed)) ext2_super_block
|
||||
{
|
||||
uint32_t s_inodes_count; /* Inodes count */
|
||||
uint32_t s_blocks_count; /* Blocks count */
|
||||
diff --git a/libparted/fs/ext2/interface.c b/libparted/fs/ext2/interface.c
|
||||
index a49568b..01c224e 100644
|
||||
--- a/libparted/fs/ext2/interface.c
|
||||
+++ b/libparted/fs/ext2/interface.c
|
||||
@@ -33,12 +33,13 @@ struct ext2_dev_handle* ext2_make_dev_handle_from_parted_geometry(PedGeometry* g
|
||||
static PedGeometry*
|
||||
_ext2_generic_probe (PedGeometry* geom, int expect_ext_ver)
|
||||
{
|
||||
+ struct ext2_super_block *sb;
|
||||
const int sectors = (4096 + geom->dev->sector_size - 1) /
|
||||
geom->dev->sector_size;
|
||||
- char *sb_v = alloca (sectors * geom->dev->sector_size);
|
||||
- if (!ped_geometry_read(geom, sb_v, 0, sectors))
|
||||
+ uint8_t *buf = alloca (sectors * geom->dev->sector_size);
|
||||
+ if (!ped_geometry_read(geom, buf, 0, sectors))
|
||||
return NULL;
|
||||
- struct ext2_super_block *sb = (struct ext2_super_block *)(sb_v + 1024);
|
||||
+ sb = (struct ext2_super_block *)(buf+1024);
|
||||
|
||||
if (EXT2_SUPER_MAGIC(*sb) == EXT2_SUPER_MAGIC_CONST) {
|
||||
PedSector block_size = (EXT2_MIN_BLOCK_SIZE << (EXT2_SUPER_LOG_BLOCK_SIZE(*sb))) / geom->dev->sector_size;
|
||||
--
|
||||
2.26.2
|
||||
|
49
0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
49
0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From 362571d09da09fb2b6fab7037af26d83b2d39b75 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:08:31 -0800
|
||||
Subject: [PATCH 31/42] nilfs2: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/nilfs2/nilfs2.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/nilfs2/nilfs2.c b/libparted/fs/nilfs2/nilfs2.c
|
||||
index 3ca4808..2871179 100644
|
||||
--- a/libparted/fs/nilfs2/nilfs2.c
|
||||
+++ b/libparted/fs/nilfs2/nilfs2.c
|
||||
@@ -34,8 +34,7 @@
|
||||
/* secondary superblock offset in 512byte blocks. */
|
||||
#define NILFS_SB2_OFFSET(devsize) ((((devsize)>>3) - 1) << 3)
|
||||
|
||||
-struct nilfs2_super_block
|
||||
-{
|
||||
+struct __attribute__ ((packed)) nilfs2_super_block {
|
||||
uint32_t s_rev_level;
|
||||
uint16_t s_minor_rev_level;
|
||||
uint16_t s_magic;
|
||||
@@ -112,18 +111,18 @@ nilfs2_probe (PedGeometry* geom)
|
||||
return NULL;
|
||||
const int sectors = (4096 + geom->dev->sector_size - 1) /
|
||||
geom->dev->sector_size;
|
||||
- char *buf = alloca (sectors * geom->dev->sector_size);
|
||||
+ uint8_t *buf = alloca (sectors * geom->dev->sector_size);
|
||||
const int sectors2 = (1024 + geom->dev->sector_size -1 ) /
|
||||
geom->dev->sector_size;
|
||||
void *buff2 = alloca (sectors2 * geom->dev->sector_size);
|
||||
|
||||
if (ped_geometry_read(geom, buf, 0, sectors))
|
||||
- sb = (struct nilfs2_super_block *)(buf+1024);
|
||||
+ sb = (struct nilfs2_super_block*)(buf + 1024);
|
||||
if (ped_geometry_read(geom, buff2, sb2off, sectors2))
|
||||
- sb2 = buff2;
|
||||
+ sb2 = (struct nilfs2_super_block*)buff2;
|
||||
|
||||
if ((!sb || !is_valid_nilfs_sb(sb)) &&
|
||||
- (!sb2 || !is_valid_nilfs_sb(sb2)) )
|
||||
+ (!sb2 || !is_valid_nilfs_sb(sb2)))
|
||||
return NULL;
|
||||
|
||||
/* reserve 4k bytes for secondary superblock */
|
||||
--
|
||||
2.26.2
|
||||
|
39
0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
39
0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From e2ee2628c5d75b375db90a486b906c0d2405b8b3 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:18:42 -0800
|
||||
Subject: [PATCH 32/42] ntfs: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/ntfs/ntfs.c | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/ntfs/ntfs.c b/libparted/fs/ntfs/ntfs.c
|
||||
index 3bfb28e..a3a6550 100644
|
||||
--- a/libparted/fs/ntfs/ntfs.c
|
||||
+++ b/libparted/fs/ntfs/ntfs.c
|
||||
@@ -35,16 +35,17 @@
|
||||
PedGeometry*
|
||||
ntfs_probe (PedGeometry* geom)
|
||||
{
|
||||
- char *buf = alloca (geom->dev->sector_size);
|
||||
+ uint8_t *buf = alloca(geom->dev->sector_size);
|
||||
PedGeometry *newg = NULL;
|
||||
|
||||
if (!ped_geometry_read(geom, buf, 0, 1))
|
||||
return 0;
|
||||
|
||||
- if (strncmp (NTFS_SIGNATURE, buf + 3, strlen (NTFS_SIGNATURE)) == 0)
|
||||
- newg = ped_geometry_new (geom->dev, geom->start,
|
||||
- PED_LE64_TO_CPU (*(uint64_t*)
|
||||
- (buf + 0x28)));
|
||||
+ if (strncmp (NTFS_SIGNATURE, ((char *)buf + 3), strlen (NTFS_SIGNATURE)) == 0) {
|
||||
+ uint64_t length;
|
||||
+ memcpy(&length, buf + 0x28, sizeof(uint64_t));
|
||||
+ newg = ped_geometry_new (geom->dev, geom->start, length);
|
||||
+ }
|
||||
return newg;
|
||||
}
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
51
0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
51
0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From 65d95eaf5692f7d19f2b550dee4c9b585ce79938 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:19:10 -0800
|
||||
Subject: [PATCH 33/42] ufs: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/ufs/ufs.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/ufs/ufs.c b/libparted/fs/ufs/ufs.c
|
||||
index 27cb036..f677b60 100644
|
||||
--- a/libparted/fs/ufs/ufs.c
|
||||
+++ b/libparted/fs/ufs/ufs.c
|
||||
@@ -45,14 +45,14 @@
|
||||
#define UFS_MAGIC_FEA 0x00195612
|
||||
#define UFS_MAGIC_4GB 0x05231994
|
||||
|
||||
-struct ufs_csum {
|
||||
+struct __attribute__ ((packed)) ufs_csum {
|
||||
uint32_t cs_ndir; /* number of directories */
|
||||
uint32_t cs_nbfree; /* number of free blocks */
|
||||
uint32_t cs_nifree; /* number of free inodes */
|
||||
uint32_t cs_nffree; /* number of free frags */
|
||||
};
|
||||
|
||||
-struct ufs_super_block {
|
||||
+struct __attribute__ ((packed)) ufs_super_block {
|
||||
uint32_t fs_link; /* UNUSED */
|
||||
uint32_t fs_rlink; /* UNUSED */
|
||||
uint32_t fs_sblkno; /* addr of super-block in filesys */
|
||||
@@ -176,7 +176,7 @@ ufs_probe_sun (PedGeometry* geom)
|
||||
{
|
||||
const int sectors = ((3 * 512) + geom->dev->sector_size - 1) /
|
||||
geom->dev->sector_size;
|
||||
- char * buf = alloca (sectors * geom->dev->sector_size);
|
||||
+ uint8_t* buf = alloca (sectors * geom->dev->sector_size);
|
||||
struct ufs_super_block *sb;
|
||||
|
||||
if (geom->length < 5)
|
||||
@@ -212,7 +212,7 @@ ufs_probe_hp (PedGeometry* geom)
|
||||
return 0;
|
||||
const int sectors = ((3 * 512) + geom->dev->sector_size - 1) /
|
||||
geom->dev->sector_size;
|
||||
- char * buf = alloca (sectors * geom->dev->sector_size);
|
||||
+ uint8_t* buf = alloca (sectors * geom->dev->sector_size);
|
||||
|
||||
if (!ped_geometry_read (geom, buf, 16 * 512 / geom->dev->sector_size, sectors))
|
||||
return 0;
|
||||
--
|
||||
2.26.2
|
||||
|
27
0034-ped_assert-Fix-incorrect-exception-option.patch
Normal file
27
0034-ped_assert-Fix-incorrect-exception-option.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From c21ee3827639343920d3f08cff319620d3582d2a Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:19:36 -0800
|
||||
Subject: [PATCH 34/42] ped_assert: Fix incorrect exception option
|
||||
|
||||
PED_EXCEPTION_FATAL is a type, not an option. A PED_EXCEPTION_BUG should
|
||||
always select CANCEL.
|
||||
---
|
||||
libparted/debug.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libparted/debug.c b/libparted/debug.c
|
||||
index c4932ca..227673e 100644
|
||||
--- a/libparted/debug.c
|
||||
+++ b/libparted/debug.c
|
||||
@@ -106,7 +106,7 @@ void ped_assert (const char* cond_text,
|
||||
/* Throw the exception */
|
||||
ped_exception_throw (
|
||||
PED_EXCEPTION_BUG,
|
||||
- PED_EXCEPTION_FATAL,
|
||||
+ PED_EXCEPTION_CANCEL,
|
||||
_("Assertion (%s) at %s:%d in function %s() failed."),
|
||||
cond_text, file, line, function);
|
||||
abort ();
|
||||
--
|
||||
2.26.2
|
||||
|
27
0035-ui-Fix-command_line_get_disk_flag.patch
Normal file
27
0035-ui-Fix-command_line_get_disk_flag.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 45e4c689c81cc55f849d3f90168a6b89c0168191 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:30:57 -0800
|
||||
Subject: [PATCH 35/42] ui: Fix command_line_get_disk_flag
|
||||
|
||||
It was using PedPartitionFlag instead of PedDiskFlag when walking the
|
||||
available flags.
|
||||
---
|
||||
parted/ui.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parted/ui.c b/parted/ui.c
|
||||
index 7b5374d..8e1f2fe 100644
|
||||
--- a/parted/ui.c
|
||||
+++ b/parted/ui.c
|
||||
@@ -1138,7 +1138,7 @@ command_line_get_disk_flag (const char* prompt, const PedDisk* disk,
|
||||
PedDiskFlag* flag)
|
||||
{
|
||||
StrList* opts = NULL;
|
||||
- PedPartitionFlag walk = 0;
|
||||
+ PedDiskFlag walk = 0;
|
||||
char* flag_name;
|
||||
|
||||
while ( (walk = ped_disk_flag_next (walk)) ) {
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,31 @@
|
||||
From 6e34cb98ddef0c9fd47359a2006265e7251e8830 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Thu, 12 Nov 2020 16:49:29 -0800
|
||||
Subject: [PATCH 36/42] ui: Fix gcc 10 warning about snprintf truncating an int
|
||||
|
||||
Double the storage to 20 bytes.
|
||||
---
|
||||
parted/ui.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/parted/ui.c b/parted/ui.c
|
||||
index 8e1f2fe..73fdcf5 100644
|
||||
--- a/parted/ui.c
|
||||
+++ b/parted/ui.c
|
||||
@@ -909,11 +909,11 @@ command_line_get_word (const char* prompt, const char* def,
|
||||
int
|
||||
command_line_get_integer (const char* prompt, int* value)
|
||||
{
|
||||
- char def_str [10];
|
||||
+ char def_str [20];
|
||||
char* input;
|
||||
long ret;
|
||||
|
||||
- snprintf (def_str, 10, "%d", *value);
|
||||
+ snprintf (def_str, 20, "%d", *value);
|
||||
input = command_line_get_word (prompt, *value ? def_str : NULL,
|
||||
NULL, 1);
|
||||
if (!input)
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,98 @@
|
||||
From 76bf966849534a832c30cd89dbbb8a32939dcbed Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 13 Nov 2020 15:12:06 -0800
|
||||
Subject: [PATCH 37/42] hfs/reloc: Fix gcc 10 warnings about cast alignment
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/reloc.c | 35 ++++++++++++++++++++---------------
|
||||
1 file changed, 20 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/reloc.c b/libparted/fs/r/hfs/reloc.c
|
||||
index d0477ae..68b14ae 100644
|
||||
--- a/libparted/fs/r/hfs/reloc.c
|
||||
+++ b/libparted/fs/r/hfs/reloc.c
|
||||
@@ -373,6 +373,7 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
HfsExtDescriptor* extent;
|
||||
unsigned int leaf_node, record_number;
|
||||
unsigned int i, j;
|
||||
+ uint16_t catalog_pos;
|
||||
|
||||
if (!priv_data->catalog_file->sect_nb) {
|
||||
ped_exception_throw (
|
||||
@@ -385,8 +386,9 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
|
||||
if (!hfs_file_read_sector (priv_data->catalog_file, node, 0))
|
||||
return 0;
|
||||
- header = (HfsHeaderRecord*)(node + PED_BE16_TO_CPU(*((uint16_t*)
|
||||
- (node+(PED_SECTOR_SIZE_DEFAULT-2)))));
|
||||
+ uint16_t offset;
|
||||
+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t));
|
||||
+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset));
|
||||
|
||||
for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
|
||||
leaf_node;
|
||||
@@ -397,14 +399,15 @@ hfs_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = 1; i <= record_number; ++i) {
|
||||
/* undocumented alignement */
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t));
|
||||
+ catalog_pos = PED_BE16_TO_CPU(value);
|
||||
+ catalog_key = (HfsCatalogKey*) (node + catalog_pos);
|
||||
unsigned int skip;
|
||||
- catalog_key = (HfsCatalogKey*) (node + PED_BE16_TO_CPU(
|
||||
- *((uint16_t*)(node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
|
||||
skip = (1 + catalog_key->key_length + 1) & ~1;
|
||||
- catalog_data = (HfsCatalog*)( ((uint8_t*)catalog_key)
|
||||
- + skip );
|
||||
+ catalog_data = (HfsCatalog*)(node+catalog_pos+skip);
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)catalog_key - node < HFS_FIRST_REC)
|
||||
+ if ((catalog_pos < HFS_FIRST_REC)
|
||||
|| ((uint8_t*)catalog_data - node
|
||||
>= PED_SECTOR_SIZE_DEFAULT
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
@@ -467,6 +470,7 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
HfsExtDescriptor* extent;
|
||||
unsigned int leaf_node, record_number;
|
||||
unsigned int i, j;
|
||||
+ uint16_t extent_pos;
|
||||
|
||||
if (!priv_data->extent_file->sect_nb) {
|
||||
ped_exception_throw (
|
||||
@@ -479,8 +483,9 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
|
||||
if (!hfs_file_read_sector (priv_data->extent_file, node, 0))
|
||||
return 0;
|
||||
- header = ((HfsHeaderRecord*) (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(PED_SECTOR_SIZE_DEFAULT-2))))));
|
||||
+ uint16_t offset;
|
||||
+ memcpy(&offset, node+(PED_SECTOR_SIZE_DEFAULT-2), sizeof(uint16_t));
|
||||
+ header = (HfsHeaderRecord*) (node + PED_BE16_TO_CPU(offset));
|
||||
|
||||
for (leaf_node = PED_BE32_TO_CPU (header->first_leaf_node);
|
||||
leaf_node;
|
||||
@@ -491,14 +496,14 @@ hfs_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = 1; i <= record_number; i++) {
|
||||
uint8_t where;
|
||||
- extent_key = (HfsExtentKey*)
|
||||
- (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(PED_SECTOR_SIZE_DEFAULT - 2*i)))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(PED_SECTOR_SIZE_DEFAULT - (2*i)), sizeof(uint16_t));
|
||||
+ extent_pos = PED_BE16_TO_CPU(value);
|
||||
+ extent_key = (HfsExtentKey*)(node + extent_pos);
|
||||
/* size is cst */
|
||||
- extent = (HfsExtDescriptor*)(((uint8_t*)extent_key)
|
||||
- + sizeof (HfsExtentKey));
|
||||
+ extent = (HfsExtDescriptor*)(node+extent_pos+sizeof(HfsExtentKey));
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)extent_key - node < HFS_FIRST_REC)
|
||||
+ if ((extent_pos < HFS_FIRST_REC)
|
||||
|| ((uint8_t*)extent - node
|
||||
>= PED_SECTOR_SIZE_DEFAULT
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
--
|
||||
2.26.2
|
||||
|
103
0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch
Normal file
103
0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch
Normal file
@ -0,0 +1,103 @@
|
||||
From f496795a850976d211d3f5c673b868c3c90a8c3d Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 13 Nov 2020 15:25:35 -0800
|
||||
Subject: [PATCH 38/42] hfs/reloc_plus: Fix gcc 10 warnings about cast
|
||||
alignment
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/reloc_plus.c | 33 +++++++++++++++++++--------------
|
||||
1 file changed, 19 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/reloc_plus.c b/libparted/fs/r/hfs/reloc_plus.c
|
||||
index cebadbe..44c0a77 100644
|
||||
--- a/libparted/fs/r/hfs/reloc_plus.c
|
||||
+++ b/libparted/fs/r/hfs/reloc_plus.c
|
||||
@@ -486,6 +486,7 @@ hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
unsigned int i, j, size, bsize;
|
||||
uint32_t jib = priv_data->jib_start_block,
|
||||
jl = priv_data->jl_start_block;
|
||||
+ uint16_t catalog_pos;
|
||||
|
||||
if (!priv_data->catalog_file->sect_nb) {
|
||||
ped_exception_throw (
|
||||
@@ -520,15 +521,16 @@ hfsplus_cache_from_catalog(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
unsigned int skip;
|
||||
uint8_t where;
|
||||
|
||||
- catalog_key = (HfsPCatalogKey*)
|
||||
- ( node + PED_BE16_TO_CPU (*((uint16_t *)
|
||||
- (node+(bsize - 2*i)))) );
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t));
|
||||
+ catalog_pos = PED_BE16_TO_CPU(value);
|
||||
+ catalog_key = (HfsPCatalogKey*)(node + catalog_pos);
|
||||
skip = ( 2 + PED_BE16_TO_CPU (catalog_key->key_length)
|
||||
+ 1) & ~1;
|
||||
catalog_data = (HfsPCatalog*)
|
||||
(((uint8_t*)catalog_key) + skip);
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)catalog_key - node < HFS_FIRST_REC)
|
||||
+ if ((catalog_pos < HFS_FIRST_REC)
|
||||
|| ((uint8_t*)catalog_data - node
|
||||
>= (signed) bsize
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
@@ -609,6 +611,7 @@ hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
HfsPExtDescriptor* extent;
|
||||
unsigned int leaf_node, record_number;
|
||||
unsigned int i, j, size, bsize;
|
||||
+ uint16_t extent_pos;
|
||||
|
||||
if (!priv_data->extents_file->sect_nb) {
|
||||
ped_exception_throw (
|
||||
@@ -640,13 +643,14 @@ hfsplus_cache_from_extent(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = 1; i <= record_number; i++) {
|
||||
uint8_t where;
|
||||
- extent_key = (HfsPExtentKey*)
|
||||
- (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(bsize - 2*i)))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t));
|
||||
+ extent_pos = PED_BE16_TO_CPU(value);
|
||||
+ extent_key = (HfsPExtentKey*)(node + extent_pos);
|
||||
extent = (HfsPExtDescriptor*)
|
||||
(((uint8_t*)extent_key) + sizeof (HfsPExtentKey));
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)extent_key - node < HFS_FIRST_REC)
|
||||
+ if ((extent_pos < HFS_FIRST_REC)
|
||||
|| ((uint8_t*)extent - node
|
||||
>= (signed)bsize
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
@@ -724,6 +728,7 @@ hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
HfsPExtDescriptor* extent;
|
||||
unsigned int leaf_node, record_number;
|
||||
unsigned int i, j, size, bsize;
|
||||
+ uint16_t generic_pos;
|
||||
|
||||
/* attributes file is facultative */
|
||||
if (!priv_data->attributes_file->sect_nb)
|
||||
@@ -751,15 +756,15 @@ hfsplus_cache_from_attributes(HfsCPrivateCache* cache, PedFileSystem* fs,
|
||||
record_number = PED_BE16_TO_CPU (desc->rec_nb);
|
||||
for (i = 1; i <= record_number; i++) {
|
||||
unsigned int skip;
|
||||
- generic_key = (HfsPPrivateGenericKey*)
|
||||
- (node + PED_BE16_TO_CPU(*((uint16_t *)
|
||||
- (node+(bsize - 2*i)))));
|
||||
+ uint16_t value;
|
||||
+ memcpy(&value, node+(bsize - (2*i)), sizeof(uint16_t));
|
||||
+ generic_pos = PED_BE16_TO_CPU(value);
|
||||
+ generic_key = (HfsPPrivateGenericKey*)(node + generic_pos);
|
||||
skip = ( 2 + PED_BE16_TO_CPU (generic_key->key_length)
|
||||
+ 1 ) & ~1;
|
||||
- fork_ext_data = (HfsPForkDataAttr*)
|
||||
- (((uint8_t*)generic_key) + skip);
|
||||
+ fork_ext_data = (HfsPForkDataAttr*)(node+generic_pos+skip);
|
||||
/* check for obvious error in FS */
|
||||
- if (((uint8_t*)generic_key - node < HFS_FIRST_REC)
|
||||
+ if ((generic_pos < HFS_FIRST_REC)
|
||||
|| ((uint8_t*)fork_ext_data - node
|
||||
>= (signed) bsize
|
||||
- 2 * (signed)(record_number+1))) {
|
||||
--
|
||||
2.26.2
|
||||
|
350
0039-fs-r-fat-Remove-disabled-code.patch
Normal file
350
0039-fs-r-fat-Remove-disabled-code.patch
Normal file
@ -0,0 +1,350 @@
|
||||
From d2cc30120427394f6eaaa60acfbe647fb82a9762 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 20 Nov 2020 13:21:25 -0800
|
||||
Subject: [PATCH 39/42] fs/r/fat: Remove disabled code
|
||||
|
||||
---
|
||||
libparted/fs/r/fat/count.c | 83 -----------------
|
||||
libparted/fs/r/fat/fat.c | 175 ------------------------------------
|
||||
libparted/fs/r/fat/resize.c | 17 ----
|
||||
3 files changed, 275 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/fat/count.c b/libparted/fs/r/fat/count.c
|
||||
index 2b65e72..51e1aa2 100644
|
||||
--- a/libparted/fs/r/fat/count.c
|
||||
+++ b/libparted/fs/r/fat/count.c
|
||||
@@ -27,66 +27,6 @@
|
||||
|
||||
#ifndef DISCOVER_ONLY
|
||||
|
||||
-#if 0
|
||||
-/* extremely ugly hack: stick everything that obviously isn't an unmovable file
|
||||
- * in here. Note: DAT is a bit dubious. Unfortunately, it's used by the
|
||||
- * registry, so it'll be all over the place :-(
|
||||
- */
|
||||
-static char* movable_extensions[] = {
|
||||
- "",
|
||||
- "1ST",
|
||||
- "AVI",
|
||||
- "BAK", "BAT", "BMP",
|
||||
- "CFG", "COM", "CSS",
|
||||
- "DAT", "DLL", "DOC", "DRV",
|
||||
- "EXE",
|
||||
- "FAQ", "FLT", "FON",
|
||||
- "GID", "GIF",
|
||||
- "HLP", "HTT", "HTM",
|
||||
- "ICO", "INI",
|
||||
- "JPG",
|
||||
- "LNK", "LOG",
|
||||
- "KBD",
|
||||
- "ME", "MID", "MSG",
|
||||
- "OCX", "OLD",
|
||||
- "PIF", "PNG", "PRV",
|
||||
- "RTF",
|
||||
- "SCR", "SYS",
|
||||
- "TMP", "TTF", "TXT",
|
||||
- "URL",
|
||||
- "WAV",
|
||||
- "VBX", "VOC", "VXD",
|
||||
- NULL
|
||||
-};
|
||||
-
|
||||
-static char*
|
||||
-get_extension (char* file_name)
|
||||
-{
|
||||
- char* ext;
|
||||
-
|
||||
- ext = strrchr (file_name, '.');
|
||||
- if (!ext)
|
||||
- return "";
|
||||
- if (strchr (ext, '\\'))
|
||||
- return "";
|
||||
- return ext + 1;
|
||||
-}
|
||||
-
|
||||
-static int
|
||||
-is_movable_system_file (char* file_name)
|
||||
-{
|
||||
- char* ext = get_extension (file_name);
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; movable_extensions [i]; i++) {
|
||||
- if (strcasecmp (ext, movable_extensions [i]) == 0)
|
||||
- return 1;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-#endif /* 0 */
|
||||
-
|
||||
/*
|
||||
prints out the sequence of clusters for a given file chain, beginning
|
||||
at start_cluster.
|
||||
@@ -248,29 +188,6 @@ flag_traverse_dir (FatTraverseInfo* trav_info) {
|
||||
print_chain (fs, first_cluster);
|
||||
#endif
|
||||
|
||||
-#if 0
|
||||
- if (fat_dir_entry_is_system_file (this_entry)
|
||||
- && !is_movable_system_file (file_name)) {
|
||||
- PedExceptionOption ex_status;
|
||||
- ex_status = ped_exception_throw (
|
||||
- PED_EXCEPTION_WARNING,
|
||||
- PED_EXCEPTION_IGNORE_CANCEL,
|
||||
- _("The file %s is marked as a system file. "
|
||||
- "This means moving it could cause some "
|
||||
- "programs to stop working."),
|
||||
- file_name);
|
||||
-
|
||||
- switch (ex_status) {
|
||||
- case PED_EXCEPTION_CANCEL:
|
||||
- return 0;
|
||||
-
|
||||
- case PED_EXCEPTION_UNHANDLED:
|
||||
- ped_exception_catch ();
|
||||
- case PED_EXCEPTION_IGNORE:
|
||||
- }
|
||||
- }
|
||||
-#endif /* 0 */
|
||||
-
|
||||
if (fat_dir_entry_is_directory (this_entry)) {
|
||||
if (!flag_traverse_fat (fs, file_name, first_cluster,
|
||||
FAT_FLAG_DIRECTORY, size))
|
||||
diff --git a/libparted/fs/r/fat/fat.c b/libparted/fs/r/fat/fat.c
|
||||
index ad57d36..0b2fee9 100644
|
||||
--- a/libparted/fs/r/fat/fat.c
|
||||
+++ b/libparted/fs/r/fat/fat.c
|
||||
@@ -613,68 +613,6 @@ fat_get_resize_constraint (const PedFileSystem* fs)
|
||||
return fat_get_copy_constraint (fs, fs->geom->dev);
|
||||
}
|
||||
|
||||
-/* FIXME: fat_calc_sizes() needs to say "too big" or "too small", or
|
||||
- * something. This is a really difficult (maths) problem to do
|
||||
- * nicely...
|
||||
- * So, this algorithm works if dev->length / 2 is a valid fat_type
|
||||
- * size. (Which is how I got the magic numbers below)
|
||||
- */
|
||||
-#if 0
|
||||
-/* returns: -1 too small, 0 ok, 1 too big */
|
||||
-static int
|
||||
-_test_create_size (PedSector length, FatType fat_type,
|
||||
- PedSector cluster_sectors, PedSector cluster_count)
|
||||
-{
|
||||
- PedSector rootdir_sectors;
|
||||
- PedSector _cluster_sectors;
|
||||
- FatCluster _cluster_count;
|
||||
- PedSector _fat_size;
|
||||
-
|
||||
- rootdir_sectors = (fat_type == FAT_TYPE_FAT16) ? 16 : 0;
|
||||
-
|
||||
- if (!fat_calc_sizes (length, 0, fat_type, rootdir_sectors,
|
||||
- &_cluster_sectors, &_cluster_count, &_fat_size))
|
||||
- return -1; // XXX: doesn't work... can't see a better way!
|
||||
-
|
||||
- if (_cluster_sectors < cluster_sectors)
|
||||
- return -1;
|
||||
- if (_cluster_sectors > cluster_sectors)
|
||||
- return 1;
|
||||
-
|
||||
- if (_cluster_count < cluster_count)
|
||||
- return -1;
|
||||
- if (_cluster_count > cluster_count)
|
||||
- return 1;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static PedSector
|
||||
-_get_create_size (PedSector upper_bound, FatType fat_type,
|
||||
- PedSector cluster_sectors, FatCluster cluster_count)
|
||||
-{
|
||||
- PedSector min_length = 0;
|
||||
- PedSector max_length = upper_bound;
|
||||
- PedSector length;
|
||||
-
|
||||
- while (1) {
|
||||
- length = (min_length + max_length) / 2;
|
||||
- switch (_test_create_size (length, fat_type, cluster_sectors,
|
||||
- cluster_count)) {
|
||||
- case -1: min_length = length; break;
|
||||
- case 0: return length;
|
||||
- case 1: max_length = length; break;
|
||||
- }
|
||||
- /* hack... won't always be able to get max cluster count
|
||||
- * with max cluster size, etc. */
|
||||
- if (max_length - min_length == 1)
|
||||
- return min_length;
|
||||
- }
|
||||
-
|
||||
- return 0; /* shut gcc up */
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
PedConstraint*
|
||||
fat_get_create_constraint_fat16 (const PedDevice* dev)
|
||||
{
|
||||
@@ -685,19 +623,8 @@ fat_get_create_constraint_fat16 (const PedDevice* dev)
|
||||
if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
|
||||
return NULL;
|
||||
|
||||
-#if 0
|
||||
- min_size = _get_create_size (dev->length, FAT_TYPE_FAT16,
|
||||
- fat_min_cluster_size (FAT_TYPE_FAT16),
|
||||
- fat_min_cluster_count (FAT_TYPE_FAT16));
|
||||
- max_size = _get_create_size (dev->length, FAT_TYPE_FAT16,
|
||||
- fat_max_cluster_size (FAT_TYPE_FAT16),
|
||||
- fat_max_cluster_count (FAT_TYPE_FAT16));
|
||||
- if (!min_size)
|
||||
- return NULL;
|
||||
-#else
|
||||
min_size = 65794;
|
||||
max_size = 2097153;
|
||||
-#endif
|
||||
|
||||
return ped_constraint_new (
|
||||
ped_alignment_any, ped_alignment_any,
|
||||
@@ -714,15 +641,7 @@ fat_get_create_constraint_fat32 (const PedDevice* dev)
|
||||
if (!ped_geometry_init (&full_dev, dev, 0, dev->length - 1))
|
||||
return NULL;
|
||||
|
||||
-#if 0
|
||||
- min_size = _get_create_size (dev->length, FAT_TYPE_FAT32,
|
||||
- fat_min_cluster_size (FAT_TYPE_FAT32),
|
||||
- fat_min_cluster_count (FAT_TYPE_FAT32));
|
||||
- if (!min_size)
|
||||
- return NULL;
|
||||
-#else
|
||||
min_size = 525224;
|
||||
-#endif
|
||||
|
||||
return ped_constraint_new (
|
||||
ped_alignment_any, ped_alignment_any,
|
||||
@@ -730,97 +649,3 @@ fat_get_create_constraint_fat32 (const PedDevice* dev)
|
||||
min_size, dev->length);
|
||||
}
|
||||
#endif /* !DISCOVER_ONLY */
|
||||
-
|
||||
-#if 0
|
||||
-
|
||||
-static PedFileSystemOps fat16_ops = {
|
||||
- probe: fat_probe_fat16,
|
||||
-#ifndef DISCOVER_ONLY
|
||||
- clobber: fat_clobber,
|
||||
- open: fat_open,
|
||||
- create: fat_create_fat16,
|
||||
- close: fat_close,
|
||||
- check: fat_check,
|
||||
- resize: fat_resize,
|
||||
- copy: fat_copy,
|
||||
- get_create_constraint: fat_get_create_constraint_fat16,
|
||||
- get_resize_constraint: fat_get_resize_constraint,
|
||||
- get_copy_constraint: fat_get_copy_constraint,
|
||||
-#else /* !DISCOVER_ONLY */
|
||||
- clobber: NULL,
|
||||
- open: NULL,
|
||||
- create: NULL,
|
||||
- close: NULL,
|
||||
- check: NULL,
|
||||
- resize: NULL,
|
||||
- copy: NULL,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: NULL,
|
||||
- get_copy_constraint: NULL,
|
||||
-#endif /* !DISCOVER_ONLY */
|
||||
-};
|
||||
-
|
||||
-static PedFileSystemOps fat32_ops = {
|
||||
- probe: fat_probe_fat32,
|
||||
-#ifndef DISCOVER_ONLY
|
||||
- clobber: fat_clobber,
|
||||
- open: fat_open,
|
||||
- create: fat_create_fat32,
|
||||
- close: fat_close,
|
||||
- check: fat_check,
|
||||
- resize: fat_resize,
|
||||
- copy: fat_copy,
|
||||
- get_create_constraint: fat_get_create_constraint_fat32,
|
||||
- get_resize_constraint: fat_get_resize_constraint,
|
||||
- get_copy_constraint: fat_get_copy_constraint,
|
||||
-#else /* !DISCOVER_ONLY */
|
||||
- clobber: NULL,
|
||||
- open: NULL,
|
||||
- create: NULL,
|
||||
- close: NULL,
|
||||
- check: NULL,
|
||||
- resize: NULL,
|
||||
- copy: NULL,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: NULL,
|
||||
- get_copy_constraint: NULL,
|
||||
-#endif /* !DISCOVER_ONLY */
|
||||
-};
|
||||
-
|
||||
-#define FAT_BLOCK_SIZES ((int[2]){512, 0})
|
||||
-
|
||||
-PedFileSystemType fat16_type = {
|
||||
- next: NULL,
|
||||
- ops: &fat16_ops,
|
||||
- name: "fat16",
|
||||
- block_sizes: FAT_BLOCK_SIZES
|
||||
-};
|
||||
-
|
||||
-PedFileSystemType fat32_type = {
|
||||
- next: NULL,
|
||||
- ops: &fat32_ops,
|
||||
- name: "fat32",
|
||||
- block_sizes: FAT_BLOCK_SIZES
|
||||
-};
|
||||
-
|
||||
-void
|
||||
-ped_file_system_fat_init ()
|
||||
-{
|
||||
- if (sizeof (FatBootSector) != 512) {
|
||||
- ped_exception_throw (PED_EXCEPTION_BUG, PED_EXCEPTION_CANCEL,
|
||||
- _("GNU Parted was miscompiled: the FAT boot sector "
|
||||
- "should be 512 bytes. FAT support will be disabled."));
|
||||
- } else {
|
||||
- ped_file_system_type_register (&fat16_type);
|
||||
- ped_file_system_type_register (&fat32_type);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-void
|
||||
-ped_file_system_fat_done ()
|
||||
-{
|
||||
- ped_file_system_type_unregister (&fat16_type);
|
||||
- ped_file_system_type_unregister (&fat32_type);
|
||||
-}
|
||||
-
|
||||
-#endif
|
||||
diff --git a/libparted/fs/r/fat/resize.c b/libparted/fs/r/fat/resize.c
|
||||
index 71113d4..2a0955d 100644
|
||||
--- a/libparted/fs/r/fat/resize.c
|
||||
+++ b/libparted/fs/r/fat/resize.c
|
||||
@@ -446,23 +446,6 @@ fat_construct_new_fat (FatOpContext* ctx)
|
||||
fat_table_set (new_fs_info->fat, new_cluster, new_next_cluster);
|
||||
}
|
||||
|
||||
-#if 0
|
||||
-#ifdef PED_VERBOSE
|
||||
- for (old_cluster=2; old_cluster < old_fs_info->cluster_count+2;
|
||||
- old_cluster++) {
|
||||
- if (fat_table_is_available (old_fs_info->fat, old_cluster))
|
||||
- continue;
|
||||
-
|
||||
- printf ("%d->%d\t(next: %d->%d)\n",
|
||||
- old_cluster,
|
||||
- ctx->remap [old_cluster],
|
||||
- fat_table_get (old_fs_info->fat, old_cluster),
|
||||
- fat_table_get (new_fs_info->fat,
|
||||
- ctx->remap [old_cluster]));
|
||||
- }
|
||||
-#endif /* PED_VERBOSE */
|
||||
-#endif
|
||||
-
|
||||
if (old_fs_info->fat_type == FAT_TYPE_FAT32
|
||||
&& new_fs_info->fat_type == FAT_TYPE_FAT32) {
|
||||
new_fs_info->root_cluster
|
||||
--
|
||||
2.26.2
|
||||
|
228
0040-fs-r-hfs-Remove-disabled-code.patch
Normal file
228
0040-fs-r-hfs-Remove-disabled-code.patch
Normal file
@ -0,0 +1,228 @@
|
||||
From 0d5f047b2855f3d39fa3afe6ec2a6129d18ddf33 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 20 Nov 2020 13:22:52 -0800
|
||||
Subject: [PATCH 40/42] fs/r/hfs: Remove disabled code
|
||||
|
||||
---
|
||||
libparted/fs/r/hfs/hfs.c | 194 ---------------------------------------
|
||||
1 file changed, 194 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/hfs/hfs.c b/libparted/fs/r/hfs/hfs.c
|
||||
index 09899da..1da093c 100644
|
||||
--- a/libparted/fs/r/hfs/hfs.c
|
||||
+++ b/libparted/fs/r/hfs/hfs.c
|
||||
@@ -59,28 +59,6 @@ static PedFileSystemType hfsplus_type;
|
||||
|
||||
/* ----- HFS ----- */
|
||||
|
||||
-#if 0
|
||||
-/* This is a very unundoable operation */
|
||||
-/* Maybe I shouldn't touch the alternate MDB ? */
|
||||
-/* Anyway clobber is call before other fs creation */
|
||||
-/* So this is a non-issue */
|
||||
-static int
|
||||
-hfs_clobber (PedGeometry* geom)
|
||||
-{
|
||||
- uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
|
||||
-
|
||||
- memset (buf, 0, PED_SECTOR_SIZE_DEFAULT);
|
||||
-
|
||||
- /* destroy boot blocks, mdb, alternate mdb ... */
|
||||
- return (!!ped_geometry_write (geom, buf, 0, 1)) &
|
||||
- (!!ped_geometry_write (geom, buf, 1, 1)) &
|
||||
- (!!ped_geometry_write (geom, buf, 2, 1)) &
|
||||
- (!!ped_geometry_write (geom, buf, geom->length - 2, 1)) &
|
||||
- (!!ped_geometry_write (geom, buf, geom->length - 1, 1)) &
|
||||
- (!!ped_geometry_sync (geom));
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
PedFileSystem *
|
||||
hfs_open (PedGeometry* geom)
|
||||
{
|
||||
@@ -341,44 +319,6 @@ hfs_resize (PedFileSystem* fs, PedGeometry* geom, PedTimer* timer)
|
||||
#include "reloc_plus.h"
|
||||
#include "journal.h"
|
||||
|
||||
-#if 0
|
||||
-static int
|
||||
-hfsplus_clobber (PedGeometry* geom)
|
||||
-{
|
||||
- unsigned int i = 1;
|
||||
- uint8_t buf[PED_SECTOR_SIZE_DEFAULT];
|
||||
- HfsMasterDirectoryBlock *mdb;
|
||||
-
|
||||
- mdb = (HfsMasterDirectoryBlock *) buf;
|
||||
-
|
||||
- if (!ped_geometry_read (geom, buf, 2, 1))
|
||||
- return 0;
|
||||
-
|
||||
- if (PED_BE16_TO_CPU (mdb->signature) == HFS_SIGNATURE) {
|
||||
- /* embedded hfs+ */
|
||||
- PedGeometry *embedded;
|
||||
-
|
||||
- i = PED_BE32_TO_CPU(mdb->block_size) / PED_SECTOR_SIZE_DEFAULT;
|
||||
- embedded = ped_geometry_new (
|
||||
- geom->dev,
|
||||
- (PedSector) geom->start
|
||||
- + PED_BE16_TO_CPU (mdb->start_block)
|
||||
- + (PedSector) PED_BE16_TO_CPU (
|
||||
- mdb->old_new.embedded.location.start_block ) * i,
|
||||
- (PedSector) PED_BE16_TO_CPU (
|
||||
- mdb->old_new.embedded.location.block_count ) * i );
|
||||
- if (!embedded) i = 0;
|
||||
- else {
|
||||
- i = hfs_clobber (embedded);
|
||||
- ped_geometry_destroy (embedded);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* non-embedded or envelop destroy as hfs */
|
||||
- return ( hfs_clobber (geom) && i );
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
int
|
||||
hfsplus_close (PedFileSystem *fs)
|
||||
{
|
||||
@@ -1224,137 +1164,3 @@ hfsplus_extract (PedFileSystem* fs, PedTimer* timer)
|
||||
#endif /* HFS_EXTRACT_FS */
|
||||
|
||||
#endif /* !DISCOVER_ONLY */
|
||||
-
|
||||
-#if 0
|
||||
-static PedFileSystemOps hfs_ops = {
|
||||
- probe: hfs_probe,
|
||||
-#ifndef DISCOVER_ONLY
|
||||
- clobber: hfs_clobber,
|
||||
- open: hfs_open,
|
||||
- create: NULL,
|
||||
- close: hfs_close,
|
||||
-#ifndef HFS_EXTRACT_FS
|
||||
- check: NULL,
|
||||
-#else
|
||||
- check: hfs_extract,
|
||||
-#endif
|
||||
- copy: NULL,
|
||||
- resize: hfs_resize,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: hfs_get_resize_constraint,
|
||||
- get_copy_constraint: NULL,
|
||||
-#else /* DISCOVER_ONLY */
|
||||
- clobber: NULL,
|
||||
- open: NULL,
|
||||
- create: NULL,
|
||||
- close: NULL,
|
||||
- check: NULL,
|
||||
- copy: NULL,
|
||||
- resize: NULL,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: NULL,
|
||||
- get_copy_constraint: NULL,
|
||||
-#endif /* DISCOVER_ONLY */
|
||||
-};
|
||||
-
|
||||
-static PedFileSystemOps hfsplus_ops = {
|
||||
- probe: hfsplus_probe,
|
||||
-#ifndef DISCOVER_ONLY
|
||||
- clobber: hfsplus_clobber,
|
||||
- open: hfsplus_open,
|
||||
- create: NULL,
|
||||
- close: hfsplus_close,
|
||||
-#ifndef HFS_EXTRACT_FS
|
||||
- check: NULL,
|
||||
-#else
|
||||
- check: hfsplus_extract,
|
||||
-#endif
|
||||
- copy: NULL,
|
||||
- resize: hfsplus_resize,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: hfsplus_get_resize_constraint,
|
||||
- get_copy_constraint: NULL,
|
||||
-#else /* DISCOVER_ONLY */
|
||||
- clobber: NULL,
|
||||
- open: NULL,
|
||||
- create: NULL,
|
||||
- close: NULL,
|
||||
- check: NULL,
|
||||
- copy: NULL,
|
||||
- resize: NULL,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: NULL,
|
||||
- get_copy_constraint: NULL,
|
||||
-#endif /* DISCOVER_ONLY */
|
||||
-};
|
||||
-
|
||||
-static PedFileSystemOps hfsx_ops = {
|
||||
- probe: hfsx_probe,
|
||||
-#ifndef DISCOVER_ONLY
|
||||
- clobber: hfs_clobber, /* NOT hfsplus_clobber !
|
||||
- HFSX can't be embedded */
|
||||
- open: hfsplus_open,
|
||||
- create: NULL,
|
||||
- close: hfsplus_close,
|
||||
-#ifndef HFS_EXTRACT_FS
|
||||
- check: NULL,
|
||||
-#else
|
||||
- check: hfsplus_extract,
|
||||
-#endif
|
||||
- copy: NULL,
|
||||
- resize: hfsplus_resize,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: hfsplus_get_resize_constraint,
|
||||
- get_copy_constraint: NULL,
|
||||
-#else /* DISCOVER_ONLY */
|
||||
- clobber: NULL,
|
||||
- open: NULL,
|
||||
- create: NULL,
|
||||
- close: NULL,
|
||||
- check: NULL,
|
||||
- copy: NULL,
|
||||
- resize: NULL,
|
||||
- get_create_constraint: NULL,
|
||||
- get_resize_constraint: NULL,
|
||||
- get_copy_constraint: NULL,
|
||||
-#endif /* DISCOVER_ONLY */
|
||||
-};
|
||||
-
|
||||
-
|
||||
-static PedFileSystemType hfs_type = {
|
||||
- next: NULL,
|
||||
- ops: &hfs_ops,
|
||||
- name: "hfs",
|
||||
- block_sizes: HFS_BLOCK_SIZES
|
||||
-};
|
||||
-
|
||||
-static PedFileSystemType hfsplus_type = {
|
||||
- next: NULL,
|
||||
- ops: &hfsplus_ops,
|
||||
- name: "hfs+",
|
||||
- block_sizes: HFSP_BLOCK_SIZES
|
||||
-};
|
||||
-
|
||||
-static PedFileSystemType hfsx_type = {
|
||||
- next: NULL,
|
||||
- ops: &hfsx_ops,
|
||||
- name: "hfsx",
|
||||
- block_sizes: HFSX_BLOCK_SIZES
|
||||
-};
|
||||
-
|
||||
-void
|
||||
-ped_file_system_hfs_init ()
|
||||
-{
|
||||
- ped_file_system_type_register (&hfs_type);
|
||||
- ped_file_system_type_register (&hfsplus_type);
|
||||
- ped_file_system_type_register (&hfsx_type);
|
||||
-}
|
||||
-
|
||||
-void
|
||||
-ped_file_system_hfs_done ()
|
||||
-{
|
||||
- ped_file_system_type_unregister (&hfs_type);
|
||||
- ped_file_system_type_unregister (&hfsplus_type);
|
||||
- ped_file_system_type_unregister (&hfsx_type);
|
||||
-}
|
||||
-#endif
|
||||
--
|
||||
2.26.2
|
||||
|
108
0041-libparted-Remove-disabled-code.patch
Normal file
108
0041-libparted-Remove-disabled-code.patch
Normal file
@ -0,0 +1,108 @@
|
||||
From 945b13aed7e9762e00bda1b54e2c18eb3373a31d Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 20 Nov 2020 13:26:31 -0800
|
||||
Subject: [PATCH 41/42] libparted: Remove disabled code
|
||||
|
||||
---
|
||||
libparted/arch/gnu.c | 40 ----------------------------------------
|
||||
libparted/labels/mac.c | 14 --------------
|
||||
libparted/labels/pc98.c | 5 -----
|
||||
3 files changed, 59 deletions(-)
|
||||
|
||||
diff --git a/libparted/arch/gnu.c b/libparted/arch/gnu.c
|
||||
index 321b70a..922b93d 100644
|
||||
--- a/libparted/arch/gnu.c
|
||||
+++ b/libparted/arch/gnu.c
|
||||
@@ -359,46 +359,6 @@ gnu_close (PedDevice* dev)
|
||||
dev->dirty = 0;
|
||||
}
|
||||
|
||||
-#if 0
|
||||
- if (dev->dirty && dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
|
||||
- /* ouch! */
|
||||
- ped_exception_throw (
|
||||
- PED_EXCEPTION_WARNING,
|
||||
- PED_EXCEPTION_OK,
|
||||
- _("The partition table cannot be re-read. This means "
|
||||
- "you need to reboot before mounting any "
|
||||
- "modified partitions. You also need to reinstall "
|
||||
- "your boot loader before you reboot (which may "
|
||||
- "require mounting modified partitions). It is "
|
||||
- "impossible do both things! So you'll need to "
|
||||
- "boot off a rescue disk, and reinstall your boot "
|
||||
- "loader from the rescue disk. Read section 4 of "
|
||||
- "the Parted User documentation for more "
|
||||
- "information."));
|
||||
- return 1;
|
||||
- }
|
||||
-
|
||||
- if (dev->dirty && dev->type != PED_DEVICE_FILE) {
|
||||
- ped_exception_throw (
|
||||
- PED_EXCEPTION_WARNING,
|
||||
- PED_EXCEPTION_IGNORE,
|
||||
- _("The partition table on %s cannot be re-read "
|
||||
- "(%s). This means the Hurd knows nothing about any "
|
||||
- "modifications you made. You should reboot your "
|
||||
- "computer before doing anything with %s."),
|
||||
- dev->path, strerror (errno), dev->path);
|
||||
- }
|
||||
-
|
||||
- if (dev->boot_dirty && dev->type != PED_DEVICE_FILE) {
|
||||
- ped_exception_throw (
|
||||
- PED_EXCEPTION_WARNING,
|
||||
- PED_EXCEPTION_OK,
|
||||
- _("You should reinstall your boot loader before "
|
||||
- "rebooting. Read section 4 of the Parted User "
|
||||
- "documentation for more information."));
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff --git a/libparted/labels/mac.c b/libparted/labels/mac.c
|
||||
index 8980885..af9f4c3 100644
|
||||
--- a/libparted/labels/mac.c
|
||||
+++ b/libparted/labels/mac.c
|
||||
@@ -560,20 +560,6 @@ _rawpart_analyse (MacRawPartition* raw_part, PedDisk* disk, int num)
|
||||
mac_part_data->data_region_length
|
||||
= PED_BE32_TO_CPU (raw_part->data_count);
|
||||
|
||||
- /* boot region - we have no idea what this is for, but Mac OSX
|
||||
- * seems to put garbage here, and doesn't pay any attention to
|
||||
- * it afterwards. [clausen, dan burcaw]
|
||||
- */
|
||||
-#if 0
|
||||
- if (raw_part->boot_start) {
|
||||
- ped_exception_throw (
|
||||
- PED_EXCEPTION_ERROR,
|
||||
- PED_EXCEPTION_CANCEL,
|
||||
- _("The boot region doesn't start at the start "
|
||||
- "of the partition."));
|
||||
- goto error_destroy_part;
|
||||
- }
|
||||
-#endif
|
||||
mac_part_data->boot_region_length
|
||||
= PED_BE32_TO_CPU (raw_part->boot_count);
|
||||
|
||||
diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c
|
||||
index 328cd8d..b8993c4 100644
|
||||
--- a/libparted/labels/pc98.c
|
||||
+++ b/libparted/labels/pc98.c
|
||||
@@ -418,13 +418,8 @@ fill_raw_part (PC98RawPartition* raw_part, const PedPartition* part)
|
||||
return 0;
|
||||
}
|
||||
raw_part->end_cyl = PED_CPU_TO_LE16(c);
|
||||
-#if 0
|
||||
- raw_part->end_head = h;
|
||||
- raw_part->end_sector = s;
|
||||
-#else
|
||||
raw_part->end_head = 0;
|
||||
raw_part->end_sector = 0;
|
||||
-#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
112
0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch
Normal file
112
0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch
Normal file
@ -0,0 +1,112 @@
|
||||
From 8df7974ac36fcea82551c3f6990f981b659e2635 Mon Sep 17 00:00:00 2001
|
||||
From: "Brian C. Lane" <bcl@redhat.com>
|
||||
Date: Fri, 20 Nov 2020 14:08:33 -0800
|
||||
Subject: [PATCH 42/42] libparted/fs: Fix GCC warnings suggesting pure for
|
||||
PED_ASSERT functions
|
||||
|
||||
There was some question about whether or not pure should be used for
|
||||
functions with PED_ASSERT (or exit) in them. It should be fine, since
|
||||
the values checked by the ASSERT are passed to the function directly.
|
||||
Behavior should be exactly the same for the same inputs.
|
||||
---
|
||||
libparted/fs/r/fat/calc.c | 12 ++++++------
|
||||
libparted/fs/r/fat/clstdup.c | 4 ++--
|
||||
libparted/fs/r/hfs/cache.c | 2 +-
|
||||
3 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/libparted/fs/r/fat/calc.c b/libparted/fs/r/fat/calc.c
|
||||
index 18e0455..26c4d18 100644
|
||||
--- a/libparted/fs/r/fat/calc.c
|
||||
+++ b/libparted/fs/r/fat/calc.c
|
||||
@@ -369,7 +369,7 @@ fat_is_sector_in_clusters (const PedFileSystem* fs, PedSector sector)
|
||||
+ fs_info->cluster_sectors * fs_info->cluster_count;
|
||||
}
|
||||
|
||||
-FatFragment
|
||||
+FatFragment _GL_ATTRIBUTE_PURE
|
||||
fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -379,7 +379,7 @@ fat_cluster_to_frag (const PedFileSystem* fs, FatCluster cluster)
|
||||
return (cluster - 2) * fs_info->cluster_frags;
|
||||
}
|
||||
|
||||
-FatCluster
|
||||
+FatCluster _GL_ATTRIBUTE_PURE
|
||||
fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -389,7 +389,7 @@ fat_frag_to_cluster (const PedFileSystem* fs, FatFragment frag)
|
||||
return frag / fs_info->cluster_frags + 2;
|
||||
}
|
||||
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_PURE
|
||||
fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -399,7 +399,7 @@ fat_frag_to_sector (const PedFileSystem* fs, FatFragment frag)
|
||||
return frag * fs_info->frag_sectors + fs_info->cluster_offset;
|
||||
}
|
||||
|
||||
-FatFragment
|
||||
+FatFragment _GL_ATTRIBUTE_PURE
|
||||
fat_sector_to_frag (const PedFileSystem* fs, PedSector sector)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -409,7 +409,7 @@ fat_sector_to_frag (const PedFileSystem* fs, PedSector sector)
|
||||
return (sector - fs_info->cluster_offset) / fs_info->frag_sectors;
|
||||
}
|
||||
|
||||
-PedSector
|
||||
+PedSector _GL_ATTRIBUTE_PURE
|
||||
fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
@@ -420,7 +420,7 @@ fat_cluster_to_sector (const PedFileSystem* fs, FatCluster cluster)
|
||||
+ fs_info->cluster_offset;
|
||||
}
|
||||
|
||||
-FatCluster
|
||||
+FatCluster _GL_ATTRIBUTE_PURE
|
||||
fat_sector_to_cluster (const PedFileSystem* fs, PedSector sector)
|
||||
{
|
||||
FatSpecific* fs_info = FAT_SPECIFIC (fs);
|
||||
diff --git a/libparted/fs/r/fat/clstdup.c b/libparted/fs/r/fat/clstdup.c
|
||||
index 7456f60..cfd1552 100644
|
||||
--- a/libparted/fs/r/fat/clstdup.c
|
||||
+++ b/libparted/fs/r/fat/clstdup.c
|
||||
@@ -126,7 +126,7 @@ fetch_fragments (FatOpContext* ctx)
|
||||
|
||||
/* finds the first fragment that is not going to get overwritten (that needs to
|
||||
get read in) */
|
||||
-static FatFragment
|
||||
+static FatFragment _GL_ATTRIBUTE_PURE
|
||||
get_first_underlay (const FatOpContext* ctx, int first, int last)
|
||||
{
|
||||
int old;
|
||||
@@ -147,7 +147,7 @@ get_first_underlay (const FatOpContext* ctx, int first, int last)
|
||||
|
||||
/* finds the last fragment that is not going to get overwritten (that needs to
|
||||
get read in) */
|
||||
-static FatFragment
|
||||
+static FatFragment _GL_ATTRIBUTE_PURE
|
||||
get_last_underlay (const FatOpContext* ctx, int first, int last)
|
||||
{
|
||||
int old;
|
||||
diff --git a/libparted/fs/r/hfs/cache.c b/libparted/fs/r/hfs/cache.c
|
||||
index 5e5b071..fc11fe9 100644
|
||||
--- a/libparted/fs/r/hfs/cache.c
|
||||
+++ b/libparted/fs/r/hfs/cache.c
|
||||
@@ -173,7 +173,7 @@ hfsc_cache_add_extent(HfsCPrivateCache* cache, uint32_t start, uint32_t length,
|
||||
return ext;
|
||||
}
|
||||
|
||||
-HfsCPrivateExtent*
|
||||
+HfsCPrivateExtent* _GL_ATTRIBUTE_PURE
|
||||
hfsc_cache_search_extent(HfsCPrivateCache* cache, uint32_t start)
|
||||
{
|
||||
HfsCPrivateExtent* ret;
|
||||
--
|
||||
2.26.2
|
||||
|
34
parted.spec
34
parted.spec
@ -4,7 +4,7 @@
|
||||
Summary: The GNU disk partition manipulation program
|
||||
Name: parted
|
||||
Version: 3.3
|
||||
Release: 7%{?dist}
|
||||
Release: 8%{?dist}
|
||||
License: GPLv3+
|
||||
URL: http://www.gnu.org/software/parted
|
||||
|
||||
@ -26,6 +26,35 @@ Patch0009: 0010-tests-Add-f2fs-to-the-fs-probe-test.patch
|
||||
Patch0010: 0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch
|
||||
Patch0011: 0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch
|
||||
Patch0012: 0013-Do-not-link-to-libsepol-or-libselinux.patch
|
||||
Patch0013: 0014-t6001-psep-modify-device-manage-support-detection.patch
|
||||
Patch0014: 0015-tests-Update-all-the-dmsetup-tests-to-use-ENABLE_DEV.patch
|
||||
Patch0015: 0016-libparted-Fix-a-GCC-warning-Wunused-but-set-variable.patch
|
||||
Patch0016: 0017-libparted-Fix-warnings-from-GCC-8-Wunused-variable-a.patch
|
||||
Patch0017: 0018-libparted-Fix-warnings-from-GCC-s-Wimplicit-fallthro.patch
|
||||
Patch0018: 0019-libparted-Avoid-a-GCC-warning-for-unused-functions.patch
|
||||
Patch0019: 0020-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
|
||||
Patch0020: 0021-libparted-Fix-warnings-from-GCC-8-Wsuggest-attribute.patch
|
||||
Patch0021: 0022-bsd-Fix-gcc-complaints-when-using-boot_code-pointer.patch
|
||||
Patch0022: 0023-dos-Fix-gcc-complaints-when-using-boot_code-pointer.patch
|
||||
Patch0023: 0024-linux-Fix-gcc-complains-about-signed-sccanf-variable.patch
|
||||
Patch0024: 0025-tests-Fix-unsigned-warning-in-duplicate.c.patch
|
||||
Patch0025: 0026-hfs-Fix-gcc-10-bounds-check-warning.patch
|
||||
Patch0026: 0027-hfs-advfs-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0027: 0028-hfs-advfs_plus-Fix-gcc-10-warnings-about-cast-alignm.patch
|
||||
Patch0028: 0029-hfs-hfs-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0029: 0030-ext2-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0030: 0031-nilfs2-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0031: 0032-ntfs-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0032: 0033-ufs-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0033: 0034-ped_assert-Fix-incorrect-exception-option.patch
|
||||
Patch0034: 0035-ui-Fix-command_line_get_disk_flag.patch
|
||||
Patch0035: 0036-ui-Fix-gcc-10-warning-about-snprintf-truncating-an-i.patch
|
||||
Patch0036: 0037-hfs-reloc-Fix-gcc-10-warnings-about-cast-alignment.patch
|
||||
Patch0037: 0038-hfs-reloc_plus-Fix-gcc-10-warnings-about-cast-alignm.patch
|
||||
Patch0038: 0039-fs-r-fat-Remove-disabled-code.patch
|
||||
Patch0039: 0040-fs-r-hfs-Remove-disabled-code.patch
|
||||
Patch0040: 0041-libparted-Remove-disabled-code.patch
|
||||
Patch0041: 0042-libparted-fs-Fix-GCC-warnings-suggesting-pure-for-PE.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: e2fsprogs-devel
|
||||
@ -129,6 +158,9 @@ make check
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Nov 30 2020 Brian C. Lane <bcl@redhat.com> - 3.3-8
|
||||
- Add upstream commits to fix various gcc 10 warnings (bcl)
|
||||
|
||||
* Thu Nov 05 2020 Brian C. Lane <bcl@redhat.com> - 3.3-7
|
||||
- Do not link to libselinux
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user