Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add const to WIDGET_CALLBACK context #3293

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/widget/widgbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ScrollBarWidget;
typedef void (*WIDGET_DISPLAY)(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

/* The optional user callback function */
typedef void (*WIDGET_CALLBACK)(WIDGET *psWidget, W_CONTEXT *psContext);
typedef void (*WIDGET_CALLBACK)(WIDGET *psWidget, const W_CONTEXT *psContext);
typedef void (*WIDGET_AUDIOCALLBACK)(int AudioID);

/* The optional "calc layout" callback function, to support runtime layout recalculation */
Expand Down
2 changes: 1 addition & 1 deletion src/intdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ static UWORD sliderMouseUnit(W_SLIDER *Slider)
return posStops;
}

void intUpdateQuantitySlider(WIDGET *psWidget, W_CONTEXT *psContext)
void intUpdateQuantitySlider(WIDGET *psWidget, const W_CONTEXT *psContext)
{
W_SLIDER *Slider = (W_SLIDER *)psWidget;

Expand Down
2 changes: 1 addition & 1 deletion src/intdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV, cons
/*Displays the proximity messages blips over the world*/
void intDisplayProximityBlips(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

void intUpdateQuantitySlider(WIDGET *psWidget, W_CONTEXT *psContext);
void intUpdateQuantitySlider(WIDGET *psWidget, const W_CONTEXT *psContext);

void intDisplayMissionClock(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

Expand Down
8 changes: 4 additions & 4 deletions src/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ static void saveMissionLimboData();
static void restoreMissionLimboData();
static void processMissionLimbo();

static void intUpdateMissionTimer(WIDGET *psWidget, W_CONTEXT *psContext);
static void intUpdateMissionTimer(WIDGET *psWidget, const W_CONTEXT *psContext);
static bool intAddMissionTimer();
static void intUpdateTransporterTimer(WIDGET *psWidget, W_CONTEXT *psContext);
static void intUpdateTransporterTimer(WIDGET *psWidget, const W_CONTEXT *psContext);
static void adjustMissionPower();
static void saveMissionPower();
static UDWORD getHomeLandingX();
Expand Down Expand Up @@ -1991,7 +1991,7 @@ static void fillTimeDisplay(W_LABEL &Label, UDWORD time, bool bHours)


//update function for the mission timer
void intUpdateMissionTimer(WIDGET *psWidget, W_CONTEXT *psContext)
void intUpdateMissionTimer(WIDGET *psWidget, const W_CONTEXT *psContext)
{
W_LABEL *Label = (W_LABEL *)psWidget;
UDWORD timeElapsed;
Expand Down Expand Up @@ -2078,7 +2078,7 @@ void intUpdateMissionTimer(WIDGET *psWidget, W_CONTEXT *psContext)
#define TRANSPORTER_REINFORCE_LEADIN 10*GAME_TICKS_PER_SEC

//update function for the transporter timer
void intUpdateTransporterTimer(WIDGET *psWidget, W_CONTEXT *psContext)
void intUpdateTransporterTimer(WIDGET *psWidget, const W_CONTEXT *psContext)
{
W_LABEL *Label = (W_LABEL *)psWidget;
DROID *psTransporter;
Expand Down
2 changes: 1 addition & 1 deletion src/transporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static void intSetTransCapacityLabel(W_LABEL &Label)
}

/*updates the capacity of the current Transporter*/
void intUpdateTransCapacity(WIDGET *psWidget, W_CONTEXT *psContext)
void intUpdateTransCapacity(WIDGET *psWidget, const W_CONTEXT *psContext)
{
W_LABEL *Label = (W_LABEL *)psWidget;

Expand Down
2 changes: 1 addition & 1 deletion src/transporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool launchTransporter(DROID *psTransporter);
have arrived - returns true when there*/
bool updateTransporter(DROID *psTransporter);

void intUpdateTransCapacity(WIDGET *psWidget, W_CONTEXT *psContext);
void intUpdateTransCapacity(WIDGET *psWidget, const W_CONTEXT *psContext);

/* Remove the Transporter Launch widget from the screen*/
void intRemoveTransporterLaunch();
Expand Down
Loading