flutter/examples/api/windows/runner
Chris Bracken 9f8fe3f04c
[Windows] Fix signed/unsigned int comparison (#142341)
Previously, we were comparing the signed int `target_length` (returned by WideCharToMultiByte) to a size_t string length, resulting in a signed/unsigned comparison warning as follows:

```
windows\runner\utils.cpp(54,43): warning C4018:  '>': signed/unsigned mismatch
```

WideCharToMultiByte returns:
* 0 on error
* the number of bytes written to the buffer pointed to by its fifth parameter, lpMultiByteStr, on success.

As a result it's safe to store the return value in an unsigned int, which eliminates the warning.

No changes to tests since this is dependent on end-user project settings/modifications and does not trigger a warning with default project settings.

Fixes: https://github.com/flutter/flutter/issues/134227
2024-02-07 00:09:57 +00:00
..
CMakeLists.txt [Windows] Flow version information to the build output (#106145) 2022-06-27 10:45:56 -07:00
flutter_window.cpp Add Windows to the platform_channels example (#106754) 2022-06-30 14:54:07 +00:00
flutter_window.h
main.cpp Add Windows to the platform_channels example (#106754) 2022-06-30 14:54:07 +00:00
resource.h
runner.exe.manifest Update Windows manifest to declare Windows 11 (#104768) 2022-05-26 17:40:07 -07:00
Runner.rc [Windows] Flow version information to the build output (#106145) 2022-06-27 10:45:56 -07:00
utils.cpp [Windows] Fix signed/unsigned int comparison (#142341) 2024-02-07 00:09:57 +00:00
utils.h
win32_window.cpp Fix typos (#121171) 2023-02-23 19:43:21 +00:00
win32_window.h Fix typos (#121171) 2023-02-23 19:43:21 +00:00