R
randy
Hi c,
Trying to understand somebody else's code.
I look at a simple loop, to write flash memory, a data structure 3 levels deep, and see stuff like this:
if(GSN_FW_APP_0 == fwupCtx->gsnExtFlashFwupPvtCtx.binInProgress)
{
fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.APP1Size = fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.APP1Size + buffsize;
/* Calculate the intermidiate checksum*/
while(orgbuffsize>0)
{
fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.app1Checksum = fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.app1Checksum + (*orgbuff++);
orgbuffsize--;
}
}
It has been a while, do we really write now, with variable names 30+ characters long, in complex data structures, or do we use the preprocessor and tools to manage this?
I do not see how to read code written this way, it looks tool generated to me.
I will have to rewrite it by hand, and refer to the defined data structures to see whats going on. This is totally illegible.
Whats been happening since I have been out, for 10+ years?
Randy
Trying to understand somebody else's code.
I look at a simple loop, to write flash memory, a data structure 3 levels deep, and see stuff like this:
if(GSN_FW_APP_0 == fwupCtx->gsnExtFlashFwupPvtCtx.binInProgress)
{
fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.APP1Size = fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.APP1Size + buffsize;
/* Calculate the intermidiate checksum*/
while(orgbuffsize>0)
{
fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.app1Checksum = fwupCtx->gsnExtFlashFwupPvtCtx.fwupWlanCtrlBlk.app1Checksum + (*orgbuff++);
orgbuffsize--;
}
}
It has been a while, do we really write now, with variable names 30+ characters long, in complex data structures, or do we use the preprocessor and tools to manage this?
I do not see how to read code written this way, it looks tool generated to me.
I will have to rewrite it by hand, and refer to the defined data structures to see whats going on. This is totally illegible.
Whats been happening since I have been out, for 10+ years?
Randy