Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For example you might define a static/internal function within your C program like this:

...

     static void vAverage (X_

...

LONG lArg1,

...

                      X_LONG lArg2,

                      1

 { 

      X_LONG lAverage; 

      lAverage = (lArg1 + lArg2) / 2;

...

 
                     X_LONG lArg2,
                     1
{
     X_LONG lAverage;
     lAverage = (lArg1 + lArg2) / 2;
     U_BIF_SET_RET_FROM_

...

LONG (sRetNo,

...

 lAverage);

...

      return; 

 
     return;
}

To execute this function you might code:

...

     vAverage (6,

...

 42,

...

 17);

If you do this you will find that it will not compile.

...

You can correct this problem by changing the code to be like this:

...

     static void vAverage (U_BIF_STANDARD_PARAMETERS,

                         X_LONG lArg1, 

                         X_LONG lArg2, 

                         X_SHORT sRetNo) 

    X_LONG lAverage; 

    lAverage = (lArg1 + lArg2) / 2;

...

                              X_LONG lArg1, 
                        X_LONG lArg2,
                        X_SHORT sRetNo)
{
   X_LONG lAverage;
   lAverage = (lArg1 + lArg2) / 2;
   U_BIF_SET_RET_FROM_

...

LONG (sRetNo,

...

 lAverage);

...

    return; 

 
   return;
}

and then by changing the execution of the function to be like this:

...

     vAverage (U_BIF_STANDARD_ARGUMENTS,

...

 6,

...

 42,

...

 17);

Of course the behavior of some U_BIF macros is changed when they are used in a static or internal function.

...

So in this example you could code:

...

     vAverage (U_BIF_STANDARD_ARGUMENTS,

...

 6,

...

 42,

...

 17);
U_BIF_HANDLE_FATAL_ERROR