Browse Source

Dead code (Unmarshall2)

Fabian 3 years ago
parent
commit
5f86008338
1 changed files with 0 additions and 48 deletions
  1. 0 48
      lib/marshall.js

+ 0 - 48
lib/marshall.js

@@ -131,51 +131,3 @@ marshall.Unmarshall = function(typelist, struct, state) {
     state.offset = offset;
     return output;
 };
-
-
-// Extracts data from a byte aligned struct in memory to an array
-marshall.Unmarshall2 = function(typelist, GetByte) {
-    var output = [];
-    for (var i=0; i < typelist.length; i++) {
-        switch (typelist[i]) {
-            case "w":
-                var val = GetByte();
-                val += GetByte() << 8;
-                val += GetByte() << 16;
-                val += (GetByte() << 24) >>> 0;
-                output.push(val);
-                break;
-            case "d":
-                var val = GetByte();
-                val += GetByte() << 8;
-                val += GetByte() << 16;
-                val += (GetByte() << 24) >>> 0;
-                GetByte();GetByte();GetByte();GetByte();
-                output.push(val);
-                break;
-            case "h":
-                var val = GetByte();
-                output.push(val + (GetByte() << 8));
-                break;
-            case "b":
-                output.push(GetByte());
-                break;
-            case "s":
-                var len = GetByte();
-                len += GetByte() << 8;
-                var str = '';
-                var utf8converter = new UTF8StreamToUnicode();
-                for (var j=0; j < len; j++) {
-                    var c = utf8converter.Put(GetByte());
-                    if (c == -1) continue;
-                    str += String.fromCharCode(c);
-                }
-                output.push(str);
-                break;
-            default:
-                message.Debug("Error in Unmarshall2: Unknown type=" + typelist[i]);
-                break;
-        }
-    }
-    return output;
-};