Skip to content

Commit 6d04a46

Browse files
Igor Klemenskifacebook-github-bot
Igor Klemenski
authored andcommitted
Add explicit type casts to fix compilation errors on Windows. (#31363)
Summary: Recent changes to `MapBuffer` have broken the compilation on Windows. This fix is similar to this recently-merged change: #31106 Side note - this PR only addresses a build break, but doesn't address the unsafe casting semantics in `MapBuffer`, which can still cause overflows. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Fix compilation errors on Windows. Pull Request resolved: #31363 Test Plan: RN now builds in Visual Studio on Windows. Reviewed By: mdvacca Differential Revision: D28028342 Pulled By: rozele fbshipit-source-id: 77d8d4870c59b77acfc0ab2f4c3b7df40b59851d
1 parent 7bf78ea commit 6d04a46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void MapBufferBuilder::ensureDynamicDataSpace(int32_t size) {
127127
}
128128

129129
void MapBufferBuilder::putString(Key key, std::string value) {
130-
int32_t strLength = value.length();
130+
int32_t strLength = static_cast<int32_t>(value.length());
131131
const char *cstring = getCstring(&value);
132132

133133
// format [lenght of string (int)] + [Array of Characters in the string]

0 commit comments

Comments
 (0)