mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Use std::numeric_limits in C++
Summary: Instead of using `UINT32_MAX` in C++ code, use `std::numeric_limits<uint32_t>::max()`. The `UINT32_MAX` macro is not available in all compilation setups Closes https://github.com/facebook/react-native/pull/5481 Reviewed By: svcscm Differential Revision: D2854545 Pulled By: androidtrunkagent fb-gh-sync-id: 00a70b429c78bcf120866bb59fae2ffe6330a910
This commit is contained in:
committed by
facebook-github-bot-9
parent
2a70c53947
commit
35e1fd8826
@@ -340,7 +340,7 @@ JSValueRef JSCExecutor::nativeRequire(
|
||||
}
|
||||
|
||||
double moduleId = JSValueToNumber(ctx, arguments[0], exception);
|
||||
if (moduleId <= (double) UINT32_MAX && moduleId >= 0.0) {
|
||||
if (moduleId <= (double) std::numeric_limits<uint32_t>::max() && moduleId >= 0.0) {
|
||||
try {
|
||||
executor->loadModule(moduleId);
|
||||
} catch (JSModulesUnbundle::ModuleNotFound&) {
|
||||
|
||||
Reference in New Issue
Block a user