From ec917c88869824dc3681d6c8ebebfd8ecb445f68 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Fri, 21 Jan 2005 06:57:32 +0000 Subject: ChangeLogTag:Thu Jan 20 22:48:24 2005 Ossama Othman --- docs/ACE-guidelines.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'docs') diff --git a/docs/ACE-guidelines.html b/docs/ACE-guidelines.html index 01e0b5ec79c..9349ad14130 100644 --- a/docs/ACE-guidelines.html +++ b/docs/ACE-guidelines.html @@ -51,7 +51,7 @@ bgcolor="#ffffff"> requires the attention of, a particular individual: SEND EMAIL TO THAT INDIVIDUAL!.

-

  • Every program should have a ``usage'' message. It should be +
  • Every program should have a "usage" message. It should be printed out if erroneous command line arguments, or a -? command line argument, are provided to the program.

    @@ -205,12 +205,12 @@ bgcolor="#ffffff">

  • Be very careful with names of macros, enum values, and variables It's always best to prefix them with something like ACE_ or TAO_. There are too many system headers out - there that #define OK, SUCCESS, + there that #define OK, SUCCESS, ERROR, index, s_type, and so on.

  • When using macros in an arithmetic expression, be sure to test - that the macro is defined, using defined(macro) before specifying + that the macro is defined, using defined(macro) before specifying the expression. For example:
     #if __FreeBSD__ < 3
    @@ -222,8 +222,8 @@ not defined.  The correct way to write that guard is:
     #if defined (__FreeBSD__)  &&  __FreeBSD__ < 3
     
    -
  • Try to centralize #ifdefs with typedefs - and #defines. For example, use this: +
  • Try to centralize #ifdefs with typedefs + and #defines. For example, use this:
             #if defined(ACE_PSOS)
               typedef long ACE_NETIF_TYPE;
    @@ -261,7 +261,7 @@ not defined.  The correct way to write that guard is:
             file once per compilation unit.  Thanks to Eric C. Newton
             <ecn@smart.net> for pointing that out.

    - If the header #includes an ACE library header, + If the header #includes an ACE library header, then it's a good idea to include the #pragma once directive:

    @@ -403,22 +403,22 @@ not defined.  The correct way to write that guard is:
       
    • for loops should look like:
      -        for (u_int i = 0; i < count; ++i)
      +        for (unsigned int i = 0; i < count; ++i)
                 ++total;
               
      Though, I prefer to always wrap the body of the loop in braces, to avoid surprises when other code or debugging statements are added, and to maintain sanity when the body consists of a macro, - such as an ACE_ASSERT without a trailing semicolon: + such as an ACE_ASSERT without a trailing semicolon:
      -        for (u_int i = 0; i < count; ++i)
      +        for (unsigned int i = 0; i < count; ++i)
                 {
                   ACE_ASSERT (++total < UINT_MAX;)
                 }
               

      Similarly, if statements should have - a space after the ``if'', and no spaces just after + a space after the "if", and no spaces just after the opening parenthesis and just before the closing parenthesis.

    • If a loop index is used after the body of the loop, it @@ -511,7 +511,7 @@ not defined. The correct way to write that guard is: ACE_INLINE Foo::bar () { - this->baz(); + this->baz (); }

    @@ -543,7 +543,7 @@ Foo::bar () // Returns the <ACE_INET_Addr> for this profile.

    - instead of the ``set_'' and ``get_'' form.

    + instead of the "set_" and "get_" form.

  • Never use delete to deallocate memory that was allocated with malloc. @@ -1155,7 +1155,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'

    -Last modified: Thu Jan 20 22:49:50 PST 2005 +Last modified: Thu Jan 20 22:57:23 PST 2005

    -- cgit v1.2.1