Re: [Iup-users] IUP iupDlgListDestroyAll refactored
De: Antonio Scuri Enviado: sexta-feira, 29 de maio de 2020 13:12 Para: IUP discussion list. Assunto: Re: [Iup-users] IUP iupDlgListDestroyAll refactored > Because IupDestroy will also remove the dialog from that list and list->next > will be invalid. Like this, it worked without problems. void iupDlgListDestroyAll(void) { int i, count = 0; Ihandle** ih_array = (Ihandle**)malloc(idlg_count * sizeof(Ihandle*)); Idiallst *list; for (list = idlglist; list; list = list->next) { if (iupObjectCheck(list->ih)) { ih_array[count] = list->ih; ++count; } } for (i = 0; i < count; ++i) { IupDestroy(ih_array[i]); /* this will also destroy the list */ } free(ih_array); } Advantagens: 1. Avoid assign variable count with i value; 2. Avoid call iupObjectCheck for every ih_array[i], since they have all been verified. regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
[Iup-users] IUP assorted issues (part III)
Hi Scuri, There are some news issues with IUP-3.29 1. Possible dereference null at functions iFlatTreeTextEditVALUECHANGED_CB and iFlatTreeTextEditKCR_CB (src/iup_flatree.c) Function iFlatTreeGetNode can return NULL, so, var nodefocus can be NULL 2. Uninitialized var used (src/win/iupwin_clipboard.c) Var len is used at iupwinStrToSystemLen 3. Argument cannot be negative (src/iup_classinfo.c) function IupGetClassCallback (line 288) can return negative number qsort(attr_names, cb_n, sizeof(char*), compare_names); // cb_n cannot be negative number here 4. Use after free (src/win/iupwin_image.c) If IMAGEDESTROY_CB is defined at line 889, a function call will be done by passing variable handle freed. cb function callback cannot use handle. regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
Re: [Iup-users] IUP 3.29 Possible erros with iup_mglplot.cpp
Please, disregard that message. Wrong diagnostics. regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
[Iup-users] IUP 3.29 Possible erros with iup_mglplot.cpp
Hi Scuri, Possible errors with iup_mglplot.cpp 1. line 97: error #40: expected an identifier !_Is_implicitly_default_constructible<_Uty1>::value || !_Is_implicitly_default_constructible<_Uty2>::value) 2. line 96: error #788: not a valid member class or function template declaration constexpr explicit( ^ 3. line 96: error #772: "explicit" is not allowed constexpr explicit( ^ 4. line 98: error #65: expected a ";" pair() noexcept( ^ 5. line 178: error #40: expected an identifier explicit piecewise_construct_t() = default; regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
Re: [Iup-users] IUP-.32.9 Windows compilation (msvc 2019 32bits)
Iupvled is usually statically linked. Those functions were not exported in the DLL. Just fixed and committed to the SVN. Best, Scuri Em sex., 10 de jul. de 2020 às 14:42, Ranier Vilela escreveu: > Hi Scuri, > > Troubles with IUP compilation: > > ''; echo Tecmake: linking iupvled.exe ... > c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/bin/Hostx86/x86/link > -nologo-incremental:no -machine:X86 -debug -MANIFEST:NO > -subsystem:windows -out:../bin/Win32/iupvled.exe > -LIBPATH:../../cd/lib/dll16 -LIBPATH:../lib/dll16 > -LIBPATH:../../cd/lib/dll16 -LIBPATH:../../im/lib/dll16 > -LIBPATH:../../ftgl/lib/dll16 -LIBPATH:../../freetype/lib/dll16 > -LIBPATH:../../zlib/lib/dll16 > -LIBPATH:c:/progra~2/wi3cf2~1/10/lib/10.0.18362.0/ucrt/x86 > -LIBPATH:c:/progra~2/wi3cf2~1/10/lib/10.0.18362.0/um/x86 > -LIBPATH:c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/lib/x86 > -LIBPATH:c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/atlmfc/lib/x86 > iupim.lib im_process.lib cdim.lib iupimglib.lib iup_scintilla.lib imm32.lib > msimg32.lib iupglcontrols.lib iup_plot.lib cdcontextplus.lib cdgl.lib > gdiplus.lib iupcontrols.lib iupweb.lib iupole.lib comsuppw.lib iupcd.lib > iup.lib iupgl.lib iupstub.lib cd.lib im.lib ftgl.lib freetype6.lib > zlib1.lib glu32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib > winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib oleaut32.lib > ole32.lib comctl32.lib ../obj/iupvled/Win32/iup_vled.obj > ../obj/iupvled/Win32/iup_vled_imgs.obj > ../obj/iupvled/Win32/vled_image_editor.obj ../obj/iupvled/Win32/iup.res > MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' > conflita com uso de outras bibliotecas; use /NODEFAULTLIB:library > iup_vled.obj : error LNK2019: símbolo externo não resolvido, > _iupClassInfoGetDesc, referenciado na função _multitext_dwell_cb > iup_vled.obj : error LNK2019: símbolo externo não resolvido, > _iupClassInfoShowHelp, referenciado na função _multitext_kf1_cb > iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupLoadLed, > referenciado na função _load_led > iup_vled.obj : error LNK2019: símbolo externo não resolvido, > _iupLayoutExportNamedImageListSetHandle, referenciado na função _vLedExport > iup_vled.obj : error LNK2019: símbolo externo não resolvido, > _iupLayoutExportNamedImageList, referenciado na função _vLedExport > ..\bin\Win32\iupvled.exe : fatal error LNK1120: 5 externo não resolvidos > ../tecmakewin.mak:1683: recipe for target '../bin/Win32/iupvled.exe' failed > win-make[2]: *** [../bin/Win32/iupvled.exe] Error 1120 > makefile:10: recipe for target 'do_all' failed > win-make[1]: *** [do_all] Error 2 > makefile:51: recipe for target 'iupvled' failed > win-make: *** [iupvled] Error 2 > > regards, > Ranier Vilela > > ___ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users > ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
Re: [Iup-users] IUP-3.29 WIndows compilation (msvc 2019 32bits), tecmakewin troubles
I have no idea. This should work, just like other folders are created. Best, Scuri Em sex., 10 de jul. de 2020 às 14:58, Ranier Vilela escreveu: > Hi Scuri, > > More troubles with IUP compilation: > > if [ ! -d dep ] ; then mkdir -p dep ; fi > ! foi inesperado neste momento. > ../tecmakewin.mak:1741: recipe for target 'dep' failed > win-make[2]: *** [dep] Error 255 > makefile:12: recipe for target 'iuplua' failed > win-make[1]: *** [iuplua] Error 2 > makefile:41: recipe for target 'iuplua5' failed > win-make: *** [iuplua5] Error 2 > > The dep directory already exist, whay is complain? > What is correct directory structure for dep? > set NO_DEPEND=Yes is set. > > regards, > Ranier Vilela > > ___ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users > ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
[Iup-users] IUP-3.29 WIndows compilation (msvc 2019 32bits), tecmakewin troubles
Hi Scuri, More troubles with IUP compilation: if [ ! -d dep ] ; then mkdir -p dep ; fi ! foi inesperado neste momento. ../tecmakewin.mak:1741: recipe for target 'dep' failed win-make[2]: *** [dep] Error 255 makefile:12: recipe for target 'iuplua' failed win-make[1]: *** [iuplua] Error 2 makefile:41: recipe for target 'iuplua5' failed win-make: *** [iuplua5] Error 2 The dep directory already exist, whay is complain? What is correct directory structure for dep? set NO_DEPEND=Yes is set. regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
[Iup-users] IUP-.32.9 Windows compilation (msvc 2019 32bits)
Hi Scuri, Troubles with IUP compilation: ''; echo Tecmake: linking iupvled.exe ... c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/bin/Hostx86/x86/link -nologo-incremental:no -machine:X86 -debug -MANIFEST:NO -subsystem:windows -out:../bin/Win32/iupvled.exe -LIBPATH:../../cd/lib/dll16 -LIBPATH:../lib/dll16 -LIBPATH:../../cd/lib/dll16 -LIBPATH:../../im/lib/dll16 -LIBPATH:../../ftgl/lib/dll16 -LIBPATH:../../freetype/lib/dll16 -LIBPATH:../../zlib/lib/dll16 -LIBPATH:c:/progra~2/wi3cf2~1/10/lib/10.0.18362.0/ucrt/x86 -LIBPATH:c:/progra~2/wi3cf2~1/10/lib/10.0.18362.0/um/x86 -LIBPATH:c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/lib/x86 -LIBPATH:c:/progra~2/mib055~1/2019/community/vc/tools/msvc/14.26.28801/atlmfc/lib/x86 iupim.lib im_process.lib cdim.lib iupimglib.lib iup_scintilla.lib imm32.lib msimg32.lib iupglcontrols.lib iup_plot.lib cdcontextplus.lib cdgl.lib gdiplus.lib iupcontrols.lib iupweb.lib iupole.lib comsuppw.lib iupcd.lib iup.lib iupgl.lib iupstub.lib cd.lib im.lib ftgl.lib freetype6.lib zlib1.lib glu32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib oleaut32.lib ole32.lib comctl32.lib ../obj/iupvled/Win32/iup_vled.obj ../obj/iupvled/Win32/iup_vled_imgs.obj ../obj/iupvled/Win32/vled_image_editor.obj ../obj/iupvled/Win32/iup.res MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflita com uso de outras bibliotecas; use /NODEFAULTLIB:library iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupClassInfoGetDesc, referenciado na função _multitext_dwell_cb iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupClassInfoShowHelp, referenciado na função _multitext_kf1_cb iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupLoadLed, referenciado na função _load_led iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupLayoutExportNamedImageListSetHandle, referenciado na função _vLedExport iup_vled.obj : error LNK2019: símbolo externo não resolvido, _iupLayoutExportNamedImageList, referenciado na função _vLedExport ..\bin\Win32\iupvled.exe : fatal error LNK1120: 5 externo não resolvidos ../tecmakewin.mak:1683: recipe for target '../bin/Win32/iupvled.exe' failed win-make[2]: *** [../bin/Win32/iupvled.exe] Error 1120 makefile:10: recipe for target 'do_all' failed win-make[1]: *** [do_all] Error 2 makefile:51: recipe for target 'iupvled' failed win-make: *** [iupvled] Error 2 regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
Re: [Iup-users] IUP 3.29 Possible leak at iupwin_font.c
No. Notice that count is obtained from iupArrayCount, later iupArrayInc is called, so when i==count it is a valid operation to use fonts[i]. Best, Scuri Em sex., 10 de jul. de 2020 às 13:34, Ranier Vilela escreveu: > De: Ranier Vilela > Enviado: sexta-feira, 10 de julho de 2020 16:12 > Para: IUP discussion list. > Assunto: [Iup-users] IUP 3.29 Possible leak at iupwin_font.c > > Attached patch try to fix. > > regards, > > Ranier Vilela___ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users > ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
Re: [Iup-users] IUP 3.29 Possible leak at iupwin_font.c
De: Ranier Vilela Enviado: sexta-feira, 10 de julho de 2020 16:12 Para: IUP discussion list. Assunto: [Iup-users] IUP 3.29 Possible leak at iupwin_font.c Attached patch try to fix. regards, Ranier Vilela fix_possible_leak_iupwin_font.patch Description: fix_possible_leak_iupwin_font.patch ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users
[Iup-users] IUP 3.29 Possible leak at iupwin_font.c
Hi Scuri, There are a possible leak at (src/win/iupwin_font.c) At line 89, IUP call: fonts = (IwinFont*)iupArrayInc(win_fonts); To create room for the next font, but uses var i with count value. var i must be count + 1, otherwise will replace the last font, leaking last pointer font. regards, Ranier Vilela ___ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users