Skip to content

Commit

Permalink
currency: avoid deprecated 'g_type_class_add_private'
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0w committed Jan 30, 2019
1 parent fc0720e commit 2c4aba1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/currency.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct CurrencyPrivate
MPNumber value;
};

G_DEFINE_TYPE (Currency, currency, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (Currency, currency, G_TYPE_OBJECT);


Currency *
Expand Down Expand Up @@ -85,12 +85,11 @@ currency_get_value(Currency *currency)
static void
currency_class_init(CurrencyClass *klass)
{
g_type_class_add_private(klass, sizeof(CurrencyPrivate));
}


static void
currency_init(Currency *currency)
{
currency->priv = G_TYPE_INSTANCE_GET_PRIVATE(currency, currency_get_type(), CurrencyPrivate);
currency->priv = currency_get_instance_private (currency);
}

0 comments on commit 2c4aba1

Please sign in to comment.