Skip to content

Narrowing Conversion Errors with IPL_DEPTH Definitions in vglOpencv.h (Opencv version: 4.0.0) #20

Description

@joaonery1

The definitions for IPL_DEPTH_8S, IPL_DEPTH_16S, and IPL_DEPTH_32S in vglOpencv.h previously used a bitwise OR operation involving IPL_DEPTH_SIGN directly. This caused narrowing conversion errors during compilation:


#define IPL_DEPTH_8S  (IPL_DEPTH_SIGN | 8)
#define IPL_DEPTH_16S (IPL_DEPTH_SIGN | 16)
#define IPL_DEPTH_32S (IPL_DEPTH_SIGN | 32)

The updated version uses static_cast to address these errors, as follows:


#define IPL_DEPTH_8S  (static_cast<int>(0x80000000) | 8)
#define IPL_DEPTH_16S (static_cast<int>(0x80000000U) | 16)
#define IPL_DEPTH_32S (static_cast<int>(0x80000000U) | 32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions