Skip to content

Commit

Permalink
SetMode() did not have paremeters defined in the prototype, causing c…
Browse files Browse the repository at this point in the history
…ompiler to give any warnings about parameter usage/binding, again causing random crashes in some use-cases.
  • Loading branch information
mywave82 committed Dec 15, 2024
1 parent 8e864fd commit a13f609
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions cpiface/cpiface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@ void cpiDrawGStrings (struct cpifaceSessionAPI_t *cpifaceSession)
void cpiResetScreen(void)
{
if (curmode)
curmode->SetMode();
curmode->SetMode(&cpifaceSessionAPI.Public);
}

static void cpiChangeMode(struct cpimoderegstruct *m)
Expand All @@ -2050,7 +2050,7 @@ static void cpiChangeMode(struct cpimoderegstruct *m)
}
}

curmode->SetMode();
curmode->SetMode(&cpifaceSessionAPI.Public);
}

void cpiGetMode(char *hand)
Expand Down Expand Up @@ -2409,7 +2409,7 @@ static void plmpOpenScreen (void)
curmode=&cpiModeText;
if (!curmode->Event (&cpifaceSessionAPI.Public, cpievOpen))
curmode=&cpiModeText;
curmode->SetMode();
curmode->SetMode(&cpifaceSessionAPI.Public);
}


Expand Down Expand Up @@ -2562,7 +2562,7 @@ static interfaceReturnEnum plmpDrawScreen(void)
plInKeyboardHelp = cpiKeyHelpDisplay();
if (!plInKeyboardHelp)
{
curmode->SetMode(); /* force complete redraw */
curmode->SetMode(&cpifaceSessionAPI.Public); /* force complete redraw */
} else {
framelock();
}
Expand Down Expand Up @@ -2627,7 +2627,7 @@ static interfaceReturnEnum plmpDrawScreen(void)
fsSetup();
plSetTextMode(fsScrType);
fsScrType=plScrType;
curmode->SetMode();
curmode->SetMode(&cpifaceSessionAPI.Public);
break;
#if 0
TODO plLoopPatterns
Expand Down
2 changes: 1 addition & 1 deletion cpiface/cpiface.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ extern int cpiKeyHelpDisplay(void); /* recall until it returns zero. This functi
struct cpimoderegstruct
{
char handle[9];
void (*SetMode)();
void (*SetMode)(struct cpifaceSessionAPI_t *cpifaceSession);
void (*Draw)(struct cpifaceSessionAPI_t *cpifaceSession);
int (*IProcessKey)(struct cpifaceSessionAPI_t *cpifaceSession, uint16_t);
int (*AProcessKey)(struct cpifaceSessionAPI_t *cpifaceSession, uint16_t);
Expand Down
2 changes: 1 addition & 1 deletion cpiface/cpifontdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int fontdebugIProcessKey (struct cpifaceSessionAPI_t *cpifaceSession, uin
return 1;
}

static void fontdebugSetMode(void)
static void fontdebugSetMode(struct cpifaceSessionAPI_t *cpifaceSession)
{
plSetTextMode(fsScrType);
fsScrType=plScrType;
Expand Down
2 changes: 1 addition & 1 deletion cpiface/cpikube.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static int wuerfelKey (struct cpifaceSessionAPI_t *cpifaceSession, uint16_t key)
return 0;
}

static void wuerfelSetMode(void)
static void wuerfelSetMode(struct cpifaceSessionAPI_t *cpifaceSession)
{
plLoadWuerfel();
plPrepareWuerfel();
Expand Down
2 changes: 1 addition & 1 deletion cpiface/cpilinks.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void hlpDraw (struct cpifaceSessionAPI_t *cpifaceSession)
plDisplayHelp (cpifaceSession);
}

static void hlpSetMode()
static void hlpSetMode(struct cpifaceSessionAPI_t *cpifaceSession)
{
cpiSetTextMode(fsScrType);
plWinHeight=plScrHeight-6;
Expand Down
2 changes: 1 addition & 1 deletion cpiface/cpimsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static void msgDraw (struct cpifaceSessionAPI_t *cpifaceSession)
plDisplayMessage (cpifaceSession);
}

static void msgSetMode(void)
static void msgSetMode(struct cpifaceSessionAPI_t *cpifaceSession)
{
cpiSetTextMode(0);
plWinFirstLine=6;
Expand Down

0 comments on commit a13f609

Please sign in to comment.