forked from rnmapbox/maps
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
diff --git a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js | ||
index aa14054..9e834ec 100644 | ||
--- a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js | ||
+++ b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleH.js | ||
@@ -205,7 +205,7 @@ function translatePrimitiveJSTypeToCpp( | ||
case 'DoubleTypeAnnotation': | ||
return wrapOptional('double', isRequired); | ||
case 'FloatTypeAnnotation': | ||
- return wrapOptional('double', isRequired); | ||
+ return wrapOptional('float', isRequired); | ||
case 'Int32TypeAnnotation': | ||
return wrapOptional('int', isRequired); | ||
case 'BooleanTypeAnnotation': | ||
diff --git a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJavaSpec.js b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJavaSpec.js | ||
index 2ac03f7..59fc704 100644 | ||
--- a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJavaSpec.js | ||
+++ b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJavaSpec.js | ||
@@ -263,11 +263,11 @@ function translateFunctionReturnTypeToJavaType( | ||
case 'NumberTypeAnnotation': | ||
return wrapOptional('double', isRequired); | ||
case 'FloatTypeAnnotation': | ||
- return wrapOptional('double', isRequired); | ||
+ return wrapOptional('float', isRequired); | ||
case 'DoubleTypeAnnotation': | ||
return wrapOptional('double', isRequired); | ||
case 'Int32TypeAnnotation': | ||
- return wrapOptional('double', isRequired); | ||
+ return wrapOptional('int', isRequired); | ||
case 'BooleanTypeAnnotation': | ||
return wrapOptional('boolean', isRequired); | ||
case 'EnumDeclaration': | ||
@@ -336,7 +336,7 @@ function getFalsyReturnStatementFromReturnType( | ||
case 'NumberTypeAnnotation': | ||
return nullable ? 'return null;' : 'return 0;'; | ||
case 'FloatTypeAnnotation': | ||
- return nullable ? 'return null;' : 'return 0.0;'; | ||
+ return nullable ? 'return null;' : 'return 0f;'; | ||
case 'DoubleTypeAnnotation': | ||
return nullable ? 'return null;' : 'return 0.0;'; | ||
case 'Int32TypeAnnotation': | ||
diff --git a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js | ||
index 286ad66..f1859b3 100644 | ||
--- a/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js | ||
+++ b/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js | ||
@@ -263,9 +263,9 @@ function translateParamTypeToJniType(param, resolveAlias) { | ||
case 'DoubleTypeAnnotation': | ||
return !isRequired ? 'Ljava/lang/Double;' : 'D'; | ||
case 'FloatTypeAnnotation': | ||
- return !isRequired ? 'Ljava/lang/Double;' : 'D'; | ||
+ return !isRequired ? 'Ljava/lang/Float;' : 'F'; | ||
case 'Int32TypeAnnotation': | ||
- return !isRequired ? 'Ljava/lang/Double;' : 'D'; | ||
+ return !isRequired ? 'Ljava/lang/Integer;' : 'I'; | ||
case 'GenericObjectTypeAnnotation': | ||
return 'Lcom/facebook/react/bridge/ReadableMap;'; | ||
case 'ObjectTypeAnnotation': |