Skip to content

Commit

Permalink
corec: move EqFrac() where it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Dec 29, 2024
1 parent 8956e50 commit 3221f2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 9 additions & 0 deletions corec/corec/node/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,15 @@ const tchar_t *NodeContext_UnitName(datatype Unit)
return ParamFormat[Unit>>TUNIT_SHIFT];
}

static bool_t EqFrac(const cc_fraction* a, const cc_fraction* b)
{
if (a->Den == b->Den && a->Num == b->Num)
return 1;
if (!a->Den) return b->Den==0;
if (!b->Den) return 0;
return (int64_t)b->Den * a->Num == (int64_t)a->Den * b->Num;
}

static const tchar_t NullString[] = T("");

static NOINLINE bool_t EqData(datatype Type, const void* a, const void* b, size_t Size)
Expand Down
9 changes: 0 additions & 9 deletions corec/corec/node/nodetools.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,4 @@

//some helper functions

static INLINE bool_t EqFrac(const cc_fraction* a, const cc_fraction* b)
{
if (a->Den == b->Den && a->Num == b->Num)
return 1;
if (!a->Den) return b->Den==0;
if (!b->Den) return 0;
return (int64_t)b->Den * a->Num == (int64_t)a->Den * b->Num;
}

#endif

0 comments on commit 3221f2d

Please sign in to comment.