blob: b214f0b05d24e8caed59bfd460d6ba0727230fa8 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 9b4a7a4d0653b627d747e00d6b3ada2990caa1d3 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 9 Aug 2017 13:57:57 +0800
4Subject: [PATCH] fix a clang compiling issue
5
6[snip]
7../../../git/src/plugins/fs.c:2617:26: error: missing field 'start'
8initializer [-Werror,-Wmissing-field-initializers]
9 PedGeometry geom = {0};
10 ^
11../../../git/src/plugins/fs.c:2618:30: error: missing field 'start'
12initializer [-Werror,-Wmissing-field-initializers]
13 PedGeometry new_geom = {0};
14[snip]
15
16Fix typo s/enum libvk_packet_format format/enum libvk_secret secret_type/
17
18Upstream-Status: Submitted [https://github.com/storaged-project/libblockdev/pull/266]
19
20Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
21---
Brad Bishop316dfdd2018-06-25 12:45:53 -040022 src/plugins/crypto.c | 6 +++---
23 src/plugins/fs/vfat.c | 4 ++--
24 src/plugins/part.c | 4 ++--
25 src/utils/exec.c | 2 +-
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026 4 files changed, 8 insertions(+), 8 deletions(-)
27
28diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040029index 563093e..b961471 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030--- a/src/plugins/crypto.c
31+++ b/src/plugins/crypto.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040032@@ -970,7 +970,7 @@ gboolean bd_crypto_tc_open (const gchar *device, const gchar *name, const guint8
Brad Bishopd7bf8c12018-02-25 22:55:05 -050033 gint ret = 0;
34 guint64 progress_id = 0;
35 gchar *msg = NULL;
36- struct crypt_params_tcrypt params = {0};
37+ struct crypt_params_tcrypt params = {NULL,0,NULL,0,NULL,NULL,NULL,0,0};
38
39 msg = g_strdup_printf ("Started opening '%s' TrueCrypt/VeraCrypt device", device);
40 progress_id = bd_utils_report_started (msg);
Brad Bishop316dfdd2018-06-25 12:45:53 -040041@@ -1090,7 +1090,7 @@ static gchar *replace_char (gchar *str, gchar orig, gchar new) {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042 return str;
43 }
44
45-static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_packet_format format, const gchar *out_path,
46+static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_secret secret_type, const gchar *out_path,
47 CERTCertificate *cert, GError **error) {
48 gpointer packet_data = NULL;
49 gsize packet_data_size = 0;
Brad Bishop316dfdd2018-06-25 12:45:53 -040050@@ -1099,7 +1099,7 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
Brad Bishopd7bf8c12018-02-25 22:55:05 -050051 gsize bytes_written = 0;
52 GError *tmp_error = NULL;
53
54- packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, format, cert,
55+ packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
56 ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
57
58 if (!packet_data) {
Brad Bishop316dfdd2018-06-25 12:45:53 -040059diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c
60index 3ed7d4a..5ff7795 100644
61--- a/src/plugins/fs/vfat.c
62+++ b/src/plugins/fs/vfat.c
63@@ -376,8 +376,8 @@ BDFSVfatInfo* bd_fs_vfat_get_info (const gchar *device, GError **error) {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050064 */
65 gboolean bd_fs_vfat_resize (const gchar *device, guint64 new_size, GError **error) {
66 PedDevice *ped_dev = NULL;
67- PedGeometry geom = {0};
68- PedGeometry new_geom = {0};
69+ PedGeometry geom = {NULL, 0, 0, 0};
70+ PedGeometry new_geom = {NULL, 0, 0, 0};
71 PedFileSystem *fs = NULL;
72 PedSector start = 0;
73 PedSector length = 0;
74diff --git a/src/plugins/part.c b/src/plugins/part.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040075index fed8300..6b2a690 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050076--- a/src/plugins/part.c
77+++ b/src/plugins/part.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040078@@ -926,7 +926,7 @@ static PedPartition* add_part_to_disk (PedDevice *dev, PedDisk *disk, BDPartType
Brad Bishopd7bf8c12018-02-25 22:55:05 -050079 return NULL;
80 }
81
82- part = ped_partition_new (disk, type, NULL, geom->start, geom->end);
83+ part = ped_partition_new (disk, (PedPartitionType)type, NULL, geom->start, geom->end);
84 if (!part) {
85 set_parted_error (error, BD_PART_ERROR_FAIL);
86 g_prefix_error (error, "Failed to create new partition on device '%s'", dev->path);
Brad Bishop316dfdd2018-06-25 12:45:53 -040087@@ -1564,7 +1564,7 @@ gboolean bd_part_set_part_flags (const gchar *disk, const gchar *part, guint64 f
Brad Bishopd7bf8c12018-02-25 22:55:05 -050088 PedPartition *ped_part = NULL;
89 const gchar *part_num_str = NULL;
90 gint part_num = 0;
91- guint64 i = 0;
92+ int i = 0;
93 gint status = 0;
94 gboolean ret = FALSE;
95 guint64 progress_id = 0;
96diff --git a/src/utils/exec.c b/src/utils/exec.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040097index 11c1489..dcf87e5 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050098--- a/src/utils/exec.c
99+++ b/src/utils/exec.c
100@@ -354,7 +354,7 @@ gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg
101 GIOStatus io_status = G_IO_STATUS_NORMAL;
102 guint i = 0;
103 guint8 completion = 0;
104- GPollFD fds[2] = {{0}, {0}};
105+ GPollFD fds[2] = {{0,0,0}, {0,0,0}};
106 gboolean out_done = FALSE;
107 gboolean err_done = FALSE;
108 GString *stdout_data = g_string_new (NULL);
109--
Brad Bishop316dfdd2018-06-25 12:45:53 -04001102.14.3
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500111