Commit 0ea9f7dd authored by Pavel Vainerman's avatar Pavel Vainerman

(vtconv): добавил F2r,I2r,U2r

parent fd93f6f5
......@@ -9,7 +9,7 @@ using namespace VTypes;
// --------------------------------------------------------------------------
static void print_help()
{
printf("Usage: vtconv TYPE[F2|F4|I2|U2] hex1 hex2 [hex3 hex4]\n");
printf("Usage: vtconv TYPE[F2|F2r|F4|I2|I2r|U2|U2r] hex1 hex2 [hex3 hex4]\n");
}
// --------------------------------------------------------------------------
int main( int argc, const char **argv )
......@@ -89,6 +89,13 @@ int main( int argc, const char **argv )
<< " v[1]=" << v[1]
<< " --> (float) " << (float)f << endl;
}
else if( !strcmp(type,"F2r") )
{
VTypes::F2r f(v,sizeof(v));
cout << "(F2r): v[0]=" << v[0]
<< " v[1]=" << v[1]
<< " --> (float) " << (float)f << endl;
}
else if( !strcmp(type,"F4") )
{
VTypes::F4 f(v,sizeof(v));
......@@ -105,6 +112,13 @@ int main( int argc, const char **argv )
<< " v[1]=" << v[1]
<< " --> (int) " << (int)i << endl;
}
else if( !strcmp(type,"I2r") )
{
VTypes::I2r i(v,sizeof(v));
cout << "(I2r): v[0]=" << v[0]
<< " v[1]=" << v[1]
<< " --> (int) " << (int)i << endl;
}
else if( !strcmp(type,"U2") )
{
VTypes::U2 i(v,sizeof(v));
......@@ -112,6 +126,13 @@ int main( int argc, const char **argv )
<< " v[1]=" << v[1]
<< " --> (unsigned int) " << (unsigned int)i << endl;
}
else if( !strcmp(type,"U2r") )
{
VTypes::U2r i(v,sizeof(v));
cout << "(U2r): v[0]=" << v[0]
<< " v[1]=" << v[1]
<< " --> (unsigned int) " << (unsigned int)i << endl;
}
else
{
cout << " Unknown type: " << type << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment