[Opensim-dev] Wholesale reformatting of files (UNCLASSIFIED)
Melanie
melanie at t-data.com
Thu May 28 23:12:08 UTC 2015
OpenSim coding standards mandate this is written as:
if (sp == null)
m_log.WarnFormat("[SCENE PRESENCE]: Did not find presence with
id {0} in {1} before timeout", agentID, RegionInfo.RegionName);
or
if (sp == null)
{
m_log.WarnFormat("[SCENE PRESENCE]: Did not find presence with
id {0} in {1} before timeout", agentID, RegionInfo.RegionName);
}
or
if (sp == null)
{
m_log.WarnFormat("[SCENE PRESENCE]: Did not find presence with
id {0} in {1} before timeout",
agentID, RegionInfo.RegionName);
}
Never use K&R Style indentations, the open brace appears on it's own
line always unless it's an array initialization. There it may be on
the same line as the identified if the initializer fits on the same
line, including it's closed brace.
Apart from the above case, the open brace and it's corresponding
closed brace have the same indentation level.
Also, no spaces are placed between the name of a method and it's
open parenthesis, nor between the open parenthesis and the first
argument, nor before the closing parenthesis.
A space is placed before the open parenthesis of built-ins that
change the flow of execution, that is if, do, while, lock, etc.
If arguments are broken over multiple lines, the indentation of the
continuation lines is to be at least 8 spaces but may be more to
align arguments to complex methods vertically.
See above.
- Melanie
On 29/05/2015 00:18, M.E. Verhagen wrote:
> The code looks ok, but a bit stange.
>
> if (sp == null) m_log.WarnFormat( "[SCENE PRESENCE]: Did not find presence
> with id {0} in {1} before timeout", agentID, RegionInfo.RegionName); I
> would rather write this on one line:
> if (sp == null) m_log.WarnFormat("[SCENE PRESENCE]: Did not find presence
> with id {0} in {1} before timeout", agentID, RegionInfo.RegionName); Or
> break it up in multiple lines like this: (with on every line an other
> parameter if it makes the code better readable)
>
> if (sp == null) { m_log.WarnFormat( "[SCENE PRESENCE]: Did not find
> presence with id {0} in {1} before timeout", agentID,
> RegionInfo.RegionName); }
>
>
>
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at opensimulator.org
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
More information about the Opensim-dev
mailing list