R
richard
Two nice style points I've learned from clc
1) xyz = malloc(count * sizeof(*xyz)); rather than
xyz = malloc(count * sizeof(xyz-type));
2) TYPE xyz = {0}; rather than
memset(&xyz, 0, sizeof(xyz));
TYPE xyz = {0, 0, 0};
TYPE xyz = {NULL, 0, NULL};
if xyz is a struct: xyz.this = NULL; xyz.that = 0; xyz.other = NULL;
Any other analogous suggestions?
1) xyz = malloc(count * sizeof(*xyz)); rather than
xyz = malloc(count * sizeof(xyz-type));
2) TYPE xyz = {0}; rather than
memset(&xyz, 0, sizeof(xyz));
TYPE xyz = {0, 0, 0};
TYPE xyz = {NULL, 0, NULL};
if xyz is a struct: xyz.this = NULL; xyz.that = 0; xyz.other = NULL;
Any other analogous suggestions?