-
Notifications
You must be signed in to change notification settings - Fork 65
Description
This issue was imported from the GSFC issue tracking system
Imported from: [GSFCCFS-1793] CF Code Style - use of side-effects statements within "if"
Originally submitted by: Hickey, Joseph P. (GSFC-582.0)[VANTAGE SYSTEMS INC] on Wed Nov 17 08:55:11 2021
Original Description:
CF uses many statements such as this to check the status of a call and store in a local variable:
if ((status = CFE_SB_CreatePipe(&CF_AppData.cmd_pipe, CF_PIPE_DEPTH, CF_PIPE_NAME)) != CFE_SUCCESS)
Most other CFS code break this out into separate statements, i.e.
status = CFE_SB_CreatePipe(&CF_AppData.cmd_pipe, CF_PIPE_DEPTH, CF_PIPE_NAME)
if (status != CFE_SUCCESS)
I believe GSFC coding standards also prefer the latter form. Recommend updating these statements for readability.