Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Business objects cpp #1985

Draft
wants to merge 17 commits into
base: stable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libgnucash/engine/gncEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ typedef struct _gncEntryClass GncEntryClass;

typedef enum
{
GNC_PAYMENT_NONE = 0,
GNC_PAYMENT_CASH = 1,
GNC_PAYMENT_CARD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as you increment by 1 you need only assign the first one, and 0 is the default so you can just add the 0 enum and skip the initializer, e.g.

typedef enum
{
    GNC_PAYMENT_NONE,
    GNC_PAYMENT_CASH,
    GNC_PAYMENT_CARD
} GncEntryPaymentType;

} GncEntryPaymentType;

typedef enum
{
GNC_DISC_DISABLED = 0,
GNC_DISC_PRETAX = 1,
GNC_DISC_SAMETIME,
GNC_DISC_POSTTAX
Expand Down
1 change: 1 addition & 0 deletions libgnucash/engine/gncTaxTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ typedef struct _gncTaxTableClass GncTaxTableClass;
*/
typedef enum
{
GNC_AMT_TYPE_DISABLED = 0, /** no tax */
GNC_AMT_TYPE_VALUE = 1, /**< tax is a number */
GNC_AMT_TYPE_PERCENT /**< tax is a percentage */
} GncAmountType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are remarkably useless comments.

Expand Down