X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Doc%2FWebsite%2FCodingStyle.html;h=2b53165f6ae8297c6bf7494f031ee3f431839daf;hb=bd217557a398371d5d0a27c5aa6e09e47eb65652;hp=d62d019ff0f71a74aad4f01dcfc0ca514157c161;hpb=2231ee3a3a73117305f6dcbe90acf0b4aed24b3e;p=gdcm.git diff --git a/Doc/Website/CodingStyle.html b/Doc/Website/CodingStyle.html index d62d019f..2b53165f 100644 --- a/Doc/Website/CodingStyle.html +++ b/Doc/Website/CodingStyle.html @@ -149,7 +149,7 @@ logical blocks of code with the concerned comments. - Use parantheses around conditions e.g. with an if statement: if ( someLocalVariable == 2 ) { ... } - - Add spaces around parantheses, or braces. Use + - Add spaces around parentheses, or braces. Use if ( someLocalVariable == 2 ) { ClassMenber += 1; } and not if (someLocalVariable == 2) {ClassMenber += 1;} @@ -227,11 +227,11 @@ * dictionaries), look for the element value representation of * a given tag. * @param group Group number of the searched tag. - * @param element Element number of the searched tag. + * @param elem Element number of the searched tag. * @return Corresponding element value representation when it exists, * and the string "gdcm::Unfound" otherwise. */ - std::string Document::GetEntryByNumber(guint16 group, guint16 element) + std::string Document::GetEntryByNumber(guint16 group, guint16 elem) { ... } @@ -244,17 +244,26 @@ warnings won't work). - Don't use the C standard library. Don't include stdio.h, ctype.h... Don't use printf(), sprinf(), FILE*... - - Don't use the NULL notation (either as macro, or as const int NULL=0). + - Don't use the NULL notation (neither as macro, nor as const int NULL=0). A pointer that doesn't refer to an object should simply be defined as DataPointer* MyDataPointer = 0; * Basic types: - Assume T is a given type. When declaring or defining with the "pointer to T" notation, the * character must be adjacent to - the type and not the variable. That is use + the variable and not the type. That is use + T *foo = 0; + and not T* foo = 0; + - Assume T is a given type. When declaring or defining with the + "reference to T" notation, the & character must be adjacent to + the variable and not the type. That is use + T &foo = 0; and not - T *foo = 0; + T& foo = 0; + This is the common notation, not a 'gdcm special' notation. + (doxygen will not have any longer to correct) + - Always define a typedef for a new type and be consistent in usage. Use typedef Header* HeaderPointer; @@ -279,7 +288,7 @@ long long -> int64_t; Hence do not use declarations like "unsigned int". With g++, accessing those typedef is achieved by the following - #include + #include < stdint.h >