aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/libblockdev/files/0005-fix-a-clang-compiling-issue.patch
blob: 38189360871a0dd727f7b078ee4b0df8b2a51d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From 9b4a7a4d0653b627d747e00d6b3ada2990caa1d3 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 9 Aug 2017 13:57:57 +0800
Subject: [PATCH] fix a clang compiling issue

[snip]
../../../git/src/plugins/fs.c:2617:26: error: missing field 'start'
initializer [-Werror,-Wmissing-field-initializers]
    PedGeometry geom = {0};
                         ^
../../../git/src/plugins/fs.c:2618:30: error: missing field 'start'
initializer [-Werror,-Wmissing-field-initializers]
    PedGeometry new_geom = {0};
[snip]

Fix typo s/enum libvk_packet_format format/enum libvk_secret secret_type/

Upstream-Status: Submitted [https://github.com/storaged-project/libblockdev/pull/266]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 src/plugins/crypto.c | 6 +++---
 src/plugins/fs.c     | 4 ++--
 src/plugins/part.c   | 4 ++--
 src/utils/exec.c     | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
index 8fbce4f..7ee7cdc 100644
--- a/src/plugins/crypto.c
+++ b/src/plugins/crypto.c
@@ -881,7 +881,7 @@ gboolean bd_crypto_tc_open (const gchar *device, const gchar *name, const guint8
     gint ret = 0;
     guint64 progress_id = 0;
     gchar *msg = NULL;
-    struct crypt_params_tcrypt params = {0};
+    struct crypt_params_tcrypt params = {NULL,0,NULL,0,NULL,NULL,NULL,0,0};
 
     msg = g_strdup_printf ("Started opening '%s' TrueCrypt/VeraCrypt device", device);
     progress_id = bd_utils_report_started (msg);
@@ -999,7 +999,7 @@ static gchar *replace_char (gchar *str, gchar orig, gchar new) {
     return str;
 }
 
-static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_packet_format format, const gchar *out_path,
+static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libvk_ui *ui, enum libvk_secret secret_type, const gchar *out_path,
                                         CERTCertificate *cert, GError **error) {
     gpointer packet_data = NULL;
     gsize packet_data_size = 0;
@@ -1008,7 +1008,7 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
     gsize bytes_written = 0;
     GError *tmp_error = NULL;
 
-    packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, format, cert,
+    packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
                                                                      ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
 
     if (!packet_data) {
diff --git a/src/plugins/fs.c b/src/plugins/fs.c
index c4b6ac8..647096d 100644
--- a/src/plugins/fs.c
+++ b/src/plugins/fs.c
@@ -2614,8 +2614,8 @@ BDFSVfatInfo* bd_fs_vfat_get_info (const gchar *device, GError **error) {
  */
 gboolean bd_fs_vfat_resize (const gchar *device, guint64 new_size, GError **error) {
     PedDevice *ped_dev = NULL;
-    PedGeometry geom = {0};
-    PedGeometry new_geom = {0};
+    PedGeometry geom = {NULL, 0, 0, 0};
+    PedGeometry new_geom = {NULL, 0, 0, 0};
     PedFileSystem *fs = NULL;
     PedSector start = 0;
     PedSector length = 0;
diff --git a/src/plugins/part.c b/src/plugins/part.c
index 12d2ef7..d277688 100644
--- a/src/plugins/part.c
+++ b/src/plugins/part.c
@@ -849,7 +849,7 @@ static PedPartition* add_part_to_disk (PedDevice *dev, PedDisk *disk, BDPartType
         return NULL;
     }
 
-    part = ped_partition_new (disk, type, NULL, geom->start, geom->end);
+    part = ped_partition_new (disk, (PedPartitionType)type, NULL, geom->start, geom->end);
     if (!part) {
         set_parted_error (error, BD_PART_ERROR_FAIL);
         g_prefix_error (error, "Failed to create new partition on device '%s'", dev->path);
@@ -1427,7 +1427,7 @@ gboolean bd_part_set_part_flags (const gchar *disk, const gchar *part, guint64 f
     PedPartition *ped_part = NULL;
     const gchar *part_num_str = NULL;
     gint part_num = 0;
-    guint64 i = 0;
+    int i = 0;
     gint status = 0;
     gboolean ret = FALSE;
     guint64 progress_id = 0;
diff --git a/src/utils/exec.c b/src/utils/exec.c
index 7ac44fd..0a3094c 100644
--- a/src/utils/exec.c
+++ b/src/utils/exec.c
@@ -354,7 +354,7 @@ gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg
     GIOStatus io_status = G_IO_STATUS_NORMAL;
     guint i = 0;
     guint8 completion = 0;
-    GPollFD fds[2] = {{0}, {0}};
+    GPollFD fds[2] = {{0,0,0}, {0,0,0}};
     gboolean out_done = FALSE;
     gboolean err_done = FALSE;
     GString *stdout_data = g_string_new (NULL);
-- 
1.8.3.1