git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a80dbd
)
dump out a warning if there's an overflow during matrix multiplication
author
kramm
<kramm>
Sat, 10 Sep 2005 12:30:01 +0000
(12:30 +0000)
committer
kramm
<kramm>
Sat, 10 Sep 2005 12:30:01 +0000
(12:30 +0000)
lib/modules/swftools.c
patch
|
blob
|
history
diff --git
a/lib/modules/swftools.c
b/lib/modules/swftools.c
index
5f16339
..
37c8e8b
100644
(file)
--- a/
lib/modules/swftools.c
+++ b/
lib/modules/swftools.c
@@
-26,8
+26,11
@@
#define S64 long long
SFIXED RFXSWF_SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2)
{ S64 a;
#define S64 long long
SFIXED RFXSWF_SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2)
{ S64 a;
- a = (S64)a1*(S64)b1+(S64)a2*(S64)b2;
- return (SFIXED)(a>>16);
+ a = ((S64)a1*(S64)b1+(S64)a2*(S64)b2)>>16;
+ SFIXED result = (SFIXED)(a);
+ if(a!=result)
+ fprintf(stderr, "Warning: overflow in matrix multiplication");
+ return result;
}
SFIXED RFXSWF_QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
{ S64 z = zaehler<<16;
}
SFIXED RFXSWF_QFIX(int zaehler,int nenner) // bildet Quotient von zwei INTs in SFIXED
{ S64 z = zaehler<<16;