Skip to content

Commit a14dd9b

Browse files
hansonrhansonr
authored andcommitted
just unnecessary long
1 parent 81628e6 commit a14dd9b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

sources/net.sf.j2s.java.core/src/javajs/util/VideoReader.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*/
2323
public class VideoReader {
24-
long pt = 0;
24+
int pt = 0;
2525
String blockType;
2626
int blockLen;
2727
byte[] buf = new byte[10];
@@ -81,7 +81,7 @@ public List<Map<String, Object>> getContents(boolean verbose) {
8181
}
8282

8383
protected void readBlock(List<Map<String, Object>> contents) throws IOException {
84-
long pt = this.pt;
84+
int pt = this.pt;
8585
blockLen = readInt();
8686
blockType = readString(4);
8787
if (verbose)
@@ -151,7 +151,7 @@ protected int readInner(int len, Map<String, Object> map) throws IOException {
151151
List<Map<String, Object>> list = new ArrayList<>();
152152
map.put("blocks", list);
153153
while (len > 0) {
154-
long p = pt;
154+
int p = pt;
155155
readBlock(list);
156156
len -= (pt - p);
157157
}
@@ -175,8 +175,8 @@ protected int readFTYP(int len, Map<String, Object> map) throws IOException {
175175

176176
protected int readMVHD(int len, Map<String, Object> map) throws IOException {
177177
map.put("version_flags", readInt());
178-
map.put("creationTime", readIntLong());
179-
map.put("modificationTime", readIntLong());
178+
map.put("creationTime", readUIntLong());
179+
map.put("modificationTime", readUIntLong());
180180
timeScale = readInt();
181181
int dur = readInt();
182182
map.put("timeScale", timeScale);
@@ -198,8 +198,8 @@ private void dumpMap(Map<String, Object> map, String name) {
198198

199199
protected int readTKHD(int len, Map<String, Object> map) throws IOException {
200200
map.put("version_flags", readInt());
201-
map.put("creationTime", readIntLong());
202-
map.put("modificationTime", readIntLong());
201+
map.put("creationTime", readUIntLong());
202+
map.put("modificationTime", readUIntLong());
203203
map.put("trackID", readInt());
204204
readInt(); // reserved
205205
int dur = readInt();
@@ -246,7 +246,7 @@ protected byte[] readBytes(int n) throws IOException {
246246
return buf;
247247
}
248248

249-
protected long readIntLong() throws IOException {
249+
protected long readUIntLong() throws IOException {
250250
pt += 4;
251251
return is.readInt() & 0xFFFFFFFFL;
252252
}

sources/net.sf.j2s.java.core/src/test/Test_Long.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ public abstract class Test_Long extends Test_ {
1414
static Long getLong(long l) {
1515
return Long.valueOf(l);
1616
}
17+
18+
static {
19+
long l = 1;
20+
for (int i = 1; i < 21; i++) {
21+
l *= i;
22+
System.out.println(i + "\t" + l + " " + (double) l);
23+
}
24+
}
25+
1726

1827
public static void main(String[] args) {
1928

0 commit comments

Comments
 (0)