Skip to content

Commit

Permalink
remove basic usages of memset with {}
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Oct 13, 2020
1 parent b153fe3 commit 48bb69b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions asc2log.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void eval_canfd(char* buf, struct timeval *date_tvp, char timestamps, int dplace
int interface;
static struct timeval tv; /* current frame timestamp */
static struct timeval read_tv; /* frame timestamp from ASC file */
struct canfd_frame cf;
struct canfd_frame cf = {};
unsigned char brs, esi, ctmp;
unsigned int flags;
int dlc, dlen = 0;
Expand All @@ -241,8 +241,6 @@ void eval_canfd(char* buf, struct timeval *date_tvp, char timestamps, int dplace
00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 c0 \
100000 214 223040 80000000 46500250 460a0250 20011736 20010205 */

memset(&cf, 0, sizeof(cf));

/* check for valid line without symbolic name */
if (sscanf(buf, "%lu.%lu %*s %d %2s %s %hhx %hhx %x %d ",
&read_tv.tv_sec, &read_tv.tv_usec, &interface,
Expand Down
6 changes: 2 additions & 4 deletions cangw.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,8 @@ int main(int argc, char **argv)
struct can_filter filter;
struct sockaddr_nl nladdr;

struct cgw_csum_xor cs_xor;
struct cgw_csum_crc8 cs_crc8;
struct cgw_csum_xor cs_xor = {};
struct cgw_csum_crc8 cs_crc8 = {};
char crc8tab[513] = {0};

struct modattr modmsg[CGW_MOD_FUNCS];
Expand All @@ -717,8 +717,6 @@ int main(int argc, char **argv)
int i;

memset(&req, 0, sizeof(req));
memset(&cs_xor, 0, sizeof(cs_xor));
memset(&cs_crc8, 0, sizeof(cs_crc8));

while ((opt = getopt(argc, argv, "ADFLs:d:Xteiu:l:f:c:p:x:m:M:?")) != -1) {
switch (opt) {
Expand Down

0 comments on commit 48bb69b

Please sign in to comment.