小调整

This commit is contained in:
godcreator 2024-01-30 23:07:08 +08:00
parent cae4d5d6ce
commit ae55f4b816
6 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ include_directories(${PROJECT_SOURCE_DIR}/FSM_OOP/baseFSM)
aux_source_directory(${PROJECT_SOURCE_DIR}/FSM_OOP/baseFSM SRC_FSM_OOP) aux_source_directory(${PROJECT_SOURCE_DIR}/FSM_OOP/baseFSM SRC_FSM_OOP)
# set(keytest 789) set(keytest 789)
# set(child_parent 789) # set(child_parent 789)
if(DEFINED keytest) if(DEFINED keytest)
include_directories(${PROJECT_SOURCE_DIR}/FSM_OOP/keytest) include_directories(${PROJECT_SOURCE_DIR}/FSM_OOP/keytest)

View File

@ -164,7 +164,7 @@ void *_preloadIn(FSM *pFSM){
return pFSM->privateVars.preloader.in; return pFSM->privateVars.preloader.in;
} }
void _setPreloaderReady(FSM *pFSM){ void _preloaderGetReady(FSM *pFSM){
pFSM->privateVars.preloader.isReady = 1; pFSM->privateVars.preloader.isReady = 1;
} }

View File

@ -7,7 +7,7 @@
typedef struct _FSM FSM; typedef struct _FSM FSM;
#define Step(pFSM) _vptrFSM((FSM *)pFSM)->step((FSM *)pFSM) #define Step(pFSM) _vptrFSM((FSM *)pFSM)->step((FSM *)pFSM)
#define SetPreloaderReady(pFSM) _setPreloaderReady((FSM *)pFSM); #define PreloaderGetReady(pFSM) _preloaderGetReady((FSM *)pFSM);
typedef struct _FSMHandler FSMHandler; typedef struct _FSMHandler FSMHandler;
@ -30,7 +30,7 @@ void registerChildFSM(FSM *parent, FSM *child, int index);
const void *getData(FSM* pFSM); const void *getData(FSM* pFSM);
void *_preloadIn(FSM *pFSM); void *_preloadIn(FSM *pFSM);
void _setPreloaderReady(FSM *pFSM); void _preloaderGetReady(FSM *pFSM);
FSMVtbl *_vptrFSM(FSM* pFSM); FSMVtbl *_vptrFSM(FSM* pFSM);

View File

@ -18,10 +18,10 @@ int main(){
for (int i = 0; i < 15; i++) for (int i = 0; i < 15; i++)
{ {
ParentFSM_Input(pFSM)->arrindex = i; ParentFSM_Input(pFSM)->arrindex = i;
SetPreloaderReady(pFSM); PreloaderGetReady(pFSM);
ChildFSM_Input(cFSM)->arrindex = i; ChildFSM_Input(cFSM)->arrindex = i;
SetPreloaderReady(cFSM); PreloaderGetReady(cFSM);
ChildFSMData* data = getData((FSM *)(cFSM)); ChildFSMData* data = getData((FSM *)(cFSM));
printf(" %d ", data->arrindex); printf(" %d ", data->arrindex);

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include "templateFSM.h" #include "keyFSM.h"
#include "FSM_public.h" #include "FSM_public.h"
#define NUM 60 #define NUM 60
@ -29,7 +29,7 @@ int main(){
const KeyFSMData* data = getData((FSM *)keyFSM); const KeyFSMData* data = getData((FSM *)keyFSM);
*KeyFSM_Input(keyFSM) = testin[i]; *KeyFSM_Input(keyFSM) = testin[i];
SetPreloaderReady(keyFSM); PreloaderGetReady(keyFSM);
Step(keyFSM); Step(keyFSM);
if(data->out){ if(data->out){

View File

@ -13,7 +13,7 @@ int main(){
for (int i = 0; i < 15; i++) for (int i = 0; i < 15; i++)
{ {
TemplateFSM_Input(pFSM)->arrindex = i; TemplateFSM_Input(pFSM)->arrindex = i;
SetPreloaderReady(pFSM); PreloaderGetReady(pFSM);
printf("%d," ,i); printf("%d," ,i);