Skip to content

C4267 warning when using MSVC #36

@aeris170

Description

@aeris170

MSVC gives warning C4267 for this line:

inline int GetLineCount() const { return mLines.size(); }

The warning is generated because std::vector::size return std::size_t but the function in question returns an int so there "could" be data loss. Practically, having a file with max 32bit lines is nuts and won't happen but still, the warning is there for everyone who #include "TextEditor.h". I think the users of ImGuiColorTextEdit shouldn't have the warning in their build. I implemented 3 fixes for this. Pick your preferred one, or propose another and I'll implement it.

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