Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
I thought that we had agreed to always use braces for control structures (for, if, while, etc.) since that makes it easier to add/remove lines without worrying about adding/removing braces too. I don't see it mentioned either way on the coding style page, but I know I've developed the habit of using braces unconditionally based on my recollection of that decision. I don't really have a strong opinion either way; the #1 thing is that we should agree and get it down on the wiki page so that these style updates converge rather than oscillating. Steve On Sat, Sep 27, 2008 at 9:04 PM, Nathan Binkert [EMAIL PROTECTED] wrote: void copyIprs(ThreadContext *src, ThreadContext *dest) { -for (int i = 0; i NumInternalProcRegs; ++i) { +for (int i = 0; i NumInternalProcRegs; ++i) dest-setMiscRegNoEffect(i, src-readMiscRegNoEffect(i)); -} } ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
Also, please make these sorts of large scale formatting changes judiciously. There's a large collection of patches out there and it can be non-trivial to keep them applying correctly. Gabe Steve Reinhardt wrote: I thought that we had agreed to always use braces for control structures (for, if, while, etc.) since that makes it easier to add/remove lines without worrying about adding/removing braces too. I don't see it mentioned either way on the coding style page, but I know I've developed the habit of using braces unconditionally based on my recollection of that decision. I don't really have a strong opinion either way; the #1 thing is that we should agree and get it down on the wiki page so that these style updates converge rather than oscillating. Steve On Sat, Sep 27, 2008 at 9:04 PM, Nathan Binkert [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: void copyIprs(ThreadContext *src, ThreadContext *dest) { -for (int i = 0; i NumInternalProcRegs; ++i) { +for (int i = 0; i NumInternalProcRegs; ++i) dest-setMiscRegNoEffect(i, src-readMiscRegNoEffect(i)); -} } ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
I thought that we had agreed to always use braces for control structures (for, if, while, etc.) since that makes it easier to add/remove lines without worrying about adding/removing braces too. I don't see it mentioned either way on the coding style page, but I know I've developed the habit of using braces unconditionally based on my recollection of that decision. oh, I thought the agreement was that you use braces if there is an else, but if it's just a simple two liner, you don't have to. I don't really have a strong opinion either way; the #1 thing is that we should agree and get it down on the wiki page so that these style updates converge rather than oscillating. Agreed. What do you think about my above statement? If the whole expression fits in two lines, no braces required. More than two requires braces. Nate ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
I don't really have a strong opinion either way; the #1 thing is that we should agree and get it down on the wiki page so that these style updates converge rather than oscillating. Agreed. What do you think about my above statement? If the whole expression fits in two lines, no braces required. More than two requires braces. I think that sounds fine. Does no braces required also mean no braces allowed, or is that something left up to the implementers discretion? I think it should be optional rather than forbidden. Gabe ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
I think that sounds fine. Does no braces required also mean no braces allowed, or is that something left up to the implementers discretion? I think it should be optional rather than forbidden. I'd agree with optional. ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
On Sat, Sep 27, 2008 at 9:35 PM, nathan binkert [EMAIL PROTECTED] wrote: I think that sounds fine. Does no braces required also mean no braces allowed, or is that something left up to the implementers discretion? I think it should be optional rather than forbidden. I'd agree with optional. Optional is OK with me, but in that case it's not something that should be fixed in a style update. Steve ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev
Re: [m5-dev] changeset in m5: style: Make a style pass over the whole arch/al...
Optional is OK with me, but in that case it's not something that should be fixed in a style update. True, my bad. I was just going really fast. Nate ___ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev