Skip to content
Snippets Groups Projects
  • Noel Gordon's avatar
    zlib adler_simd.c: unsigned cast |blocks| on assignment · e1769aea
    Noel Gordon authored
    MSVC noted the unsigned |n| = size_t |blocks| could be a possible
    loss in precision. No loss in precision occurs since (n > blocks)
    at this point: |blocks| fits in an unsigned type.
    
    To silence compiler warnings, first update BUILD.gn for the adler
    SIMD code to use chromium compiler:chromium_code rule (more error
    checking), rather than the permissive "compiler:no_chromium_code"
    rule. Then cast |blocks| to unsigned on assigment to |n| (this is
    safe to do as mentioned above).
    
    No change in behavior, no new tests.
    
    Tbr: cblume@chromium.org
    Bug: 762564
    Change-Id: Ia97120bcca206287fd42b97674f8a6215283e4a5
    Reviewed-on: https://chromium-review.googlesource.com/835927
    
    
    Commit-Queue: Noel Gordon <noel@chromium.org>
    Reviewed-by: default avatarSam McNally <sammc@chromium.org>
    Cr-Original-Commit-Position: refs/heads/master@{#525285}
    Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
    Cr-Mirrored-Commit: 0cb9a22e2fb55e092342192d66f7e33c14432d27
    e1769aea