Closed Dogora closed 9 years ago
That macro expands to a block of code with braces around it (following is the result after same code snipped was passed through CPP):
if (loc == 910)
{ logmsg(0,"Factory Reset request sent (device=%d)",data[0]); set_message_reply(reply,msg,0,"Factory Reset request sent (device=%d)",data[0]); }
else
{ logmsg(0,"Program Data Command (#1) failed (device=%d,location=%d,type=%d,len=%d): %x", data[0],loc,datatype,datalen,msgin.msgnum); set_message_reply(reply,msg,3,"Program Data Command (#1) failed (device=%d,location=%d,type=%d,len=%d): %x", data[0],loc,datatype,datalen,msgin.msgnum); }
;
return;
}
But clearly some braces won't hurt to make it bit more readable...
It seemed like it wasn't a problem because of the macro expansion. I only noticed it because Emacs got confused when I told it to re-indent.
It was really problem with emacs :) as compiler was perfectly happy with the results.... But I updated the code so it won't confuse editors...
In process.c, you missed a semicolon on line 1095, and I think the lines using the macro SET_MSG_REPLY should be enclosed in braces.
The code is as follows:
It should be (in my opinion) this: