From ecf6223638267989942aa2d38ca930cfdb0a1d66 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Wed, 14 Oct 2026 11:15:06 -0400 Subject: [PATCH 1/9] Fix nasa#144, In fsw/src/lc_watch.c, in LC_GetSizedWPData(), in case LC_DATA_WATCH_BYTE, cast TempBuffer.Signed8 to uint32 before setting equal to *SizedDataPtr --- fsw/src/lc_watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 67e8bb9..3037c11 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -907,7 +907,7 @@ bool LC_GetSizedWPData(uint16 WatchIndex, const uint8 *WPDataPtr, uint32 *SizedD { case LC_DATA_WATCH_BYTE: TempBuffer.Signed8 = *WPDataPtr; - *SizedDataPtr = TempBuffer.Signed8; /* Extend signed 8 bit value to 32 bits */ + *SizedDataPtr = (uint32)TempBuffer.Signed8; /* Extend signed 8 bit value to 32 bits */ break; case LC_DATA_WATCH_UBYTE: From c1b61f04415e9a8ec4ad5b8090d776391032f43b Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 23 Oct 2026 07:55:19 -0400 Subject: [PATCH 2/9] Fix nasa#149, Remove assignments that are never used --- fsw/src/lc_app.c | 14 +++++++------- fsw/src/lc_watch.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fsw/src/lc_app.c b/fsw/src/lc_app.c index 94324f0..13e99cd 100644 --- a/fsw/src/lc_app.c +++ b/fsw/src/lc_app.c @@ -54,10 +54,10 @@ LC_AppData_t LC_AppData; void LC_AppMain(void) { - int32 Status = CFE_SUCCESS; - bool Initialized = false; - uint32 RunStatus = CFE_ES_RunStatus_APP_RUN; - CFE_SB_Buffer_t *BufPtr = NULL; + int32 Status; + bool Initialized; + uint32 RunStatus = CFE_ES_RunStatus_APP_RUN; + CFE_SB_Buffer_t *BufPtr = NULL; /* ** Performance Log, Start @@ -186,7 +186,7 @@ void LC_AppMain(void) CFE_Status_t LC_AppInit(void) { - CFE_Status_t Status = CFE_SUCCESS; + CFE_Status_t Status; /* ** Zero out the global data structures... @@ -241,7 +241,7 @@ CFE_Status_t LC_AppInit(void) CFE_Status_t LC_EvsInit(void) { - CFE_Status_t Status = CFE_SUCCESS; + CFE_Status_t Status; /* ** If an application event filter table is added @@ -269,7 +269,7 @@ CFE_Status_t LC_EvsInit(void) CFE_Status_t LC_SbInit(void) { - CFE_Status_t Status = CFE_SUCCESS; + CFE_Status_t Status; /* ** Initialize housekeeping packet... diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 3037c11..9314df0 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -785,9 +785,9 @@ bool LC_WPOffsetValid(uint16 WatchIndex, const CFE_SB_Buffer_t *BufPtr) { size_t MsgLength = 0; uint32 Offset; - uint32 NumOfDataBytes = 0; - bool OffsetValid = true; - CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; + uint32 NumOfDataBytes; + bool OffsetValid = true; + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; /* ** Check the message length against the watchpoint From d83878989a9647ccaece2fd2623563db89a4fa73 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 21 Aug 2026 15:37:59 -0400 Subject: [PATCH 3/9] For nasa/lc#137, Separated increment and decrement operators from other operators in fsw/src/lc_action.c and lc_watch.c except when using POP_RPN_DATA --- fsw/src/lc_action.c | 80 ++++++++++++++++++++++++++++++++++++--------- fsw/src/lc_watch.c | 25 +++++++++++--- 2 files changed, 84 insertions(+), 21 deletions(-) diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index 92c1d35..aed59a6 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -322,7 +322,10 @@ uint8 LC_EvaluateRPN(uint16 APNumber) ** Pick off each piece of the RPN equation and handle ** one at a time */ - RPNData = LC_OperData.ADTPtr[APNumber].RPNEquation[RPNEquationPtr++]; + RPNData = LC_OperData.ADTPtr[APNumber].RPNEquation[RPNEquationPtr]; + + /* Increment RPNEquationPtr */ + RPNEquationPtr++; /* ** The data is either an RPN operator or a watchpoint number @@ -339,19 +342,31 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_FALSE) || (Operand2 == LC_WATCH_FALSE)) { - RPNStack[StackPtr++] = LC_WATCH_FALSE; + RPNStack[StackPtr] = LC_WATCH_FALSE; + + /* Increment StackPtr */ + StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr++] = LC_WATCH_ERROR; + RPNStack[StackPtr] = LC_WATCH_ERROR; + + /* Increment StackPtr */ + StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr++] = LC_WATCH_STALE; + RPNStack[StackPtr] = LC_WATCH_STALE; + + /* Increment StackPtr */ + StackPtr++; } else { - RPNStack[StackPtr++] = LC_WATCH_TRUE; + RPNStack[StackPtr] = LC_WATCH_TRUE; + + /* Increment StackPtr */ + StackPtr++; } break; @@ -360,19 +375,31 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_TRUE) || (Operand2 == LC_WATCH_TRUE)) { - RPNStack[StackPtr++] = LC_WATCH_TRUE; + RPNStack[StackPtr] = LC_WATCH_TRUE; + + /* Increment StackPtr */ + StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr++] = LC_WATCH_ERROR; + RPNStack[StackPtr] = LC_WATCH_ERROR; + + /* Increment StackPtr */ + StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr++] = LC_WATCH_STALE; + RPNStack[StackPtr] = LC_WATCH_STALE; + + /* Increment StackPtr */ + StackPtr++; } else { - RPNStack[StackPtr++] = LC_WATCH_FALSE; + RPNStack[StackPtr] = LC_WATCH_FALSE; + + /* Increment StackPtr */ + StackPtr++; } break; @@ -381,15 +408,24 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr++] = LC_WATCH_ERROR; + RPNStack[StackPtr] = LC_WATCH_ERROR; + + /* Increment StackPtr */ + StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr++] = LC_WATCH_STALE; + RPNStack[StackPtr] = LC_WATCH_STALE; + + /* Increment StackPtr */ + StackPtr++; } else { - RPNStack[StackPtr++] = (Operand1 != Operand2); + RPNStack[StackPtr] = (Operand1 != Operand2); + + /* Increment StackPtr */ + StackPtr++; } break; @@ -397,15 +433,24 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if (Operand1 == LC_WATCH_ERROR) { - RPNStack[StackPtr++] = LC_WATCH_ERROR; + RPNStack[StackPtr] = LC_WATCH_ERROR; + + /* Increment StackPtr */ + StackPtr++; } else if (Operand1 == LC_WATCH_STALE) { - RPNStack[StackPtr++] = LC_WATCH_STALE; + RPNStack[StackPtr] = LC_WATCH_STALE; + + /* Increment StackPtr */ + StackPtr++; } else { - RPNStack[StackPtr++] = (Operand1 == LC_WATCH_FALSE); + RPNStack[StackPtr] = (Operand1 == LC_WATCH_FALSE); + + /* Increment StackPtr */ + StackPtr++; } break; @@ -432,7 +477,10 @@ uint8 LC_EvaluateRPN(uint16 APNumber) default: if (RPNData < LC_MAX_WATCHPOINTS) { - RPNStack[StackPtr++] = LC_OperData.WRTPtr[RPNData].WatchResult; + RPNStack[StackPtr] = LC_OperData.WRTPtr[RPNData].WatchResult; + + /* Increment StackPtr */ + StackPtr++; } else { diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 9314df0..8c556e8 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -135,7 +135,10 @@ void LC_CreateHashTable(void) if (CFE_SB_MsgId_Equal(LastMessageID, MessageID) && (WatchPtLink != (LC_WatchPtList_t *)NULL)) { /* WatchPtLink points to last link in list for this Message ID */ - WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount++]; + WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; + + /* Increment LC_OperData.WatchpointCount */ + LC_OperData.WatchpointCount++; /* Add new link to end of list, point to new last link */ WatchPtLink = WatchPtLink->Next; @@ -180,7 +183,10 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) if (LC_OperData.HashTable[HashTableIndex] == (LC_MessageList_t *)NULL) { /* Get next unused MessageID linked list entry */ - MessageLink = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount++]; + MessageLink = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount]; + + /* Increment LC_OperData.MessageIDsCount */ + LC_OperData.MessageIDsCount++; /* Set first (and only) link in this hash table entry linked list */ LC_OperData.HashTable[HashTableIndex] = MessageLink; @@ -202,9 +208,12 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) if (MessageLink->Next == (LC_MessageList_t *)NULL) { /* Reached end of list without finding MessageID */ - MessageLink->Next = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount++]; + MessageLink->Next = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount]; MessageLink = MessageLink->Next; + /* Increment LC_OperData.MessageIDsCount */ + LC_OperData.MessageIDsCount++; + /* Add link with this MessageID (will exit loop) */ MessageLink->MessageID = MessageID; @@ -237,7 +246,10 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) if (MessageLink->WatchPtList == (LC_WatchPtList_t *)NULL) { /* Get next unused watchpoint linked list entry */ - WatchPtLink = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount++]; + WatchPtLink = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; + + /* Increment LC_OperData.WatchpointCount */ + LC_OperData.WatchpointCount++; /* Set the start (and only) link in the watchpoint link list */ MessageLink->WatchPtList = WatchPtLink; @@ -253,8 +265,11 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) } /* Add the new watchpoint link to the end of the list */ - WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount++]; + WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; WatchPtLink = WatchPtLink->Next; + + /* Increment LC_OperData.WatchpointCount */ + LC_OperData.WatchpointCount++; } /* Return pointer to last link in watchpoint linked list */ From 288e227e66f2b14fc55006c747a2afd29ab46088 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 6 Nov 2026 11:55:58 -0500 Subject: [PATCH 4/9] For nasa/lc#137, Removed comments before increment operations --- fsw/src/lc_action.c | 16 ---------------- fsw/src/lc_watch.c | 5 ----- 2 files changed, 21 deletions(-) diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index aed59a6..bf8847f 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -324,7 +324,6 @@ uint8 LC_EvaluateRPN(uint16 APNumber) */ RPNData = LC_OperData.ADTPtr[APNumber].RPNEquation[RPNEquationPtr]; - /* Increment RPNEquationPtr */ RPNEquationPtr++; /* @@ -344,28 +343,24 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { RPNStack[StackPtr] = LC_WATCH_FALSE; - /* Increment StackPtr */ StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { RPNStack[StackPtr] = LC_WATCH_ERROR; - /* Increment StackPtr */ StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - /* Increment StackPtr */ StackPtr++; } else { RPNStack[StackPtr] = LC_WATCH_TRUE; - /* Increment StackPtr */ StackPtr++; } break; @@ -377,28 +372,24 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { RPNStack[StackPtr] = LC_WATCH_TRUE; - /* Increment StackPtr */ StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { RPNStack[StackPtr] = LC_WATCH_ERROR; - /* Increment StackPtr */ StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - /* Increment StackPtr */ StackPtr++; } else { RPNStack[StackPtr] = LC_WATCH_FALSE; - /* Increment StackPtr */ StackPtr++; } break; @@ -410,21 +401,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { RPNStack[StackPtr] = LC_WATCH_ERROR; - /* Increment StackPtr */ StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - /* Increment StackPtr */ StackPtr++; } else { RPNStack[StackPtr] = (Operand1 != Operand2); - /* Increment StackPtr */ StackPtr++; } break; @@ -435,21 +423,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { RPNStack[StackPtr] = LC_WATCH_ERROR; - /* Increment StackPtr */ StackPtr++; } else if (Operand1 == LC_WATCH_STALE) { RPNStack[StackPtr] = LC_WATCH_STALE; - /* Increment StackPtr */ StackPtr++; } else { RPNStack[StackPtr] = (Operand1 == LC_WATCH_FALSE); - /* Increment StackPtr */ StackPtr++; } break; @@ -479,7 +464,6 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { RPNStack[StackPtr] = LC_OperData.WRTPtr[RPNData].WatchResult; - /* Increment StackPtr */ StackPtr++; } else diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 8c556e8..1a4f3ef 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -137,7 +137,6 @@ void LC_CreateHashTable(void) /* WatchPtLink points to last link in list for this Message ID */ WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; - /* Increment LC_OperData.WatchpointCount */ LC_OperData.WatchpointCount++; /* Add new link to end of list, point to new last link */ @@ -185,7 +184,6 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) /* Get next unused MessageID linked list entry */ MessageLink = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount]; - /* Increment LC_OperData.MessageIDsCount */ LC_OperData.MessageIDsCount++; /* Set first (and only) link in this hash table entry linked list */ @@ -211,7 +209,6 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) MessageLink->Next = &LC_OperData.MessageLinks[LC_OperData.MessageIDsCount]; MessageLink = MessageLink->Next; - /* Increment LC_OperData.MessageIDsCount */ LC_OperData.MessageIDsCount++; /* Add link with this MessageID (will exit loop) */ @@ -248,7 +245,6 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) /* Get next unused watchpoint linked list entry */ WatchPtLink = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; - /* Increment LC_OperData.WatchpointCount */ LC_OperData.WatchpointCount++; /* Set the start (and only) link in the watchpoint link list */ @@ -268,7 +264,6 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) WatchPtLink->Next = &LC_OperData.WatchPtLinks[LC_OperData.WatchpointCount]; WatchPtLink = WatchPtLink->Next; - /* Increment LC_OperData.WatchpointCount */ LC_OperData.WatchpointCount++; } From 9aa6b1b91da96d2551b20cc7a8915403eedff690 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 6 Nov 2026 12:40:56 -0500 Subject: [PATCH 5/9] For nasa/lc#137, Consolidated increment logic in the case block in fsw/src/lc_action.c --- fsw/src/lc_action.c | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index bf8847f..ec010cc 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -342,27 +342,22 @@ uint8 LC_EvaluateRPN(uint16 APNumber) if ((Operand1 == LC_WATCH_FALSE) || (Operand2 == LC_WATCH_FALSE)) { RPNStack[StackPtr] = LC_WATCH_FALSE; - - StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { RPNStack[StackPtr] = LC_WATCH_ERROR; - - StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - - StackPtr++; } else { RPNStack[StackPtr] = LC_WATCH_TRUE; - - StackPtr++; } + + StackPtr++; + break; case LC_RPN_OR: @@ -371,27 +366,22 @@ uint8 LC_EvaluateRPN(uint16 APNumber) if ((Operand1 == LC_WATCH_TRUE) || (Operand2 == LC_WATCH_TRUE)) { RPNStack[StackPtr] = LC_WATCH_TRUE; - - StackPtr++; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { RPNStack[StackPtr] = LC_WATCH_ERROR; - - StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - - StackPtr++; } else { RPNStack[StackPtr] = LC_WATCH_FALSE; - - StackPtr++; } + + StackPtr++; + break; case LC_RPN_XOR: @@ -400,21 +390,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { RPNStack[StackPtr] = LC_WATCH_ERROR; - - StackPtr++; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { RPNStack[StackPtr] = LC_WATCH_STALE; - - StackPtr++; } else { RPNStack[StackPtr] = (Operand1 != Operand2); - - StackPtr++; } + + StackPtr++; + break; case LC_RPN_NOT: @@ -422,21 +409,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) if (Operand1 == LC_WATCH_ERROR) { RPNStack[StackPtr] = LC_WATCH_ERROR; - - StackPtr++; } else if (Operand1 == LC_WATCH_STALE) { RPNStack[StackPtr] = LC_WATCH_STALE; - - StackPtr++; } else { RPNStack[StackPtr] = (Operand1 == LC_WATCH_FALSE); - - StackPtr++; } + + StackPtr++; + break; case LC_RPN_EQUAL: From f061a323dc397169216336f7265fd6399afee929 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 6 Nov 2026 13:12:48 -0500 Subject: [PATCH 6/9] For nasa/lc#137, In LC_EvaulateRPN() in fsw/src/lc_action.c, renamed StackPtr and RPNEquationPtr to StackIdx and RPNEquationIdx, respectively --- fsw/src/lc_action.c | 68 ++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index ec010cc..455b690 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -288,27 +288,27 @@ void LC_SampleSingleAP(uint16 APNumber) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * StackPtr is an index into an array RPNStack (see LC_EvaluateRPN) + * StackIdx is an index into an array RPNStack (see LC_EvaluateRPN) * which contains values to be used in an RPN function. This macro - * validates the StackPtr to confirm that another operand is present + * validates the StackIdx to confirm that another operand is present * in the RPMStack array, then returns the next element. */ -#define POP_RPN_DATA ((StackPtr <= 0) ? (IllegalRPN = true) : (RPNStack[--StackPtr])) +#define POP_RPN_DATA ((StackIdx <= 0) ? (IllegalRPN = true) : (RPNStack[--StackIdx])) uint8 LC_EvaluateRPN(uint16 APNumber) { bool Done; bool IllegalRPN; bool IllegalOperand; uint8 EvalResult = LC_ACTION_ERROR; - int32 RPNEquationPtr; - int32 StackPtr; + int32 RPNEquationIdx; + int32 StackIdx; uint16 RPNData; uint16 RPNStack[LC_MAX_RPN_EQU_SIZE]; uint16 Operand1; uint16 Operand2; - StackPtr = 0; - RPNEquationPtr = 0; + StackIdx = 0; + RPNEquationIdx = 0; IllegalRPN = false; IllegalOperand = false; Done = false; @@ -322,9 +322,9 @@ uint8 LC_EvaluateRPN(uint16 APNumber) ** Pick off each piece of the RPN equation and handle ** one at a time */ - RPNData = LC_OperData.ADTPtr[APNumber].RPNEquation[RPNEquationPtr]; + RPNData = LC_OperData.ADTPtr[APNumber].RPNEquation[RPNEquationIdx]; - RPNEquationPtr++; + RPNEquationIdx++; /* ** The data is either an RPN operator or a watchpoint number @@ -341,22 +341,22 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_FALSE) || (Operand2 == LC_WATCH_FALSE)) { - RPNStack[StackPtr] = LC_WATCH_FALSE; + RPNStack[StackIdx] = LC_WATCH_FALSE; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr] = LC_WATCH_ERROR; + RPNStack[StackIdx] = LC_WATCH_ERROR; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr] = LC_WATCH_STALE; + RPNStack[StackIdx] = LC_WATCH_STALE; } else { - RPNStack[StackPtr] = LC_WATCH_TRUE; + RPNStack[StackIdx] = LC_WATCH_TRUE; } - StackPtr++; + StackIdx++; break; @@ -365,22 +365,22 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_TRUE) || (Operand2 == LC_WATCH_TRUE)) { - RPNStack[StackPtr] = LC_WATCH_TRUE; + RPNStack[StackIdx] = LC_WATCH_TRUE; } else if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr] = LC_WATCH_ERROR; + RPNStack[StackIdx] = LC_WATCH_ERROR; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr] = LC_WATCH_STALE; + RPNStack[StackIdx] = LC_WATCH_STALE; } else { - RPNStack[StackPtr] = LC_WATCH_FALSE; + RPNStack[StackIdx] = LC_WATCH_FALSE; } - StackPtr++; + StackIdx++; break; @@ -389,18 +389,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if ((Operand1 == LC_WATCH_ERROR) || (Operand2 == LC_WATCH_ERROR)) { - RPNStack[StackPtr] = LC_WATCH_ERROR; + RPNStack[StackIdx] = LC_WATCH_ERROR; } else if ((Operand1 == LC_WATCH_STALE) || (Operand2 == LC_WATCH_STALE)) { - RPNStack[StackPtr] = LC_WATCH_STALE; + RPNStack[StackIdx] = LC_WATCH_STALE; } else { - RPNStack[StackPtr] = (Operand1 != Operand2); + RPNStack[StackIdx] = (Operand1 != Operand2); } - StackPtr++; + StackIdx++; break; @@ -408,18 +408,18 @@ uint8 LC_EvaluateRPN(uint16 APNumber) Operand1 = POP_RPN_DATA; if (Operand1 == LC_WATCH_ERROR) { - RPNStack[StackPtr] = LC_WATCH_ERROR; + RPNStack[StackIdx] = LC_WATCH_ERROR; } else if (Operand1 == LC_WATCH_STALE) { - RPNStack[StackPtr] = LC_WATCH_STALE; + RPNStack[StackIdx] = LC_WATCH_STALE; } else { - RPNStack[StackPtr] = (Operand1 == LC_WATCH_FALSE); + RPNStack[StackIdx] = (Operand1 == LC_WATCH_FALSE); } - StackPtr++; + StackIdx++; break; @@ -429,7 +429,7 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { IllegalOperand = true; } - else if (StackPtr == 0) + else if (StackIdx == 0) { Done = true; } @@ -446,9 +446,9 @@ uint8 LC_EvaluateRPN(uint16 APNumber) default: if (RPNData < LC_MAX_WATCHPOINTS) { - RPNStack[StackPtr] = LC_OperData.WRTPtr[RPNData].WatchResult; + RPNStack[StackIdx] = LC_OperData.WRTPtr[RPNData].WatchResult; - StackPtr++; + StackIdx++; } else { @@ -463,7 +463,7 @@ uint8 LC_EvaluateRPN(uint16 APNumber) */ if ((Done == false) && (IllegalRPN == false) && (IllegalOperand == false)) { - if (RPNEquationPtr >= LC_MAX_RPN_EQU_SIZE) + if (RPNEquationIdx >= LC_MAX_RPN_EQU_SIZE) { IllegalRPN = true; } @@ -475,10 +475,10 @@ uint8 LC_EvaluateRPN(uint16 APNumber) { CFE_EVS_SendEvent(LC_INVALID_RPN_ERR_EID, CFE_EVS_EventType_ERROR, - "AP has illegal RPN expression: AP = %d, LastOperand = %d, StackPtr = %d", + "AP has illegal RPN expression: AP = %d, LastOperand = %d, StackIdx = %d", APNumber, - (int)(RPNEquationPtr - 1), - (int)StackPtr); + (int)(RPNEquationIdx - 1), + (int)StackIdx); EvalResult = LC_ACTION_ERROR; } From 8a87f64ef506806ed886711a97026e92146bf787 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 6 Nov 2026 13:19:36 -0500 Subject: [PATCH 7/9] For nasa/lc#137, Fixed unit-test/lc_action_tests.c because of renamed StackIdx variable --- unit-test/lc_action_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unit-test/lc_action_tests.c b/unit-test/lc_action_tests.c index 8aba324..506d398 100644 --- a/unit-test/lc_action_tests.c +++ b/unit-test/lc_action_tests.c @@ -1106,7 +1106,7 @@ void LC_EvaluateRPN_Test_DefaultIllegalRPN(void) snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "AP has illegal RPN expression: AP = %%d, LastOperand = %%d, StackPtr = %%d"); + "AP has illegal RPN expression: AP = %%d, LastOperand = %%d, StackIdx = %%d"); LC_OperData.ADTPtr[APNumber].RPNEquation[0] = LC_MAX_WATCHPOINTS; @@ -1135,7 +1135,7 @@ void LC_EvaluateRPN_Test_EndOfBufferWhenNotDone(void) snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "AP has illegal RPN expression: AP = %%d, LastOperand = %%d, StackPtr = %%d"); + "AP has illegal RPN expression: AP = %%d, LastOperand = %%d, StackIdx = %%d"); for (i = 0; i < (sizeof(LC_OperData.ADTPtr[0].RPNEquation) / sizeof(LC_OperData.ADTPtr[0].RPNEquation[0])); i++) { From ee124c1d6606ba055c3d5ffc2e045df2e1a7908a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 24 Nov 2026 13:25:26 -0500 Subject: [PATCH 8/9] Part nasa/cFS#1205, add snapshot workflow Local wrapper to call the reusable snapshot workflow --- .github/workflows/snapshot-module.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/snapshot-module.yml diff --git a/.github/workflows/snapshot-module.yml b/.github/workflows/snapshot-module.yml new file mode 100644 index 0000000..64d56b8 --- /dev/null +++ b/.github/workflows/snapshot-module.yml @@ -0,0 +1,35 @@ +name: Snapshot CFS module + +on: + workflow_dispatch: + inputs: + base-branch: + description: 'The base branch to merge into' + type: string + required: false + default: 'main' + ic-branch: + description: 'The temporary integration branch to create (ic)' + type: string + required: false + default: 'ic-snapshot-dev' + dev-branch: + description: 'The branch to pull in' + type: string + required: false + default: 'dev' + pr-label: + description: 'The label(s) to apply to the generated PR' + type: string + required: false + default: '' + +jobs: + snapshot-module: + name: Snapshot module + uses: nasa/cFS/.github/workflows/snapshot-module-reusable.yml@dev + with: + base-branch: ${{ inputs.base-branch }} + ic-branch: ${{ inputs.ic-branch }} + dev-branch: ${{ inputs.dev-branch }} + pr-label: ${{ inputs.pr-label }} From e3c83490b0bd9925166b1b03184a82cf9a43fcdf Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 30 Nov 2026 13:24:27 -0500 Subject: [PATCH 9/9] Part nasa/cFS#1205, add version update to snapshot Enhances the snapshot workflow with a version number update --- .github/workflows/snapshot-module.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/snapshot-module.yml b/.github/workflows/snapshot-module.yml index 64d56b8..260a7f8 100644 --- a/.github/workflows/snapshot-module.yml +++ b/.github/workflows/snapshot-module.yml @@ -23,6 +23,11 @@ on: type: string required: false default: '' + version-numbers: + description: 'The pending version/tag info, as a JSON object' + type: string + required: false + default: '{}' jobs: snapshot-module: @@ -33,3 +38,4 @@ jobs: ic-branch: ${{ inputs.ic-branch }} dev-branch: ${{ inputs.dev-branch }} pr-label: ${{ inputs.pr-label }} + version-numbers: ${{ inputs.version-numbers }}