Comparing version 0.0.5 to 0.0.6
0.0.6 / 2012-05-09 | ||
================== | ||
- add `alignof` mappings for the types | ||
- add an `Object` type | ||
- set the `alignment` property on the built-in types | ||
0.0.5 / 2012-05-09 | ||
================== | ||
- quickly add get() and set() functions | ||
- use the `PRId64` and `PRIu64` snprintf types | ||
0.0.4 / 2012-05-08 | ||
@@ -3,0 +16,0 @@ ================== |
@@ -360,2 +360,12 @@ | ||
} | ||
exports.types.Object = { | ||
size: exports.sizeof.Object | ||
, indirection: 1 | ||
, get: function get (buf, offset) { | ||
return buf.readObject(offset || 0) | ||
} | ||
, set: function set (buf, offset, val) { | ||
return buf.writeObject(val, offset || 0) | ||
} | ||
} | ||
@@ -376,3 +386,10 @@ // "typedef"s for the variable-sized types | ||
// set the "alignment" property on the built-in types | ||
Object.keys(exports.alignof).forEach(function (name) { | ||
if (name === 'pointer') return | ||
exports.types[name].alignment = exports.alignof[name] | ||
assert(exports.types[name].alignment > 0) | ||
}) | ||
/** | ||
@@ -379,0 +396,0 @@ * NULL_POINTER is essentially: |
@@ -19,3 +19,3 @@ { "name": "ref" | ||
] | ||
, "version": "0.0.5" | ||
, "version": "0.0.6" | ||
, "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)" | ||
@@ -22,0 +22,0 @@ , "repository": { "type": "git", "url": "git://github.com/TooTallNate/ref.git" } |
@@ -176,2 +176,4 @@ ref | ||
setting a value to a buffer instance. | ||
* `alignment` - (optional) - Numer - The alignment of this type when placed in | ||
a struct | ||
@@ -178,0 +180,0 @@ For example, you could define a "bigint" type that dereferences into a |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52414
699
239