]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Declared local functions in Dem static.
authorpete <devnull@localhost>
Thu, 27 May 2010 09:15:36 +0000 (11:15 +0200)
committerpete <devnull@localhost>
Thu, 27 May 2010 09:15:36 +0000 (11:15 +0200)
Refactoring.

diagnostic/Dem/Dem.c

index 5e6771f22654af8a817df6d60d0dee561e77f93e..694c992a084b72635d9d609fd882a22705b63730 100644 (file)
@@ -157,7 +157,7 @@ static ExtDataRecType               priMemExtDataBuffer[DEM_MAX_NUMBER_EXT_DATA_PRI_MEM] __at
  * Procedure:  zeroPriMemBuffers\r
  * Description:        Fill the primary buffers with zeroes\r
  */\r
-void zeroPriMemBuffers(void)\r
+void demZeroPriMemBuffers(void)\r
 {\r
        memset(priMemEventBuffer, 0, sizeof(priMemEventBuffer));\r
        memset(priMemFreezeFrameBuffer, 0, sizeof(priMemFreezeFrameBuffer));\r
@@ -169,7 +169,7 @@ void zeroPriMemBuffers(void)
  * Procedure:  calcChecksum\r
  * Description:        Calculate checksum over *data to *(data+nrOfBytes-1) area\r
  */\r
-ChecksumType calcChecksum(void *data, uint16 nrOfBytes)\r
+static ChecksumType calcChecksum(void *data, uint16 nrOfBytes)\r
 {\r
        uint16 i;\r
        uint8 *ptr = (uint8*)data;\r
@@ -187,7 +187,7 @@ ChecksumType calcChecksum(void *data, uint16 nrOfBytes)
  * Description:        Return TRUE if "dtcKind" match the events DTCKind or "dtcKind"\r
  *                             is "DEM_DTC_KIND_ALL_DTCS" otherwise FALSE.\r
  */\r
-boolean checkDtcKind(Dem_DTCKindType dtcKind, const Dem_EventParameterType *eventParam)\r
+static boolean checkDtcKind(Dem_DTCKindType dtcKind, const Dem_EventParameterType *eventParam)\r
 {\r
        boolean result = FALSE;\r
 \r
@@ -210,7 +210,7 @@ boolean checkDtcKind(Dem_DTCKindType dtcKind, const Dem_EventParameterType *even
  * Description:        Return TRUE if "dtc" match the events DTC or "dtc" is\r
  *                             "DEM_DTC_GROUP_ALL_DTCS" otherwise FALSE.\r
  */\r
-boolean checkDtcGroup(uint32 dtc, const Dem_EventParameterType *eventParam)\r
+static boolean checkDtcGroup(uint32 dtc, const Dem_EventParameterType *eventParam)\r
 {\r
        boolean result = FALSE;\r
 \r
@@ -232,7 +232,7 @@ boolean checkDtcGroup(uint32 dtc, const Dem_EventParameterType *eventParam)
  * Procedure:  checkDtcOrigin\r
  * Description:        Return TRUE if "dtcOrigin" match any of the events DTCOrigin otherwise FALSE.\r
  */\r
-boolean checkDtcOrigin(Dem_DTCOriginType dtcOrigin, const Dem_EventParameterType *eventParam)\r
+static boolean checkDtcOrigin(Dem_DTCOriginType dtcOrigin, const Dem_EventParameterType *eventParam)\r
 {\r
        boolean result = FALSE;\r
        uint16 i;\r
@@ -251,7 +251,7 @@ boolean checkDtcOrigin(Dem_DTCOriginType dtcOrigin, const Dem_EventParameterType
  * Procedure:  checkDtcSeverityMask\r
  * Description:        Return TRUE if "dtcSeverityMask" match any of the events DTC severity otherwise FALSE.\r
  */\r
-boolean checkDtcSeverityMask(Dem_DTCSeverityType dtcSeverityMask, const Dem_EventParameterType *eventParam)\r
+static boolean checkDtcSeverityMask(Dem_DTCSeverityType dtcSeverityMask, const Dem_EventParameterType *eventParam)\r
 {\r
        boolean result = TRUE;\r
 \r
@@ -265,7 +265,7 @@ boolean checkDtcSeverityMask(Dem_DTCSeverityType dtcSeverityMask, const Dem_Even
  * Procedure:  checkDtcFaultDetectionCounterMask\r
  * Description:        TBD.\r
  */\r
-boolean checkDtcFaultDetectionCounter(const Dem_EventParameterType *eventParam)\r
+static boolean checkDtcFaultDetectionCounter(const Dem_EventParameterType *eventParam)\r
 {\r
        boolean result = TRUE;\r
 \r
@@ -280,7 +280,7 @@ boolean checkDtcFaultDetectionCounter(const Dem_EventParameterType *eventParam)
  * Description:        Returns the pointer to event id parameters of "eventId" in "*eventStatusBuffer",\r
  *                             if not found NULL is returned.\r
  */\r
-void lookupEventStatusRec(Dem_EventIdType eventId, EventStatusRecType **const eventStatusRec)\r
+static void lookupEventStatusRec(Dem_EventIdType eventId, EventStatusRecType **const eventStatusRec)\r
 {\r
        EventStatusRecType *eventStatusRecPtr = eventStatusBuffer;\r
 \r
@@ -301,7 +301,7 @@ void lookupEventStatusRec(Dem_EventIdType eventId, EventStatusRecType **const ev
  * Description:        Returns the pointer to event id parameters of "eventId" in "*eventIdParam",\r
  *                             if not found NULL is returned.\r
  */\r
-void lookupEventIdParameter(Dem_EventIdType eventId, const Dem_EventParameterType **const eventIdParam)\r
+static void lookupEventIdParameter(Dem_EventIdType eventId, const Dem_EventParameterType **const eventIdParam)\r
 {\r
        const Dem_EventParameterType *EventIdParamPtr = configSet->EventParameter;\r
 \r
@@ -319,10 +319,10 @@ void lookupEventIdParameter(Dem_EventIdType eventId, const Dem_EventParameterTyp
 \r
 \r
 /*\r
- * Procedure:  PreDebounceNone\r
+ * Procedure:  preDebounceNone\r
  * Description:        Returns the result of the debouncing.\r
  */\r
-Dem_EventStatusType PreDebounceNone(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
+static Dem_EventStatusType preDebounceNone(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
        Dem_EventStatusType returnCode;\r
 \r
        switch (reportedStatus) {\r
@@ -345,10 +345,10 @@ Dem_EventStatusType PreDebounceNone(Dem_EventStatusType reportedStatus, EventSta
 \r
 \r
 /*\r
- * Procedure:  PreDebounceCounterBased\r
+ * Procedure:  preDebounceCounterBased\r
  * Description:        Returns the result of the debouncing.\r
  */\r
-Dem_EventStatusType PreDebounceCounterBased(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
+static Dem_EventStatusType preDebounceCounterBased(Dem_EventStatusType reportedStatus, EventStatusRecType* statusRecord) {\r
        Dem_EventStatusType returnCode;\r
        const Dem_PreDebounceCounterBasedType* pdVars = statusRecord->eventParamRef->EventClass->PreDebounceAlgorithmClass->PreDebounceAlgorithm.PreDebounceCounterBased;\r
 \r
@@ -420,7 +420,7 @@ Dem_EventStatusType PreDebounceCounterBased(Dem_EventStatusType reportedStatus,
  * Description:        Update the status of "eventId", if not exist and "createIfNotExist" is\r
  *                             true a new record is created\r
  */\r
-void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventStatusType eventStatus, boolean createIfNotExist, EventStatusRecType *eventStatusRec)\r
+static void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventStatusType eventStatus, boolean createIfNotExist, EventStatusRecType *eventStatusRec)\r
 {\r
        EventStatusRecType *eventStatusRecPtr;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -454,11 +454,11 @@ void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventSta
                // Handle debouncing\r
                switch (eventParam->EventClass->PreDebounceAlgorithmClass->PreDebounceName) {\r
                case DEM_NO_PRE_DEBOUNCE:\r
-                       eventStatus = PreDebounceNone(eventStatus, eventStatusRecPtr);\r
+                       eventStatus = preDebounceNone(eventStatus, eventStatusRecPtr);\r
                        break;\r
 \r
                case DEM_PRE_DEBOUNCE_COUNTER_BASED:\r
-                       eventStatus = PreDebounceCounterBased(eventStatus, eventStatusRecPtr);\r
+                       eventStatus = preDebounceCounterBased(eventStatus, eventStatusRecPtr);\r
                        break;\r
 \r
                default:\r
@@ -511,7 +511,7 @@ void updateEventStatusRec(const Dem_EventParameterType *eventParam, Dem_EventSta
  * Procedure:  mergeEventStatusRec\r
  * Description:        Update the occurrence counter of status, if not exist a new record is created\r
  */\r
-void mergeEventStatusRec(EventRecType *eventRec)\r
+static void mergeEventStatusRec(EventRecType *eventRec)\r
 {\r
        EventStatusRecType *eventStatusRecPtr;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -553,7 +553,7 @@ void mergeEventStatusRec(EventRecType *eventRec)
  * Procedure:  deleteEventStatusRec\r
  * Description:        Delete the status record of "eventParam->eventId" from "eventStatusBuffer".\r
  */\r
-void deleteEventStatusRec(const Dem_EventParameterType *eventParam)\r
+static void deleteEventStatusRec(const Dem_EventParameterType *eventParam)\r
 {\r
        EventStatusRecType *eventStatusRecPtr;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -574,7 +574,7 @@ void deleteEventStatusRec(const Dem_EventParameterType *eventParam)
  * Procedure:  getEventStatusRec\r
  * Description:        Returns the status record of "eventId" in "eventStatusRec"\r
  */\r
-void getEventStatusRec(Dem_EventIdType eventId, EventStatusRecType *eventStatusRec)\r
+static void getEventStatusRec(Dem_EventIdType eventId, EventStatusRecType *eventStatusRec)\r
 {\r
        EventStatusRecType *eventStatusRecPtr;\r
 \r
@@ -596,7 +596,7 @@ void getEventStatusRec(Dem_EventIdType eventId, EventStatusRecType *eventStatusR
  * Description:        Returns TRUE if the DTC was found and "eventStatusRec" points\r
  *                             to the event record found.\r
  */\r
-boolean lookupDtcEvent(uint32 dtc, EventStatusRecType **eventStatusRec)\r
+static boolean lookupDtcEvent(uint32 dtc, EventStatusRecType **eventStatusRec)\r
 {\r
        boolean dtcFound = FALSE;\r
        uint16 i;\r
@@ -625,7 +625,7 @@ boolean lookupDtcEvent(uint32 dtc, EventStatusRecType **eventStatusRec)
  * Description:        Returns TRUE if the event pointed by "event" fulfill\r
  *                             the "dtcFilter" global filter settings.\r
  */\r
-boolean matchEventWithDtcFilter(const EventStatusRecType *eventRec)\r
+static boolean matchEventWithDtcFilter(const EventStatusRecType *eventRec)\r
 {\r
        boolean dtcMatch = FALSE;\r
 \r
@@ -658,20 +658,20 @@ boolean matchEventWithDtcFilter(const EventStatusRecType *eventRec)
 }\r
 \r
 \r
-void getFreezeFrameData(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
+static void getFreezeFrameData(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
 {\r
        // TODO: Fill out\r
        freezeFrame->eventId = DEM_EVENT_ID_NULL;       // Not supported yet\r
 }\r
 \r
 \r
-void storeFreezeFrameDataPreInit(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
+static void storeFreezeFrameDataPreInit(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
 {\r
        // TODO: Fill out\r
 }\r
 \r
 \r
-void updateFreezeFrameOccurrencePreInit(EventRecType *EventBuffer)\r
+static void updateFreezeFrameOccurrencePreInit(EventRecType *EventBuffer)\r
 {\r
        // TODO: Fill out\r
 }\r
@@ -682,7 +682,7 @@ void updateFreezeFrameOccurrencePreInit(EventRecType *EventBuffer)
  * Description:        Collects the extended data according to "eventParam" and return it in "extData",\r
  *                             if not found eventId is set to DEM_EVENT_ID_NULL.\r
  */\r
-void getExtendedData(const Dem_EventParameterType *eventParam, ExtDataRecType *extData)\r
+static void getExtendedData(const Dem_EventParameterType *eventParam, ExtDataRecType *extData)\r
 {\r
        Std_ReturnType callbackReturnCode;\r
        uint16 i;\r
@@ -734,7 +734,7 @@ void getExtendedData(const Dem_EventParameterType *eventParam, ExtDataRecType *e
  * Description:        Store the extended data pointed by "extendedData" to the "preInitExtDataBuffer",\r
  *                             if non existent a new entry is created.\r
  */\r
-void storeExtendedDataPreInit(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
+static void storeExtendedDataPreInit(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
 {\r
        uint16 i;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -770,7 +770,7 @@ void storeExtendedDataPreInit(const Dem_EventParameterType *eventParam, ExtDataR
  * Description:        Store the event data of "eventStatus->eventId" in "priMemEventBuffer",\r
  *                             if non existent a new entry is created.\r
  */\r
-void storeEventPriMem(const Dem_EventParameterType *eventParam, EventStatusRecType *eventStatus)\r
+static void storeEventPriMem(const Dem_EventParameterType *eventParam, EventStatusRecType *eventStatus)\r
 {\r
        uint16 i;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -809,7 +809,7 @@ void storeEventPriMem(const Dem_EventParameterType *eventParam, EventStatusRecTy
  * Procedure:  deleteEventPriMem\r
  * Description:        Delete the event data of "eventParam->eventId" from "priMemEventBuffer".\r
  */\r
-void deleteEventPriMem(const Dem_EventParameterType *eventParam)\r
+static void deleteEventPriMem(const Dem_EventParameterType *eventParam)\r
 {\r
        uint16 i;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -832,7 +832,7 @@ void deleteEventPriMem(const Dem_EventParameterType *eventParam)
  * Description:        Store the event data of "eventStatus->eventId" in event memory according to\r
  *                             "eventParam" destination option.\r
  */\r
-void storeEventEvtMem(const Dem_EventParameterType *eventParam, EventStatusRecType *eventStatus)\r
+static void storeEventEvtMem(const Dem_EventParameterType *eventParam, EventStatusRecType *eventStatus)\r
 {\r
        uint16 i;\r
 \r
@@ -863,7 +863,7 @@ void storeEventEvtMem(const Dem_EventParameterType *eventParam, EventStatusRecTy
  * Description:        Store the extended data pointed by "extendedData" to the "priMemExtDataBuffer",\r
  *                             if non existent a new entry is created.\r
  */\r
-void storeExtendedDataPriMem(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
+static void storeExtendedDataPriMem(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
 {\r
        uint16 i;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -897,7 +897,7 @@ void storeExtendedDataPriMem(const Dem_EventParameterType *eventParam, ExtDataRe
  * Procedure:  deleteExtendedDataPriMem\r
  * Description:        Delete the extended data of "eventParam->eventId" from "priMemExtDataBuffer".\r
  */\r
-void deleteExtendedDataPriMem(const Dem_EventParameterType *eventParam)\r
+static void deleteExtendedDataPriMem(const Dem_EventParameterType *eventParam)\r
 {\r
        uint16 i;\r
        imask_t state = McuE_EnterCriticalSection();\r
@@ -919,7 +919,7 @@ void deleteExtendedDataPriMem(const Dem_EventParameterType *eventParam)
  * Description:        Store the extended data in event memory according to\r
  *                             "eventParam" destination option\r
  */\r
-void storeExtendedDataEvtMem(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
+static void storeExtendedDataEvtMem(const Dem_EventParameterType *eventParam, ExtDataRecType *extendedData)\r
 {\r
        uint16 i;\r
 \r
@@ -951,7 +951,7 @@ void storeExtendedDataEvtMem(const Dem_EventParameterType *eventParam, ExtDataRe
  * Description:        Returns TRUE if the requested extended data number was found among the configured records for the event.\r
  *                             "extDataRecClassPtr" returns a pointer to the record class, "posInExtData" returns the position in stored extended data.\r
  */\r
-boolean lookupExtendedDataRecNumParam(uint8 extendedDataNumber, const Dem_EventParameterType *eventParam, Dem_ExtendedDataRecordClassType const **extDataRecClassPtr, uint8 *posInExtData)\r
+static boolean lookupExtendedDataRecNumParam(uint8 extendedDataNumber, const Dem_EventParameterType *eventParam, Dem_ExtendedDataRecordClassType const **extDataRecClassPtr, uint8 *posInExtData)\r
 {\r
        boolean recNumFound = FALSE;\r
 \r
@@ -979,7 +979,7 @@ boolean lookupExtendedDataRecNumParam(uint8 extendedDataNumber, const Dem_EventP
  * Procedure:  lookupExtendedDataPriMem\r
  * Description: Returns TRUE if the requested event id is found, "extData" points to the found data.\r
  */\r
-boolean lookupExtendedDataPriMem(Dem_EventIdType eventId, ExtDataRecType **extData)\r
+static boolean lookupExtendedDataPriMem(Dem_EventIdType eventId, ExtDataRecType **extData)\r
 {\r
        boolean eventIdFound = FALSE;\r
        uint16 i;\r
@@ -997,13 +997,13 @@ boolean lookupExtendedDataPriMem(Dem_EventIdType eventId, ExtDataRecType **extDa
 }\r
 \r
 \r
-void storeFreezeFrameDataPriMem(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
+static void storeFreezeFrameDataPriMem(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
 {\r
        // TODO: Fill out\r
 }\r
 \r
 \r
-void deleteFreezeFrameDataPriMem(const Dem_EventParameterType *eventParam)\r
+static void deleteFreezeFrameDataPriMem(const Dem_EventParameterType *eventParam)\r
 {\r
        // TODO: Fill out\r
 }\r
@@ -1014,7 +1014,7 @@ void deleteFreezeFrameDataPriMem(const Dem_EventParameterType *eventParam)
  * Description:        Store the freeze frame data in event memory according to\r
  *                             "eventParam" destination option\r
  */\r
-void storeFreezeFrameDataEvtMem(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
+static void storeFreezeFrameDataEvtMem(const Dem_EventParameterType *eventParam, FreezeFrameRecType *freezeFrame)\r
 {\r
        uint16 i;\r
 \r
@@ -1045,7 +1045,7 @@ void storeFreezeFrameDataEvtMem(const Dem_EventParameterType *eventParam, Freeze
  * Description:        Handle the updating of event status and storing of\r
  *                             event related data in preInit buffers.\r
  */\r
-void handlePreInitEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus)\r
+static void handlePreInitEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus)\r
 {\r
        const Dem_EventParameterType *eventParam;\r
        EventStatusRecType eventStatusLocal;\r
@@ -1103,7 +1103,7 @@ void handlePreInitEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus
  * Description:        Handle the updating of event status and storing of\r
  *                             event related data in event memory.\r
  */\r
-Std_ReturnType handleEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus)\r
+static Std_ReturnType handleEvent(Dem_EventIdType eventId, Dem_EventStatusType eventStatus)\r
 {\r
        Std_ReturnType returnCode = E_OK;\r
        const Dem_EventParameterType *eventParam;\r
@@ -1160,7 +1160,7 @@ Std_ReturnType handleEvent(Dem_EventIdType eventId, Dem_EventStatusType eventSta
  * Procedure:  resetEventStatus\r
  * Description:        Resets the events status of eventId.\r
  */\r
-void resetEventStatus(Dem_EventIdType eventId)\r
+static void resetEventStatus(Dem_EventIdType eventId)\r
 {\r
        imask_t state = McuE_EnterCriticalSection();\r
        EventStatusRecType *eventStatusRecPtr;\r
@@ -1178,7 +1178,7 @@ void resetEventStatus(Dem_EventIdType eventId)
  * Procedure:  getEventStatus\r
  * Description:        Returns the extended event status bitmask of eventId in "eventStatusExtended".\r
  */\r
-void getEventStatus(Dem_EventIdType eventId, Dem_EventStatusExtendedType *eventStatusExtended)\r
+static void getEventStatus(Dem_EventIdType eventId, Dem_EventStatusExtendedType *eventStatusExtended)\r
 {\r
        EventStatusRecType eventStatusLocal;\r
 \r
@@ -1198,7 +1198,7 @@ void getEventStatus(Dem_EventIdType eventId, Dem_EventStatusExtendedType *eventS
  * Procedure:  getEventFailed\r
  * Description:        Returns the TRUE or FALSE of "eventId" in "eventFailed" depending on current status.\r
  */\r
-void getEventFailed(Dem_EventIdType eventId, boolean *eventFailed)\r
+static void getEventFailed(Dem_EventIdType eventId, boolean *eventFailed)\r
 {\r
        EventStatusRecType eventStatusLocal;\r
 \r
@@ -1224,7 +1224,7 @@ void getEventFailed(Dem_EventIdType eventId, boolean *eventFailed)
  * Description:        Returns the TRUE or FALSE of "eventId" in "eventTested" depending on\r
  *                             current status the "test not completed this operation cycle" bit.\r
  */\r
-void getEventTested(Dem_EventIdType eventId, boolean *eventTested)\r
+static void getEventTested(Dem_EventIdType eventId, boolean *eventTested)\r
 {\r
        EventStatusRecType eventStatusLocal;\r
 \r
@@ -1250,7 +1250,7 @@ void getEventTested(Dem_EventIdType eventId, boolean *eventTested)
  * Description:        Returns pre debounce counter of "eventId" in "counter" and return value E_OK if\r
  *                             the counter was available else E_NOT_OK.\r
  */\r
-Std_ReturnType getFaultDetectionCounter(Dem_EventIdType eventId, sint8 *counter)\r
+static Std_ReturnType getFaultDetectionCounter(Dem_EventIdType eventId, sint8 *counter)\r
 {\r
        Std_ReturnType returnCode = E_NOT_OK;\r
        const Dem_EventParameterType *eventParam;\r
@@ -1308,7 +1308,7 @@ Std_ReturnType getFaultDetectionCounter(Dem_EventIdType eventId, sint8 *counter)
  *                             event connected to this cycle id.\r
  *                             Returns E_OK if operation was successful else E_NOT_OK.\r
  */\r
-Std_ReturnType setOperationCycleState(Dem_OperationCycleIdType operationCycleId, Dem_OperationCycleStateType cycleState)\r
+static Std_ReturnType setOperationCycleState(Dem_OperationCycleIdType operationCycleId, Dem_OperationCycleStateType cycleState)\r
 {\r
        uint16 i;\r
        Std_ReturnType returnCode = E_OK;\r