updates function signatures to use int-casted enum

This commit is contained in:
Sam Hatchett
2023-01-19 09:50:50 -05:00
parent 9b3007ff55
commit 736f5ebdd4
4 changed files with 8 additions and 8 deletions

View File

@@ -159,7 +159,7 @@ extern "C" {
int DLLEXPORT ENgetresultindex(int type, int index, int *value); int DLLEXPORT ENgetresultindex(int type, int index, int *value);
int DLLEXPORT ENtimetonextevent(EN_TimestepEvent *eventType, long *duration, int *elementIndex); int DLLEXPORT ENtimetonextevent(int *eventType, long *duration, int *elementIndex);
/******************************************************************** /********************************************************************

View File

@@ -642,11 +642,11 @@ typedef struct Project *EN_Project;
/** /**
@brief Get information about upcoming time step events, and what causes them. @brief Get information about upcoming time step events, and what causes them.
@param ph an EPANET project handle. @param ph an EPANET project handle.
@param[out] eventType the type of event that will occur. @param[out] eventType the type of event that will occur (see @ref EN_TimestepEvent).
@param[out] duration the amount of time in the future this event will occur @param[out] duration the amount of time in the future this event will occur
@param[out] elementIndex the index of the element causing the event. @param[out] elementIndex the index of the element causing the event.
**/ **/
int DLLEXPORT EN_timetonextevent(EN_Project ph, EN_TimestepEvent *eventType, long *duration, int *elementIndex); int DLLEXPORT EN_timetonextevent(EN_Project ph, int *eventType, long *duration, int *elementIndex);
/** /**
@brief Retrieves the order in which a node or link appears in an @ref OutFile "output file". @brief Retrieves the order in which a node or link appears in an @ref OutFile "output file".

View File

@@ -1612,7 +1612,7 @@ int DLLEXPORT EN_settimeparam(EN_Project p, int param, long value)
/// get the time to next event, and give a reason for the time step truncation /// get the time to next event, and give a reason for the time step truncation
int DLLEXPORT EN_timetonextevent(EN_Project p, EN_TimestepEvent *eventType, long *duration, int *elementIndex) int DLLEXPORT EN_timetonextevent(EN_Project p, int *eventType, long *duration, int *elementIndex)
{ {
Times *time = &p->times; Times *time = &p->times;
long hydStep, tankStep, controlStep; long hydStep, tankStep, controlStep;
@@ -1626,17 +1626,17 @@ int DLLEXPORT EN_timetonextevent(EN_Project p, EN_TimestepEvent *eventType, lon
// return the lesser of the three step lengths // return the lesser of the three step lengths
if (controlStep < tankStep) { if (controlStep < tankStep) {
*eventType = EN_STEP_CONTROLEVENT; *eventType = (int)EN_STEP_CONTROLEVENT;
*duration = controlStep; *duration = controlStep;
*elementIndex = iControl; *elementIndex = iControl;
} }
else if (tankStep < hydStep) { else if (tankStep < hydStep) {
*eventType = EN_STEP_TANKEVENT; *eventType = (int)EN_STEP_TANKEVENT;
*duration = tankStep; *duration = tankStep;
*elementIndex = iTank; *elementIndex = iTank;
} }
else { else {
*eventType = EN_STEP_HYD; *eventType = (int)EN_STEP_HYD;
*duration = hydStep; *duration = hydStep;
*elementIndex = 0; *elementIndex = 0;
} }

View File

@@ -232,7 +232,7 @@ int DLLEXPORT ENgetresultindex(int type, int index, int *value)
return EN_getresultindex(_defaultProject, type, index, value); return EN_getresultindex(_defaultProject, type, index, value);
} }
int DLLEXPORT ENtimetonextevent(EN_TimestepEvent *eventType, long *duration, int *elementIndex) int DLLEXPORT ENtimetonextevent(int *eventType, long *duration, int *elementIndex)
{ {
return EN_timetonextevent(_defaultProject, eventType, duration, elementIndex); return EN_timetonextevent(_defaultProject, eventType, duration, elementIndex);
} }