Skip to content

Commit

Permalink
corec: remove unused TYPE_TICK type
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Jan 2, 2025
1 parent 8bd467e commit cf70bd9
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 48 deletions.
4 changes: 0 additions & 4 deletions corec/corec/helpers/parser/parser2.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,6 @@ NOINLINE bool_t DataToString(tchar_t* Value, size_t ValueLen, const void* Data,
RGBToString(Value,ValueLen,*(rgbval_t*)Data);
break;

case TYPE_TICK:
TickToString(Value,ValueLen,*(tick_t*)Data);
break;

case TYPE_SIZE:
#if SIZE_MAX > INT32_MAX
Int64ToString(Value,ValueLen,*(size_t*)Data,0);
Expand Down
30 changes: 0 additions & 30 deletions corec/corec/helpers/parser/strtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,36 +128,6 @@ void RGBToString(tchar_t* Out, size_t OutLen, rgbval_t RGB)
Out[7] = 0;
}

void TickToString(tchar_t* Out, size_t OutLen, tick_t Tick)
{
tchar_t Sign[2] = {0};
if (Tick<0)
{
Sign[0] = '-';
Tick = -Tick;
}

int Hour,Min,Sec;
Tick += TICKSPERSEC/2000;
Hour = (int)(Tick / 3600 / TICKSPERSEC);
Tick -= Hour * 3600 * TICKSPERSEC;
Min = (int)(Tick / 60 / TICKSPERSEC);
Tick -= Min * 60 * TICKSPERSEC;
Sec = (int)(Tick / TICKSPERSEC);
Tick -= Sec * TICKSPERSEC;
if (!Hour && !Min)
stprintf_s(Out,OutLen,T("%s%d"),Sign,Sec);
else
{
if (Hour)
stprintf_s(Out,OutLen,T("%s%d:%02d"),Sign,Hour,Min);
else
stprintf_s(Out,OutLen,T("%s%d"),Sign,Min);
stcatprintf_s(Out,OutLen,T(":%02d"),Sec);
}
stcatprintf_s(Out,OutLen,T(".%03d"),(int)((Tick*1000)/TICKSPERSEC));
}

void SysTickToString(tchar_t* Out, size_t OutLen, systick_t Tick)
{
tchar_t Sign[2] = {0};
Expand Down
1 change: 0 additions & 1 deletion corec/corec/helpers/parser/strtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ NODE_DLL int StringToInt(const tchar_t* In, int Hex);
NODE_DLL int64_t StringToInt64(const tchar_t* In);
void IntToString(tchar_t* Out, size_t OutLen, int32_t Int, bool_t Hex);
void Int64ToString(tchar_t* Out, size_t OutLen, int64_t Int, bool_t Hex);
void TickToString(tchar_t* Out, size_t OutLen, tick_t Tick);
NODE_DLL void SysTickToString(tchar_t* Out, size_t OutLen, systick_t Tick);
void RGBToString(tchar_t* Out, size_t OutLen, rgbval_t RGB);
void GUIDToString(tchar_t* Out, size_t OutLen, const cc_guid*);
Expand Down
4 changes: 0 additions & 4 deletions corec/corec/node/corec.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ <h3>The possible types include:</h3>
<span class="variab"><span class="code">TYPE_FILEPOS</span></span>
<div class="definfo">a file position, with the type filepos_t.</div>
</div>
<div class="defblock">
<span class="variab"><span class="code">TYPE_TICK</span></span>
<div class="definfo">a tick value, with the type tick_t.</div>
</div>
<div class="defblock">
<span class="variab"><span class="code">TYPE_PTR</span></span>
<div class="definfo">a pointer, with the type void*.</div>
Expand Down
4 changes: 2 additions & 2 deletions corec/corec/node/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const uint16_t ParamSize[MAX_PARAMTYPE] =
sizeof(node*), //TYPE_NODE
0, //TYPE_META
sizeof(pin), //TYPE_PACKET
sizeof(tick_t), //TYPE_TICK
0, //TYPE_TICK
sizeof(nodenotify), //TYPE_NODENOTIFY
sizeof(void*), //TYPE_PTR
MAXDATA, //TYPE_BINARY
Expand Down Expand Up @@ -76,7 +76,7 @@ static const tchar_t* ParamName[MAX_PARAMTYPE] =
T("node"), //TYPE_NODE
NULL, //TYPE_META
T("packet"), //TYPE_PACKET
T("tick"), //TYPE_TICK
NULL, //TYPE_TICK
NULL, //TYPE_NODENOTIFY
T("pointer"), //TYPE_PTR
NULL, //TYPE_BINARY
Expand Down
6 changes: 3 additions & 3 deletions corec/corec/node/nodebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define TYPE_NODE 10 // node* (format1: node class)
#define TYPE_META 11
#define TYPE_PACKET 12 // flow packet pin
#define TYPE_TICK 13 // tick_t
#define TYPE_TICK 13
#define TYPE_NODENOTIFY 14 // nodenotify (private)
#define TYPE_PTR 15 // void*
#define TYPE_BINARY 16 // binary data (format1: size)
Expand Down Expand Up @@ -127,8 +127,8 @@ typedef struct datadef

#define META_PARAM_NAME 30 //const tchar_t*
#define META_PARAM_TYPE 31 //uint32_t (with flags)
#define META_PARAM_MIN 32 //int (for TYPE_INT or TYPE_TICK)
#define META_PARAM_MAX 33 //int (for TYPE_INT or TYPE_TICK)
#define META_PARAM_MIN 32 //int (for TYPE_INT)
#define META_PARAM_MAX 33 //int (for TYPE_INT)
#define META_PARAM_CLASS 34 //fourcc_t (for TYPE_NODE or TYPE_FOURCC)
#define META_PARAM_ENUMLANG 36 //fourcc_t (for TYPE_INT or TYPE_FOURCC)
#define META_PARAM_ENUMNAME 37 //const tchar_t* (for TYPE_INT or TYPE_FOURCC)
Expand Down
4 changes: 0 additions & 4 deletions corec/corec/portab.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@
#define IS_LITTLE_ENDIAN
#endif

#define TICKSPERSEC 16384
#define TIMEPERSEC (TICKSPERSEC>>4)

#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
Expand Down Expand Up @@ -191,7 +188,6 @@

typedef int_fast32_t err_t;
typedef int_fast32_t bool_t;
typedef int_fast32_t tick_t;
typedef uint8_t boolmem_t; /* unsigned so ":1" bitmode should work */
typedef uint32_t fourcc_t;
typedef uint32_t rgbval_t;
Expand Down

0 comments on commit cf70bd9

Please sign in to comment.