mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-euro.cpp] convert to c++
This commit is contained in:
parent
80997ee5b4
commit
3bc7ce606d
@ -160,7 +160,7 @@ set (engine_SOURCES
|
||||
gnc-date.cpp
|
||||
gnc-datetime.cpp
|
||||
gnc-engine.cpp
|
||||
gnc-euro.c
|
||||
gnc-euro.cpp
|
||||
gnc-event.c
|
||||
gnc-features.cpp
|
||||
gnc-hooks.c
|
||||
|
@ -66,8 +66,8 @@ static gnc_euro_rate_struct gnc_euro_rates[] =
|
||||
static int
|
||||
gnc_euro_rate_compare (const void * key, const void * value)
|
||||
{
|
||||
const gnc_commodity * curr = key;
|
||||
const gnc_euro_rate_struct * euro = value;
|
||||
auto curr = static_cast<const gnc_commodity*>(key);
|
||||
auto euro = static_cast<const gnc_euro_rate_struct*>(value);
|
||||
|
||||
if (!key || !value)
|
||||
return -1;
|
||||
@ -102,11 +102,11 @@ gnc_is_euro_currency(const gnc_commodity * currency)
|
||||
if (!gnc_commodity_is_iso(currency))
|
||||
return FALSE;
|
||||
|
||||
result = bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
result = (gnc_euro_rate_struct*)bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
|
||||
if (result == NULL)
|
||||
return FALSE;
|
||||
@ -127,11 +127,11 @@ gnc_convert_to_euro(const gnc_commodity * currency, gnc_numeric value)
|
||||
if (!gnc_commodity_is_iso(currency))
|
||||
return gnc_numeric_zero ();
|
||||
|
||||
result = bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
result = (gnc_euro_rate_struct*)bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
|
||||
if (result == NULL)
|
||||
return gnc_numeric_zero ();
|
||||
@ -162,11 +162,11 @@ gnc_convert_from_euro(const gnc_commodity * currency, gnc_numeric value)
|
||||
if (!gnc_commodity_is_iso(currency))
|
||||
return gnc_numeric_zero ();
|
||||
|
||||
result = bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
result = (gnc_euro_rate_struct*)bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
|
||||
if (result == NULL)
|
||||
return gnc_numeric_zero ();
|
||||
@ -196,11 +196,11 @@ gnc_euro_currency_get_rate (const gnc_commodity *currency)
|
||||
if (!gnc_commodity_is_iso(currency))
|
||||
return gnc_numeric_zero ();
|
||||
|
||||
result = bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
result = (gnc_euro_rate_struct*)bsearch(currency,
|
||||
gnc_euro_rates,
|
||||
sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
|
||||
sizeof(gnc_euro_rate_struct),
|
||||
gnc_euro_rate_compare);
|
||||
|
||||
if (result == NULL)
|
||||
return gnc_numeric_zero ();
|
@ -640,7 +640,7 @@ libgnucash/engine/gnc-datetime.cpp
|
||||
libgnucash/engine/gncEmployee.c
|
||||
libgnucash/engine/gnc-engine.cpp
|
||||
libgnucash/engine/gncEntry.c
|
||||
libgnucash/engine/gnc-euro.c
|
||||
libgnucash/engine/gnc-euro.cpp
|
||||
libgnucash/engine/gnc-event.c
|
||||
libgnucash/engine/gnc-features.cpp
|
||||
libgnucash/engine/gnc-hooks.c
|
||||
|
Loading…
Reference in New Issue
Block a user