mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix broken windows build with latest MXE
Replaces some enums with names that do not clash with windows #defines. Specifically: ERROR -> ERRORED, PASCAL->PASCALS, IGNORE->IGNORED,FLOAT->FLOATVAL Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
This commit is contained in:
parent
193c456f06
commit
3c4fd5d599
9 changed files with 38 additions and 41 deletions
|
|
@ -26,7 +26,7 @@ public:
|
|||
FWUPDATE,
|
||||
CANCELLING,
|
||||
CANCELLED,
|
||||
ERROR,
|
||||
ERRORED,
|
||||
DONE,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3404,7 +3404,7 @@ void set_informational_units(const char *units)
|
|||
if (strstr(units, "PSI"))
|
||||
git_prefs.units.pressure = PSI;
|
||||
if (strstr(units, "PASCAL"))
|
||||
git_prefs.units.pressure = PASCAL;
|
||||
git_prefs.units.pressure = PASCALS;
|
||||
if (strstr(units, "CELSIUS"))
|
||||
git_prefs.units.temperature = CELSIUS;
|
||||
if (strstr(units, "FAHRENHEIT"))
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ static void divetags(char *buffer, struct tag_entry **tags)
|
|||
|
||||
enum number_type {
|
||||
NEITHER,
|
||||
FLOAT
|
||||
FLOATVAL
|
||||
};
|
||||
|
||||
static enum number_type parse_float(const char *buffer, double *res, const char **endp)
|
||||
|
|
@ -172,7 +172,7 @@ static enum number_type parse_float(const char *buffer, double *res, const char
|
|||
}
|
||||
|
||||
*res = val;
|
||||
return FLOAT;
|
||||
return FLOATVAL;
|
||||
}
|
||||
|
||||
union int_or_float {
|
||||
|
|
@ -191,12 +191,12 @@ static void pressure(char *buffer, pressure_t *pressure, struct parser_state *st
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
/* Just ignore zero values */
|
||||
if (!val.fp)
|
||||
break;
|
||||
switch (state->xml_parsing_units.pressure) {
|
||||
case PASCAL:
|
||||
case PASCALS:
|
||||
mbar = val.fp / 100;
|
||||
break;
|
||||
case BAR:
|
||||
|
|
@ -233,7 +233,7 @@ static void salinity(char *buffer, int *salinity)
|
|||
{
|
||||
union int_or_float val;
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
*salinity = lrint(val.fp * 10.0);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -246,7 +246,7 @@ static void depth(char *buffer, depth_t *depth, struct parser_state *state)
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
switch (state->xml_parsing_units.length) {
|
||||
case METERS:
|
||||
depth->mm = lrint(val.fp * 1000);
|
||||
|
|
@ -281,7 +281,7 @@ static void weight(char *buffer, weight_t *weight, struct parser_state *state)
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
switch (state->xml_parsing_units.weight) {
|
||||
case KG:
|
||||
weight->grams = lrint(val.fp * 1000);
|
||||
|
|
@ -301,7 +301,7 @@ static void temperature(char *buffer, temperature_t *temperature, struct parser_
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
switch (state->xml_parsing_units.temperature) {
|
||||
case KELVIN:
|
||||
temperature->mkelvin = lrint(val.fp * 1000);
|
||||
|
|
@ -383,7 +383,7 @@ static void percent(char *buffer, fraction_t *fraction)
|
|||
const char *end;
|
||||
|
||||
switch (parse_float(buffer, &val, &end)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
/* Turn fractions into percent unless explicit.. */
|
||||
if (val <= 1.0) {
|
||||
while (isspace(*end))
|
||||
|
|
@ -424,7 +424,7 @@ static void cylindersize(char *buffer, volume_t *volume)
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
volume->mliter = lrint(val.fp * 1000);
|
||||
break;
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ static void fahrenheit(char *buffer, temperature_t *temperature)
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
if (IS_FP_SAME(val.fp, 32.0))
|
||||
break;
|
||||
if (val.fp < 32.0)
|
||||
|
|
@ -638,7 +638,7 @@ static void psi_or_bar(char *buffer, pressure_t *pressure)
|
|||
union int_or_float val;
|
||||
|
||||
switch (integer_or_float(buffer, &val)) {
|
||||
case FLOAT:
|
||||
case FLOATVAL:
|
||||
if (val.fp > 400)
|
||||
pressure->mbar = psi_to_mbar(val.fp);
|
||||
else
|
||||
|
|
@ -1530,7 +1530,7 @@ static void uddf_importer(struct parser_state *state)
|
|||
{
|
||||
state->import_source = UDDF;
|
||||
state->xml_parsing_units = SI_units;
|
||||
state->xml_parsing_units.pressure = PASCAL;
|
||||
state->xml_parsing_units.pressure = PASCALS;
|
||||
state->xml_parsing_units.temperature = KELVIN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ int get_pressure_units(int mb, const char **units)
|
|||
const struct units *units_p = get_units();
|
||||
|
||||
switch (units_p->pressure) {
|
||||
case PASCAL:
|
||||
case PASCALS:
|
||||
pressure = mb * 100;
|
||||
unit = translate("gettextFromC", "pascal");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -271,9 +271,6 @@ static inline int32_t pressure_to_altitude(int32_t pressure) // pressure in mbar
|
|||
* keeps track of those units.
|
||||
*/
|
||||
/* turns out in Win32 PASCAL is defined as a calling convention */
|
||||
#ifdef WIN32
|
||||
#undef PASCAL
|
||||
#endif
|
||||
struct units {
|
||||
enum LENGTH {
|
||||
METERS,
|
||||
|
|
@ -286,7 +283,7 @@ struct units {
|
|||
enum PRESSURE {
|
||||
BAR,
|
||||
PSI,
|
||||
PASCAL
|
||||
PASCALS
|
||||
} pressure;
|
||||
enum TEMPERATURE {
|
||||
CELSIUS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue