Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changed to comply with DCL02

...

Code Block
bgColor#FFcccc
langc
unsigned long int ulu_a = ULONG_MAX;
signed char sc;
sc = (signed char)ulu_a; /* cast eliminates warning */

...

Code Block
bgColor#ccccff
langc
unsigned long int ulu_a = ULONG_MAX;
signed char sc;
if (ulu_a <= SCHAR_MAX) {
  sc = (signed char)ulu_a;  /* use cast to eliminate warning */
}
else {
  /* handle error condition */
}

...

Code Block
bgColorFFcccc
langc
signed long int sls_a = LONG_MAX;
signed char sc = (signed char)sls_a; /* cast eliminates warning */

...

Code Block
bgColor#ccccff
langc
signed long int sls_a = LONG_MAX;
signed char sc;
if ( (sls_a < SCHAR_MIN) || (sls_a > SCHAR_MAX) ) {
  /* handle error condition */
}
else {
  sc = (signed char)sls_a; /* use cast to eliminate warning */

}

...

Code Block
bgColorFFcccc
langc
unsigned long int ulu_a = ULONG_MAX;
unsigned char uc = (unsigned char)ulu_a;  /* cast eliminates warning */

...

Code Block
bgColor#ccccff
langc
unsigned long int ulu_a = ULONG_MAX;
unsigned char uc;
if (ulu_a > UCHAR_MAX) ) {
  /* handle error condition */
}
else {
  uc = (unsigned char)ulu_a; /* use cast to eliminate warning */
}

...