git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added extra curlies and chopped away the unneccessary digits from the
[swftools.git]
/
src
/
swfc.c
diff --git
a/src/swfc.c
b/src/swfc.c
index
db12bd7
..
bdb631a
100644
(file)
--- a/
src/swfc.c
+++ b/
src/swfc.c
@@
-20,7
+20,7
@@
#include "../lib/rfxswf.h"
#include "../lib/log.h"
#include "../lib/args.h"
#include "../lib/rfxswf.h"
#include "../lib/log.h"
#include "../lib/args.h"
-#include "q.h"
+#include "../lib/q.h"
#include "parser.h"
#include "wav.h"
#include "parser.h"
#include "wav.h"
@@
-1051,11
+1051,18
@@
int parseInt(char*str)
}
int parseTwip(char*str)
{
}
int parseTwip(char*str)
{
- char*dot = strchr(str, '.');
+ char*dot;
+ int sign=1;
+ if(str[0]=='+' || str[0]=='-') {
+ if(str[0]=='-')
+ sign = -1;
+ str++;
+ }
+ dot = strchr(str, '.');
if(!dot) {
int l=strlen(str);
int t;
if(!dot) {
int l=strlen(str);
int t;
- return parseInt(str)*20;
+ return sign*parseInt(str)*20;
} else {
int l=strlen(++dot);
char*s;
} else {
int l=strlen(++dot);
char*s;
@@
-1072,11
+1079,11
@@
int parseTwip(char*str)
l=2;
}
if(l==0)
l=2;
}
if(l==0)
- return atoi(str)*20;
+ return sign*atoi(str)*20;
if(l==1)
if(l==1)
- return atoi(str)*20+atoi(dot)*2;
+ return sign*atoi(str)*20+atoi(dot)*2;
if(l==2)
if(l==2)
- return atoi(str)*20+atoi(dot)/5;
+ return sign*atoi(str)*20+atoi(dot)/5;
}
return 0;
}
}
return 0;
}