Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 9b4a7a4d0653b627d747e00d6b3ada2990caa1d3 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Wed, 9 Aug 2017 13:57:57 +0800 |
| 4 | Subject: [PATCH] fix a clang compiling issue |
| 5 | |
| 6 | [snip] |
| 7 | ../../../git/src/plugins/fs.c:2617:26: error: missing field 'start' |
| 8 | initializer [-Werror,-Wmissing-field-initializers] |
| 9 | PedGeometry geom = {0}; |
| 10 | ^ |
| 11 | ../../../git/src/plugins/fs.c:2618:30: error: missing field 'start' |
| 12 | initializer [-Werror,-Wmissing-field-initializers] |
| 13 | PedGeometry new_geom = {0}; |
| 14 | [snip] |
| 15 | |
| 16 | Fix typo s/enum libvk_packet_format format/enum libvk_secret secret_type/ |
| 17 | |
| 18 | Upstream-Status: Submitted [https://github.com/storaged-project/libblockdev/pull/266] |
| 19 | |
| 20 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 21 | --- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 22 | 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 26 | 4 files changed, 8 insertions(+), 8 deletions(-) |
| 27 | |
| 28 | diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 29 | index 563093e..b961471 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | --- a/src/plugins/crypto.c |
| 31 | +++ b/src/plugins/crypto.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 32 | @@ -970,7 +970,7 @@ gboolean bd_crypto_tc_open (const gchar *device, const gchar *name, const guint8 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 33 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 41 | @@ -1090,7 +1090,7 @@ static gchar *replace_char (gchar *str, gchar orig, gchar new) { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 50 | @@ -1099,7 +1099,7 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 59 | diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c |
| 60 | index 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 64 | */ |
| 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; |
| 74 | diff --git a/src/plugins/part.c b/src/plugins/part.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 75 | index fed8300..6b2a690 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 76 | --- a/src/plugins/part.c |
| 77 | +++ b/src/plugins/part.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 78 | @@ -926,7 +926,7 @@ static PedPartition* add_part_to_disk (PedDevice *dev, PedDisk *disk, BDPartType |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 79 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 87 | @@ -1564,7 +1564,7 @@ gboolean bd_part_set_part_flags (const gchar *disk, const gchar *part, guint64 f |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 88 | 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; |
| 96 | diff --git a/src/utils/exec.c b/src/utils/exec.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 97 | index 11c1489..dcf87e5 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 98 | --- 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 110 | 2.14.3 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 111 | |