Skip to content

Commit 843d824

Browse files
committed
lib: fix FLOAT_32 and FLOAT_64 type constants in ffi
1 parent 58a237b commit 843d824

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

doc/api/ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ These type names are also exposed as constants on `ffi.types`:
9696
* `ffi.types.UINT_32` = `'uint32'`
9797
* `ffi.types.INT_64` = `'int64'`
9898
* `ffi.types.UINT_64` = `'uint64'`
99-
* `ffi.types.FLOAT_32` = `'float32'`
100-
* `ffi.types.FLOAT_64` = `'float64'`
99+
* `ffi.types.FLOAT_32` = `'f32'`
100+
* `ffi.types.FLOAT_64` = `'f64'`
101101

102102
Pointer-like types (`pointer`, `string`, `buffer`, `arraybuffer`, and
103103
`function`) are all passed through the native layer as pointers.

lib/ffi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ const types = ObjectFreeze({
190190
UINT_32: 'uint32',
191191
INT_64: 'int64',
192192
UINT_64: 'uint64',
193-
FLOAT_32: 'float32',
194-
FLOAT_64: 'float64',
193+
FLOAT_32: 'f32',
194+
FLOAT_64: 'f64',
195195
});
196196

197197

test/ffi/test-ffi-module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ test('ffi.types exports canonical type constants', () => {
173173
UINT_32: 'uint32',
174174
INT_64: 'int64',
175175
UINT_64: 'uint64',
176-
FLOAT_32: 'float32',
177-
FLOAT_64: 'float64',
176+
FLOAT_32: 'f32',
177+
FLOAT_64: 'f64',
178178
};
179179

180180
assert.deepStrictEqual(ffi.types, expected);

0 commit comments

Comments
 (0)