R
R
rebolv2020-11-11 12:17:50
C++ / C#
rebolv, 2020-11-11 12:17:50

An int value cannot be used to initialize an entity of type "Cost imU32". How to solve this problem?

Error: "value of type int cannot be used to initialize entity of type "Cost imU32"" written when hovering over "src_tmp" in lines

const ImU32* it_begin = src_tmp.GlyphsSet.Storage.begin();
const ImU32* it_end = src_tmp.GlyphsSet.Storage.end();

Part of the code with errors:
src_tmp.GlyphsSet.SetBit(codepoint);
                dst_tmp.GlyphsSet.SetBit(codepoint);
                total_glyphs_count++;
            }
    }

    // 3. Unpack our bit map into a flat list (we now have all the Unicode points that we know are requested _and_ available _and_ not overlapping another)
    for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
    {
        ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
        src_tmp.GlyphsList.reserve(src_tmp.GlyphsCount);

        IM_ASSERT(sizeof(src_tmp.GlyphsSet.Storage.Data[0]) == sizeof(ImU32));
        const ImU32* it_begin = src_tmp.GlyphsSet.Storage.begin();
        const ImU32* it_end = src_tmp.GlyphsSet.Storage.end();


Additional screenshots:
5fababe502ae0278437663.png
5fababede077d313608083.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-11-11
@firedragon

It is a signed integer and 8 16 32 64 so cast it to the type

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question