Changes between Version 9 and Version 10 of Developer/Coding/Conventions


Ignore:
Timestamp:
Dec 15, 2012, 8:01:00 PM (7 years ago)
Author:
Gedare
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Coding/Conventions

    v9 v10  
    7979
    8080But remember, it is better to write code in the accepted style than to use a program to get it there.
     81= RTEMS Coding Style =
     82
     83This section applies primarily to code residing under cpukit, especially cpukit/score.
     84= Naming =
     85
     86SuperCore is organized in an Object-Oriented fashion. Each score Manager is a Package, or Module, and each Module contains type definitions, functions, etc. The following summarizes our conventions for using names within SuperCore Modules.
     87 *  Use "Module_name_Particular_type_name" for type names.
     88 *  Use "_Module_name_Particular_function_name" for functions names.
     89 *  Use "_Module_name_Global_or_file_scope_variable_name" for global or file scope variable names.
     90
     91Within a structure,
     92 *  Use "Name" for struct aggregate members.
     93 *  Use "name" for reference members.
     94 *  Use "name" for primitive type members.
     95Example
     96{{{
     97typedef struct {
     98  Other_module_Struct_type    Aggregate_member_name;
     99  Other_module_Struct_type   *reference_member_name;
     100  Other_module_Primitive_type primitive_member_name;
     101} The_module_Type_name;
     102}}}
    81103= Performance Issues =
    82104