• Chris Bracken's avatar
    [Windows] Fix signed/unsigned int comparison (#142341) · 9f8fe3f0
    Chris Bracken authored
    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
    9f8fe3f0
Name
Last commit
Last update
..
app Loading commit data...
app_integration_test/integration_test Loading commit data...
app_shared Loading commit data...
app_test_widget/test Loading commit data...
cocoapods Loading commit data...
module Loading commit data...
package Loading commit data...
package_ffi Loading commit data...
plugin Loading commit data...
plugin_ffi Loading commit data...
plugin_shared Loading commit data...
skeleton Loading commit data...
xcode/ios/custom_application_bundle Loading commit data...
README.md Loading commit data...
template_manifest.json Loading commit data...