Skip to content

Commit

Permalink
[gnc-lot.cpp] convert to cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Feb 9, 2024
1 parent 7d8d8f8 commit 03c5309
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libgnucash/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ set (engine_SOURCES
gnc-features.cpp
gnc-hooks.c
gnc-int128.cpp
gnc-lot.c
gnc-lot.cpp
gnc-numeric.cpp
gnc-option-date.cpp
gnc-option.cpp
Expand Down
14 changes: 7 additions & 7 deletions libgnucash/engine/gnc-lot.c → libgnucash/engine/gnc-lot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ gnc_lot_new (QofBook *book)
GNCLot *lot;
g_return_val_if_fail (book, NULL);

lot = g_object_new (GNC_TYPE_LOT, NULL);
lot = GNC_LOT(g_object_new (GNC_TYPE_LOT, NULL));
qof_instance_init_data(QOF_INSTANCE(lot), GNC_ID_LOT, book);
qof_event_gen (QOF_INSTANCE(lot), QOF_EVENT_CREATE, NULL);
return lot;
Expand All @@ -288,7 +288,7 @@ gnc_lot_free(GNCLot* lot)
priv = GET_PRIVATE(lot);
for (node = priv->splits; node; node = node->next)
{
Split *s = node->data;
Split *s = GNC_SPLIT(node->data);
s->lot = NULL;
}
g_list_free (priv->splits);
Expand Down Expand Up @@ -519,7 +519,7 @@ gnc_lot_get_balance (GNCLot *lot)
*/
for (node = priv->splits; node; node = node->next)
{
Split *s = node->data;
Split *s = GNC_SPLIT(node->data);
gnc_numeric amt = xaccSplitGetAmount (s);
baln = gnc_numeric_add_fixed (baln, amt);
g_assert (gnc_numeric_check (baln) == GNC_ERROR_OK);
Expand Down Expand Up @@ -568,7 +568,7 @@ gnc_lot_get_balance_before (const GNCLot *lot, const Split *split,
tb = xaccSplitGetParent (target);
for (node = priv->splits; node; node = node->next)
{
Split *s = node->data;
Split *s = GNC_SPLIT(node->data);
Split *source = xaccSplitGetGainsSourceSplit (s);
if (source == NULL)
source = s;
Expand Down Expand Up @@ -677,7 +677,7 @@ gnc_lot_get_earliest_split (GNCLot *lot)
priv = GET_PRIVATE(lot);
if (! priv->splits) return NULL;
priv->splits = g_list_sort (priv->splits, (GCompareFunc) xaccSplitOrderDateOnly);
return priv->splits->data;
return GNC_SPLIT(priv->splits->data);
}

/* Utility function, get latest split in lot */
Expand All @@ -695,7 +695,7 @@ gnc_lot_get_latest_split (GNCLot *lot)
for (node = priv->splits; node->next; node = node->next)
;

return node->data;
return GNC_SPLIT(node->data);
}

/* ============================================================= */
Expand Down Expand Up @@ -729,7 +729,7 @@ static QofObject gncLotDesc =
DI(.interface_version = ) QOF_OBJECT_VERSION,
DI(.e_type = ) GNC_ID_LOT,
DI(.type_label = ) "Lot",
DI(.create = ) (gpointer)gnc_lot_new,
DI(.create = ) (void* (*)(QofBook*))gnc_lot_new,
DI(.book_begin = ) NULL,
DI(.book_end = ) gnc_lot_book_end,
DI(.is_dirty = ) qof_collection_is_dirty,
Expand Down
2 changes: 1 addition & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ libgnucash/engine/gncIDSearch.c
libgnucash/engine/gnc-int128.cpp
libgnucash/engine/gncInvoice.c
libgnucash/engine/gncJob.c
libgnucash/engine/gnc-lot.c
libgnucash/engine/gnc-lot.cpp
libgnucash/engine/gnc-numeric.cpp
libgnucash/engine/gnc-option.cpp
libgnucash/engine/gnc-option-date.cpp
Expand Down

0 comments on commit 03c5309

Please sign in to comment.