Skip to content
Snippets Groups Projects
  1. Oct 08, 2020
  2. Oct 07, 2020
  3. Oct 05, 2020
  4. Oct 02, 2020
    • Bartosz Taudul's avatar
      Silence memset warning. (#3505) · 6469b943
      Bartosz Taudul authored
      Compiling the code as-is results in the following warning:
      
      -->8--
      imgui_freetype.cpp:341:72: warning: ‘void* memset(void*, int, size_t)’
              clearing an object of type ‘struct ImFontBuildSrcDataFT’ with no
              trivial copy-assignment; use assignment or value-initialization
              instead [-Wclass-memaccess]
        341 |     memset(src_tmp_array.Data, 0, (size_t)src_tmp_array.size_in_bytes());
            |                                                                        ^
      imgui_freetype.cpp:302:8: note: ‘struct ImFontBuildSrcDataFT’ declared here
        302 | struct ImFontBuildSrcDataFT
            |        ^~~~~~~~~~~~~~~~~~~~
      --8<--
      
      This is caused by presence of ImVector<> directly in ImFontBuildSrcDataFT data
      structure, as well as in the child ImBitVector. Since ImVector<> has a
      constructor, the compiler infers that initialization by memset is not valid.
      Such initialization is not a bug, however, as the default ImVector<> ctor just
      sets the structure data members to 0, which is exactly what the memset does.
      
      Casting the data structure address to void* pointer silences this warning.
      6469b943
  5. Oct 01, 2020
  6. Sep 30, 2020
  7. Sep 28, 2020
  8. Sep 25, 2020
  9. Sep 22, 2020
  10. Sep 21, 2020
  11. Sep 18, 2020
  12. Sep 17, 2020
  13. Sep 16, 2020
Loading