mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[gamecode] Take care of failing uint conversion tests
By not doing the unrepresentable conversions, since they seem to be undefined behavior and even gcc 12 is inconsistent with them
This commit is contained in:
parent
95b8424ddf
commit
1e54799f69
2 changed files with 20 additions and 10 deletions
|
@ -4,10 +4,12 @@
|
|||
|
||||
static pr_ivec4_t uint_conv_init[] = {
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //int
|
||||
{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float 1e30, -1e30
|
||||
//XXX{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float 1e30, -1e30
|
||||
{ 0x3fc00000, 0xbfc00000, 0, 0}, //float
|
||||
{ 99, 0x80000000, 0x80000000, 99}, //long
|
||||
{ 256, 0, 0x7fffffff, 0}, //long
|
||||
{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
//XXX{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
{ 0, 0, 0, 0}, //double 1e30, -1e30
|
||||
{ 0, 0x3ff80000, 0, 0xbff80000}, //double 1.5, -1.5
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //uint
|
||||
{ ~0, 1, 0x80000000, 0}, //bool32
|
||||
|
@ -35,10 +37,12 @@ static pr_ivec4_t uint_conv_init[] = {
|
|||
*/
|
||||
static pr_ivec4_t uint_conv_expect[] = {
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //int
|
||||
{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float
|
||||
//XXX{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float
|
||||
{ 0x3fc00000, 0xbfc00000, 0, 0}, //float
|
||||
{ 99, 0x80000000, 0x80000000, 99}, //long
|
||||
{ 256, 0, 0x7fffffff, 0}, //long
|
||||
{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
//XXX{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
{ 0, 0, 0, 0}, //double 1e30, -1e30
|
||||
{ 0, 0x3ff80000, 0, 0xbff80000}, //double 1.5, -1.5
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //uint
|
||||
{ ~0, 1, 0x80000000, 0}, //bool32
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
|
||||
static pr_ivec4_t ulong_conv_init[] = {
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //int
|
||||
{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float 1e30, -1e30
|
||||
//XXX{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float 1e30, -1e30
|
||||
{ 0x3fc00000, 0xbfc00000, 0, 0}, //float 1e30, -1e30
|
||||
{ 99, 0x80000000, 0x80000000, 99}, //long
|
||||
{ 256, 0, 0x7fffffff, 0}, //long
|
||||
{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
//XXX{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
{ 0, 0, 0, 0}, //double 1e30, -1e30
|
||||
{ 0, 0x3ff80000, 0, 0xbff80000}, //double 1.5, -1.5
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //uint
|
||||
{ ~0, 1, 0x80000000, 0}, //bool32
|
||||
|
@ -41,10 +43,12 @@ static pr_ivec4_t ulong_conv_init[] = {
|
|||
*/
|
||||
static pr_ivec4_t ulong_conv_expect[] = {
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //int
|
||||
{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float
|
||||
//XXX{ 0x3fc00000, 0xbfc00000, 0x7149f2ca, 0xf149f2ca}, //float 1e30, -1e30
|
||||
{ 0x3fc00000, 0xbfc00000, 0, 0}, //float 1e30, -1e30
|
||||
{ 99, 0x80000000, 0x80000000, 99}, //long
|
||||
{ 256, 0, 0x7fffffff, 0}, //long
|
||||
{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
//XXX{ 0x39a08cea, 0x46293e59, 0x39a08cea, 0xc6293e59}, //double 1e30, -1e30
|
||||
{ 0, 0, 0, 0}, //double 1e30, -1e30
|
||||
{ 0, 0x3ff80000, 0, 0xbff80000}, //double 1.5, -1.5
|
||||
{ 5, -5, 0x80000000, 0x7fffffff}, //uint
|
||||
{ ~0, 1, 0x80000000, 0}, //bool32
|
||||
|
@ -55,10 +59,12 @@ static pr_ivec4_t ulong_conv_expect[] = {
|
|||
{ 5, 0, -5, 0xffffffff}, // int
|
||||
{ 0x80000000, 0xffffffff, 0x7fffffff, 0},
|
||||
{ 1, 0, -1, -1}, // float
|
||||
{ 0, 0, 0, 0x80000000}, // undef?
|
||||
//XXX{ 0, 0, 0, 0x80000000}, // undef?
|
||||
{ 0, 0, 0, 0}, // undef?
|
||||
{ 99, 0x80000000, 0x80000000, 99}, // long
|
||||
{ 256, 0, 0x7fffffff, 0},
|
||||
{ 0, 0, 0, 0x80000000}, // double undef?
|
||||
//XXX{ 0, 0, 0, 0x80000000}, // double undef?
|
||||
{ 0, 0, 0, 0}, // double undef?
|
||||
{ 1, 0, -1, -1},
|
||||
{ 5, 0, -5, 0}, // uint
|
||||
{ 0x80000000, 0, 0x7fffffff, 0},
|
||||
|
|
Loading…
Reference in a new issue