mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Initialize some gnc_numerics that could be returned uninitialized.
Found by clang static analyzer.
This commit is contained in:
@@ -66,7 +66,7 @@ GncNumeric parse_amount_price (const std::string &str, int currency_format)
|
|||||||
std::string str_no_symbols = boost::u32regex_replace(str, expr, "");
|
std::string str_no_symbols = boost::u32regex_replace(str, expr, "");
|
||||||
|
|
||||||
/* Convert based on user chosen currency format */
|
/* Convert based on user chosen currency format */
|
||||||
gnc_numeric val;
|
gnc_numeric val = gnc_numeric_zero();
|
||||||
char *endptr;
|
char *endptr;
|
||||||
switch (currency_format)
|
switch (currency_format)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ GncNumeric parse_amount (const std::string &str, int currency_format)
|
|||||||
std::string str_no_symbols = boost::u32regex_replace(str, expr, "");
|
std::string str_no_symbols = boost::u32regex_replace(str, expr, "");
|
||||||
|
|
||||||
/* Convert based on user chosen currency format */
|
/* Convert based on user chosen currency format */
|
||||||
gnc_numeric val;
|
gnc_numeric val = gnc_numeric_zero();
|
||||||
char *endptr;
|
char *endptr;
|
||||||
switch (currency_format)
|
switch (currency_format)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ void
|
|||||||
gnc_entry_ledger_compute_value (GncEntryLedger *ledger,
|
gnc_entry_ledger_compute_value (GncEntryLedger *ledger,
|
||||||
gnc_numeric *value, gnc_numeric *tax_value)
|
gnc_numeric *value, gnc_numeric *tax_value)
|
||||||
{
|
{
|
||||||
gnc_numeric qty, price, discount;
|
gnc_numeric qty, price = gnc_numeric_zero(), discount = gnc_numeric_zero();
|
||||||
gint disc_type, disc_how;
|
gint disc_type, disc_how;
|
||||||
gboolean taxable, taxincluded;
|
gboolean taxable, taxincluded;
|
||||||
GncTaxTable *table;
|
GncTaxTable *table;
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ gnc_split_register_use_negative_color (VirtualLocation virt_loc,
|
|||||||
SplitRegister *reg)
|
SplitRegister *reg)
|
||||||
{
|
{
|
||||||
const char * cell_name;
|
const char * cell_name;
|
||||||
gnc_numeric value;
|
gnc_numeric value = gnc_numeric_zero();
|
||||||
Split *split;
|
Split *split;
|
||||||
|
|
||||||
if (!use_red_for_negative)
|
if (!use_red_for_negative)
|
||||||
|
|||||||
Reference in New Issue
Block a user