You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently expat has no consistent coding style. See e.g. this piece of xmlparse.c:
static XML_Bool /* only valid for root parser */
startParsing(XML_Parser parser)
{
/* hash functions must be initialized before setContext() is called */
if (hash_secret_salt == 0)
hash_secret_salt = generate_hash_secret_salt(parser);
if (ns) {
/* implicit context only set for root parser, since child
parsers (i.e. external entity parsers) will inherit it
*/
return setContext(parser, implicitContext);
}
return XML_TRUE;
}
XML_Parser XMLCALL
XML_ParserCreate_MM(const XML_Char *encodingName,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *nameSep)
{
return parserCreate(encodingName, memsuite, nameSep, NULL);
}
The first function indents with 4 spaces for the main function, but 2 spaces for the rest. The second function indents with 2 spaces. Similar examples can be found throughout the code.
I don't have any strong feelings about tabs vs. spaces or any other parts of coding style, but I think the style should be consistent within a project (or at least within a source file). To avoid too much unnecessary changes I'd recommend going for a coding style that's as close as possible to the already existing style.
Ideally the coding style should be documented in the form of a set of parameters for a common style checking tool (like clang-format or GNU indent) and there should be a possibility to check the whole code for compliance.
The text was updated successfully, but these errors were encountered:
Currently expat has no consistent coding style. See e.g. this piece of xmlparse.c:
The first function indents with 4 spaces for the main function, but 2 spaces for the rest. The second function indents with 2 spaces. Similar examples can be found throughout the code.
I don't have any strong feelings about tabs vs. spaces or any other parts of coding style, but I think the style should be consistent within a project (or at least within a source file). To avoid too much unnecessary changes I'd recommend going for a coding style that's as close as possible to the already existing style.
Ideally the coding style should be documented in the form of a set of parameters for a common style checking tool (like clang-format or GNU indent) and there should be a possibility to check the whole code for compliance.
The text was updated successfully, but these errors were encountered: