<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paxxi</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paxxi"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Paxxi"/>
	<updated>2026-06-05T04:25:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Installer.png&amp;diff=123593</id>
		<title>File:Installer.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Installer.png&amp;diff=123593"/>
		<updated>2016-07-20T18:23:06Z</updated>

		<summary type="html">&lt;p&gt;Paxxi: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Paxxi</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Official:Code_guidelines_and_formatting_conventions&amp;diff=97764</id>
		<title>Official:Code guidelines and formatting conventions</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Official:Code_guidelines_and_formatting_conventions&amp;diff=97764"/>
		<updated>2015-06-21T19:11:11Z</updated>

		<summary type="html">&lt;p&gt;Paxxi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
These are conventions which we try to follow when writing code for Kodi. They are this way mainly for reasons of taste, however, sticking to a common set of formatting rules also makes it slightly easier to read through our sources. If you want to submit patches, please try to follow these rules.&lt;br /&gt;
&lt;br /&gt;
As such we don&#039;t follow these rules slavishly, in certain cases it is ok (and in fact favorable) to stray from them.&lt;br /&gt;
== Indentation ==&lt;br /&gt;
Use spaces as tab policy with an indentation size of 2&lt;br /&gt;
&lt;br /&gt;
=== Namespaces ===&lt;br /&gt;
Namespaces are not required to use any indentation to simplify nested namespaces and wrapping .cpp files in a namespace&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namespace KODI&lt;br /&gt;
{&lt;br /&gt;
namespace UTILS&lt;br /&gt;
{&lt;br /&gt;
class ILogger&lt;br /&gt;
{&lt;br /&gt;
  void Log(...) = 0;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Braces ==&lt;br /&gt;
Braces should go to newline and your code should look like the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (int i = 0; i &amp;lt; t; i++)&lt;br /&gt;
{&lt;br /&gt;
  [...]&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  [...]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Dummy()&lt;br /&gt;
{&lt;br /&gt;
  [...]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Whitespaces ==&lt;br /&gt;
Conventional operators should be surrounded by a whitespace.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a = (b + c) * d;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reserved words should be separated from opening parentheses by a whitespace.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
while (true)&lt;br /&gt;
for (int i = 0; i &amp;lt; x; ++i)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commas should be followed by a whitespace.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void Dummy::Method(int a, int b, int c);&lt;br /&gt;
int d, e;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Semicolons should be followed by a whitespace if there is more than one expression per line.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; x; ++i)&lt;br /&gt;
doSomething(e); doSomething(f); // this is probably bad style anyway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Control statements ==&lt;br /&gt;
Insert new line before &lt;br /&gt;
* &#039;&#039;else&#039;&#039; in an &#039;&#039;if&#039;&#039; statement &lt;br /&gt;
* &#039;&#039;catch&#039;&#039; in a &#039;&#039;try&#039;&#039; statement&lt;br /&gt;
* &#039;&#039;while&#039;&#039; in a &#039;&#039;do&#039;&#039; statement&lt;br /&gt;
&lt;br /&gt;
=== if else ===&lt;br /&gt;
* put &#039;&#039;then&#039;&#039; statement, &#039;&#039;return&#039;&#039; or &#039;&#039;throw&#039;&#039; to new line&lt;br /&gt;
* keep &#039;&#039;else if&#039;&#039; on one line&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (true) &lt;br /&gt;
  return;&lt;br /&gt;
&lt;br /&gt;
if (true) &lt;br /&gt;
{&lt;br /&gt;
  [...]&lt;br /&gt;
} &lt;br /&gt;
else if (false) &lt;br /&gt;
{&lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
else&lt;br /&gt;
  return;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== switch / case ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
switch (cmd)&lt;br /&gt;
{&lt;br /&gt;
  case x:&lt;br /&gt;
  {&lt;br /&gt;
    doSomething();&lt;br /&gt;
    break;&lt;br /&gt;
  }&lt;br /&gt;
  case x:&lt;br /&gt;
  case z:&lt;br /&gt;
    return true;&lt;br /&gt;
  default:&lt;br /&gt;
    doSomething();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming ==&lt;br /&gt;
=== Namespaces ===&lt;br /&gt;
Namespaces should be in uppercase letters&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
namespace KODI&lt;br /&gt;
{&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Constants ===&lt;br /&gt;
Use upper case with underscore spacing where necessary.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const int MY_CONSTANT = 1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enums ===&lt;br /&gt;
Use CamelCase for the enum name and upper case for the values.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum Dummy&lt;br /&gt;
{&lt;br /&gt;
  VALUE_X,&lt;br /&gt;
  VALUE_Y&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interfaces ===&lt;br /&gt;
We use CamelCase for interface names and they should be prefixed with an uppercase I.&lt;br /&gt;
Filename should match the interface name, e.g. ILogger.h&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class ILogger&lt;br /&gt;
{&lt;br /&gt;
  void Log(...) = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Classes ===&lt;br /&gt;
We use CamelCase for class names and they should be prefixed with an uppercase C.&lt;br /&gt;
Filename should match the class name without the prefixed C, e.g. Logger.cpp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class CLogger : public ILogger&lt;br /&gt;
{&lt;br /&gt;
  void Log(...)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
We use CamelCase for method names and first letter should be upper case.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void MyDummyClass::DoSomething();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
We use CamelCase for variables. Type prefixing is optional.&lt;br /&gt;
&lt;br /&gt;
==== Global Variables ====&lt;br /&gt;
Prefix global variables with &#039;&#039;g_&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int g_globalVariableA;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Member Variables ====&lt;br /&gt;
Prefix member variables with &#039;&#039;m_&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int m_variableA;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Conventions ==&lt;br /&gt;
=== Casts ===&lt;br /&gt;
New code should use C++ style casts and not older C style casts. When modifying existing code the developer can choose to update it to C++ style casts or leave as is.&lt;br /&gt;
Remember that whenever a dynamic_cast is used the result can be a nullptr and needs to be checked accordingly.&lt;br /&gt;
&lt;br /&gt;
=== NULL vs nullptr ===&lt;br /&gt;
Prefer the use of nullptr instead of NULL. nullptr is a typesafe version and as such can&#039;t be implicitly converted to int or anything else.&lt;br /&gt;
&lt;br /&gt;
=== auto ===&lt;br /&gt;
Feel free to use auto wherever it improves readability. Good places are iterators or when dealing with containers.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
std::map&amp;lt;std::string, std::vector&amp;lt;int&amp;gt;&amp;gt;::iterator i = var.begin();&lt;br /&gt;
vs&lt;br /&gt;
auto i = var.being();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== for loops ===&lt;br /&gt;
Use newer style foreach loops whenever it makes sense. If iterators are used see above about using auto.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (auto&amp;amp; : var)&lt;br /&gt;
{&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Use const auto&amp;amp; if there&#039;s no reason to modify the value.&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Paxxi</name></author>
	</entry>
</feed>