Skip to content
  • Tapani Pälli's avatar
    nir: fix compiler warnings about implicit conversions · 061407ec
    Tapani Pälli authored
    
    
    Instead of implicitly converting UINT64_MAX to operation destination
    type, we explicitly set the correct max depending on type.
    
    So instead of generating:
    
       uint8_t dst = (src0 + src1) < src0 ? (UINT64_MAX) : (src0 + src1);
    
    we do:
    
       uint8_t dst = (src0 + src1) < src0 ? (UINT8_MAX) : (src0 + src1);
    
    This clears following warnings during compilation:
    
      warning: implicit conversion from 'unsigned long' to 'uint1_t'
      warning: implicit conversion from 'unsigned long' to 'uint8_t'
      warning: implicit conversion from 'unsigned long' to 'uint16_t'
      warning: implicit conversion from 'unsigned long' to 'uint32_t'
    
    Signed-off-by: default avatarTapani Pälli <tapani.palli@intel.com>
    061407ec