hla: improve readability of struct hl_interface_s initialization

The initialization is barely readable, while actually only few
fields are set with value nor zero nor NULL.

Rewrite the initialization using C99 struct designations.

Change-Id: I4d288e6536ebe7110a184db6540223fc67361ec3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6636
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo 2019-09-16 10:50:04 +02:00
parent 0fb131c23a
commit 69190094ad
1 changed files with 15 additions and 1 deletions

View File

@ -35,7 +35,21 @@
#include <target/target.h>
static struct hl_interface_s hl_if = { {0, 0, { 0 }, { 0 }, HL_TRANSPORT_UNKNOWN, false, -1, false, 7184}, 0, 0 };
static struct hl_interface_s hl_if = {
.param = {
.device_desc = NULL,
.serial = NULL,
.vid = { 0 },
.pid = { 0 },
.transport = HL_TRANSPORT_UNKNOWN,
.connect_under_reset = false,
.initial_interface_speed = -1,
.use_stlink_tcp = false,
.stlink_tcp_port = 7184,
},
.layout = NULL,
.handle = NULL,
};
int hl_interface_open(enum hl_transports tr)
{