Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c9e8447

Browse files
committed
lcb: Minor cleanup
This patch cleans up a number of minor things in the patch. Including: - ensuring the java type definitions use machine types, and not C types - using the correct int for the bind to MCDataCreateWithBytes - adding some missing new types to the docs
1 parent c620b66 commit c9e8447

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

docs/guides/LiveCode Builder Language Reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ There are aliases for the Java primitive types:
464464
- JShort maps to Int16
465465
- JInt maps to Int32
466466
- JLong maps to Int64
467+
- JFloat maps to Float32
468+
- JDouble maps to Float64
467469

468470
All the primitive types above will implicitly bridge between corresponding
469471
high level types:

docs/lcb/notes/feature-sized_ints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ version: 9.0.0-dp-7
1212
CUInt, CSLong, CULong, CSLongLong and CULongLong have been added.
1313
These all map to their corresponding C counterparts.
1414

15-
* The Java integer primtive types JByte, JShort, JInt, JLong,
15+
* The Java integer primtive types JBoolean, JByte, JShort, JInt, JLong,
1616
JFloat and JDouble have been added. These map to int8_t,
1717
int16_t, int32_t, int64_t, float and double.

libfoundation/src/foundation-foreign.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,8 @@ template <typename TypeDesc>
628628
bool doimport(void *contents, bool p_release, MCValueRef& r_value)
629629
{
630630
static_assert(TypeDesc::is_bridgable, "This type is not bridgable");
631-
bool t_success = DoImport<TypeDesc>::doimport(*static_cast<typename TypeDesc::c_type *>(contents),
631+
return DoImport<TypeDesc>::doimport(*static_cast<typename TypeDesc::c_type *>(contents),
632632
reinterpret_cast<typename TypeDesc::bridge_type&>(r_value));
633-
return t_success;
634633
}
635634

636635
/* ---------- bool specializations */

libscript/src/java.lcb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public type JByte is Int8
3939
public type JShort is Int16
4040
public type JInt is Int32
4141
public type JLong is Int64
42-
public type JFloat is CFloat
43-
public type JDouble is CDouble
42+
public type JFloat is Float32
43+
public type JDouble is Float64
4444

4545
public foreign type JObject binds to "MCJavaObjectTypeInfo"
4646
public type JString is JObject

tests/lcb/stdlib/java.lcb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end handler
4040

4141
foreign handler CreateJavaString(in pBytes as JByteArray) returns JString binds to "java:java.lang.String>new([B)"
4242

43-
foreign handler MCDataCreateWithBytes(in pBytes as ZStringNative, in pCount as CUInt, out rData as Data) returns JBoolean binds to "<builtin>"
43+
foreign handler MCDataCreateWithBytes(in pBytes as ZStringNative, in pCount as LCUIndex, out rData as Data) returns CBool binds to "<builtin>"
4444

4545
public handler TestCreateJString()
4646
if not the operating system is in ["mac", "linux"] then

0 commit comments

Comments
 (0)