aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js
diff options
context:
space:
mode:
authorPeter Wu2014-07-26 12:01:58 +0200
committerPim van den Berg2014-08-02 12:29:46 +0200
commitffeb9e7bfa9f7104f5e0860305a84598a8f3335f (patch)
treed4d484595ab5eb16a1f8d1f626e4d37c18f27220 /js
parentjsrrdgraph: document.write is for dinosaurs (diff)
downloadapt-panopticon_cgp-ffeb9e7bfa9f7104f5e0860305a84598a8f3335f.zip
apt-panopticon_cgp-ffeb9e7bfa9f7104f5e0860305a84598a8f3335f.tar.gz
apt-panopticon_cgp-ffeb9e7bfa9f7104f5e0860305a84598a8f3335f.tar.bz2
apt-panopticon_cgp-ffeb9e7bfa9f7104f5e0860305a84598a8f3335f.tar.xz
jsrrdgraph: Drop iDataOffset and iDataLength parameters
These parameters are not used in this library. Should it ever be necessary to process a slice of data, then the caller should do so.
Diffstat (limited to 'js')
-rw-r--r--js/binaryXHR.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/js/binaryXHR.js b/js/binaryXHR.js
index ef8478c..8ce4b0f 100644
--- a/js/binaryXHR.js
+++ b/js/binaryXHR.js
@@ -30,11 +30,9 @@ InvalidBinaryFile.prototype.toString = function() {
30// ===================================================================== 30// =====================================================================
31// BinaryFile class 31// BinaryFile class
32// Allows access to element inside a binary stream 32// Allows access to element inside a binary stream
33function BinaryFile(strData, iDataOffset, iDataLength) { 33function BinaryFile(data) {
34 "use strict"; 34 "use strict";
35 var data = strData; 35 var dataLength;
36 var dataOffset = iDataOffset || 0;
37 var dataLength = 0;
38 // added 36 // added
39 var doubleMantExpHi=Math.pow(2,-28); 37 var doubleMantExpHi=Math.pow(2,-28);
40 var doubleMantExpLo=Math.pow(2,-52); 38 var doubleMantExpLo=Math.pow(2,-52);
@@ -46,21 +44,21 @@ function BinaryFile(strData, iDataOffset, iDataLength) {
46 return data; 44 return data;
47 }; 45 };
48 46
49 if (typeof strData === "string") { 47 if (typeof data === "string") {
50 dataLength = iDataLength || data.length; 48 dataLength = data.length;
51 49
52 this.getByteAt = function(iOffset) { 50 this.getByteAt = function(iOffset) {
53 return data.charCodeAt(iOffset + dataOffset) & 0xFF; 51 return data.charCodeAt(iOffset) & 0xFF;
54 }; 52 };
55 } else if (typeof strData === "unknown") { 53 } else if (typeof data === "unknown") {
56 // Correct. "unknown" as type. MS JScript 8 added this. 54 // Correct. "unknown" as type. MS JScript 8 added this.
57 dataLength = iDataLength || IEBinary_getLength(data); 55 dataLength = IEBinary_getLength(data);
58 56
59 this.getByteAt = function(iOffset) { 57 this.getByteAt = function(iOffset) {
60 return IEBinary_getByteAt(data, iOffset + dataOffset); 58 return IEBinary_getByteAt(data, iOffset);
61 }; 59 };
62 } else { 60 } else {
63 throw new InvalidBinaryFile("Unsupported type " + (typeof strData)); 61 throw new InvalidBinaryFile("Unsupported type " + (typeof data));
64 } 62 }
65 63
66 if (switch_endian) { 64 if (switch_endian) {