Skip to content

Commit

Permalink
corec: don't use a custom value for MAX_64
Browse files Browse the repository at this point in the history
We should use the values from the compiler.
  • Loading branch information
robUx4 committed Dec 27, 2024
1 parent dd369b3 commit 596ac24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions corec/corec/portab.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,6 @@ typedef uint64_t uint_fast64_t;
#define TPRIx64 PRIx64
#endif

#define MAX_INT64 LL(0x7fffffffffffffff)

#define MAX_TICK INT_MAX

typedef int_fast32_t err_t;
typedef int_fast32_t bool_t;
typedef int_fast32_t tick_t;
Expand Down Expand Up @@ -498,10 +494,10 @@ void * __alloca(size_t size);

#ifdef CONFIG_FILEPOS_64
typedef int_fast64_t filepos_t;
#define MAX_FILEPOS MAX_INT64
#define MAX_FILEPOS INT_FAST64_MAX
#else
typedef int_fast32_t filepos_t;
#define MAX_FILEPOS INT_MAX
#define MAX_FILEPOS INT_FAST32_MAX
#endif

#define INVALID_FILEPOS_T ((filepos_t)-1)
Expand Down
4 changes: 2 additions & 2 deletions corec/corec/str/str.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int get_integers(int64_t IntValue)
{
int Result = 0;
int64_t TmpVal = 1;
while (IntValue >= TmpVal && TmpVal < MAX_INT64/10)
while (IntValue >= TmpVal && TmpVal < INT64_MAX/10)
{
TmpVal *= 10;
Result++;
Expand All @@ -197,7 +197,7 @@ static int get_decimals(int Decimals, int64_t IntValue)
{
int Result = 0;
int64_t TmpVal = IntValue+1;
while (TmpVal < MAX_INT64/10)
while (TmpVal < INT64_MAX/10)
{
TmpVal *= 10;
Result++;
Expand Down
2 changes: 1 addition & 1 deletion libmatroska2/matroska2/matroska.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

MATROSKA_DLL err_t MATROSKA_Init(parsercontext *p);

#define INVALID_TIMESTAMP_T MAX_INT64
#define INVALID_TIMESTAMP_T INT64_MAX
typedef int64_t mkv_timestamp_t; // in nanoseconds

typedef struct matroska_block matroska_block;
Expand Down

0 comments on commit 596ac24

Please sign in to comment.