• 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
..
.idea Loading commit data...
android-java.tmpl Loading commit data...
android-kotlin.tmpl Loading commit data...
android.tmpl Loading commit data...
ios-objc.tmpl Loading commit data...
ios-swift.tmpl Loading commit data...
ios.tmpl Loading commit data...
linux.tmpl Loading commit data...
macos.tmpl Loading commit data...
web Loading commit data...
windows.tmpl Loading commit data...
.gitignore.tmpl Loading commit data...
analysis_options.yaml.tmpl Loading commit data...
projectName.iml.tmpl Loading commit data...