summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Warning <moritzwarning@web.de>2020-11-10 09:45:52 +0100
committerGitHub <noreply@github.com>2020-11-10 17:45:52 +0900
commite6959cbddd63b2afe191fa573b0c29e1f2943952 (patch)
tree5ccf9a3a52c8a20e7f91067f256bbd6d50b062d2
parente4a958b5a30445851f05d39423189eebf99e2c00 (diff)
downloadDLT-daemon-e6959cbddd63b2afe191fa573b0c29e1f2943952.tar.gz
dlt-control.c: initialize dltdata via struct literal (#257)
this make the code easier to read and initializes all other variables with 0 Signed-off-by: Moritz Warning <moritzwarning@web.de>
-rw-r--r--src/console/dlt-control.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/console/dlt-control.c b/src/console/dlt-control.c
index 190793a..40f5599 100644
--- a/src/console/dlt-control.c
+++ b/src/console/dlt-control.c
@@ -287,26 +287,16 @@ int main(int argc, char *argv[])
struct timespec ts;
/* Initialize dltdata */
- dltdata.vflag = 0;
- dltdata.yflag = 0;
- dltdata.evalue = 0;
- dltdata.bvalue = 0;
-
- dltdata.avalue = 0;
- dltdata.cvalue = 0;
- dltdata.svalue = 0;
- dltdata.mvalue = 0;
- dltdata.xvalue = 0;
- dltdata.tvalue = 1000;
- dltdata.lvalue = DLT_INVALID_LOG_LEVEL;
- dltdata.rvalue = DLT_INVALID_TRACE_STATUS;
- dltdata.dvalue = -1;
- dltdata.fvalue = -1;
- dltdata.ivalue = -1;
- dltdata.oflag = -1;
- dltdata.gflag = -1;
- dltdata.jvalue = 0;
- dltdata.kvalue = 0;
+ dltdata = (DltReceiveData) {
+ .tvalue = 1000,
+ .lvalue = DLT_INVALID_LOG_LEVEL,
+ .rvalue = DLT_INVALID_TRACE_STATUS,
+ .dvalue = -1,
+ .fvalue = -1,
+ .ivalue = -1,
+ .oflag = -1,
+ .gflag = -1,
+ };
/* Fetch command line arguments */
opterr = 0;