Skip to content

Commit

Permalink
Add const to WIDGET_CALLBACK context
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jun 28, 2023
1 parent 6865061 commit 49a3ea2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
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

0 comments on commit 49a3ea2

Please sign in to comment.