Re: [Iup-users] About using IUP.Text:action in Lua

2018-01-16 Thread Pete Lomax via Iup-users
Hi there Hernan, You might want to visit https://bitbucket.org/petelomax/phix/src and then click on demo, rosetta, 7guis Although written in a different language, all 7 entries are completed. The temperature converter is named Converter.exw, and I used the valuechanged callback to achieve the

[Iup-users] IupLoadAnimation loads only first frame of GIF?

2018-01-16 Thread Mihail Ivanchev
Hello IUP, I noticed that IupLoadAnimation loads only the 1st frame of a GIF file containing several. Here is how I use it: appDlg.loadingAnimSmall = IupLoadAnimation("loading-small.gif"); appDlg.canvas.loadingAnim = IupAnimatedLabel(appDlg.loadingAnimSmall);

[Iup-users] About using IUP.Text:action in Lua

2018-01-16 Thread Hernan Cano
Hi, Antonio and friends. In the attached file, I show an example of a form in Lua language using the IUP gui. The needing is that with every key pressed in the first textbox some calculations be made and the result must be shown in the second textbox. The problem that I found is that it the

[Iup-users] CID 210578 (#1 of 1): Dereference null return value (NULL_RETURNS)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210578 (#1 of 1): Dereference null return value (NULL_RETURNS) --- a\srccontrols\matrix\iupmat_getset.cTue Sep 19 12:43:20 2017 +++ b\srccontrols\matrix\iupmat_getset.cTue Jan 16 23:52:24 2018 @@ -138,7 +138,14 @@ { /* only called in

[Iup-users] CID 210583 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210583 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO) . divide_by_zero: In expression time_delay / frame_time, division by expression frame_time which may be zero has undefined behavior. --- a\src\iup_expander.cMon Sep 04 15:31:16 2017 +++

[Iup-users] CID 210616 (#1 of 1): Missing varargs init or cleanup (VARARGS)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210616 (#1 of 1): Missing varargs init or cleanup (VARARGS) --- a\src\iup_scanf.c Sun Jul 26 03:10:04 2015 +++ b\src\iup_scanf.c Tue Jan 16 23:38:37 2018 @@ -175,9 +175,9 @@ } ++fields_out_count; } - va_end(va); cleanup: + va_end(va);

[Iup-users] CID 210621 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210621 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR) copy_paste_error: max_w in max_w > geometry.min_height looks like a copy-paste error. --- a\src\gtk\iupgtk_dialog.c Wed Oct 11 19:38:34 2017 +++ b\src\gtk\iupgtk_dialog.c Tue Jan 16 23:33:23 2018 @@

[Iup-users] CID 210638 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210638 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) --- a\srcglcontrols\iup_gldraw.cThu Aug 04 14:58:16 2016 +++ b\srcglcontrols\iup_gldraw.cTue Jan 16 23:17:34 2018 @@ -571,7 +570,7 @@ glTranslated(0.0, (double)-lineheight, 0.0);

[Iup-users] CID 210680 (#2 of 2): Missing break in switch (MISSING_BREAK)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210680 (#2 of 2): Missing break in switch (MISSING_BREAK) --- a\srcim\iup_im.cThu Feb 02 20:46:26 2017 +++ b\srcim\iup_im.cTue Jan 16 23:07:47 2018 @@ -35,6 +35,7 @@ { case IM_ERR_NONE: msg = NULL; + break; case IM_ERR_OPEN:

[Iup-users] CID 210513 (#1 of 1): Uninitialized scalar variable (UNINIT)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210513 (#1 of 1): Uninitialized scalar variable (UNINIT) --- a\src\iup_draw.cTue May 16 16:22:56 2017 +++ b\src\iup_draw.cTue Jan 16 22:59:52 2018 @@ -561,8 +561,7 @@ void iupFlatDrawArrow(IdrawCanvas* dc, int x, int y, int size, const char*

Re: [Iup-users] CID 210518 (#2 of 2): Resource leak (RESOURCE_LEAK)

2018-01-16 Thread Antonio Scuri
Already fixed this one... along with another report on the same file. 2018-01-16 22:56 GMT-02:00 Ranier VF : > Hi, > Issue found by Coverity Scan. > CID 210518 (#2 of 2): Resource leak (RESOURCE_LEAK) > 9. leaked_storage: Variable nm going out of scope leaks the storage

[Iup-users] CID 210518 (#2 of 2): Resource leak (RESOURCE_LEAK)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210518 (#2 of 2): Resource leak (RESOURCE_LEAK) 9. leaked_storage: Variable nm going out of scope leaks the storage it points to. file: iup_ledparse.c function: iParseExp line: 110 IPARSE_RETURN_IF_ERRO(iparse_error); Best. Ranier

[Iup-users] CID 210613 (#2 of 2): Uninitialized scalar variable (UNINIT)

2018-01-16 Thread Ranier VF
Hi, CID 210613 (#2 of 2): Uninitialized scalar variable (UNINIT) --- a\srcglcontrols\iup_gldraw.cThu Aug 04 14:58:16 2016 +++ b\srcglcontrols\iup_gldraw.cTue Jan 16 22:41:14 2018 @@ -327,8 +327,7 @@ void iupGLDrawArrow(Ihandle *ih, int x, int y, int size, const char* color,

Re: [Iup-users] CID 210635 (#1 of 1): Uninitialized scalar variable (UNINIT)

2018-01-16 Thread Ranier VF
Hi, Ihandle* ih_names[MAX_NAMES] = {NULL}; Has the same effect that call function memset and is more fast. Accessing pointer var uninitialized are ever insecure and bug prone. Best. Ranier. De: Antonio Scuri Enviado: quarta-feira,

[Iup-users] Floating-point weirdness: Possible bug around CD's RGB_to_HSB code.

2018-01-16 Thread sur-behoffski
G'day, Thanks for the added initialisation of hue, in response to a compiler warning that the variable might be used before being initialised. This initialisation was added as r739 to CD, to the file cd/src/drv/cddxf.c, line 1662. As I mentioned previously, I always break out in a sweat when

Re: [Iup-users] CID 210622 (#1 of 1): Resource leak (RESOURCE_LEAK)

2018-01-16 Thread Antonio Scuri
Actually there was the same issue in line 143. Fixed and committed to SVN. Best, Scuri 2018-01-16 22:36 GMT-02:00 Ranier VF : > Hi, > Issue found by Coverity Scan. > CID 210622 (#1 of 1): Resource leak (RESOURCE_LEAK) > > --- a\src\iup_config.c Thu Oct 05 12:41:46

Re: [Iup-users] CID 210635 (#1 of 1): Uninitialized scalar variable (UNINIT)

2018-01-16 Thread Antonio Scuri
This is the same case as the previous e-mail. The logic access the array only at the current count, which starts at 0. I don't think there is a problem there, but the memset of the previous e-mail was harmless. So I repeat it for coehrence. memset(ih_names, 0, MAX_NAMES * sizeof(Ihandle*));

[Iup-users] CID 210622 (#1 of 1): Resource leak (RESOURCE_LEAK)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210622 (#1 of 1): Resource leak (RESOURCE_LEAK) --- a\src\iup_config.c Thu Oct 05 12:41:46 2017 +++ b\src\iup_config.c Tue Jan 16 22:36:04 2018 @@ -137,7 +137,10 @@ int line_len = iupLineFileReadLine(line_file); if (line_len == -1) +{ +

Re: [Iup-users] CID 210656 (#1 of 1): Uninitialized pointer read (UNINIT)

2018-01-16 Thread Antonio Scuri
Fixed and committed to SVN. Best, Scuri 2018-01-16 22:23 GMT-02:00 Ranier VF : > Hi, > Issue found by Coverity Scan. > CID 210656 (#1 of 1): Uninitialized pointer read (UNINIT) > > --- a\src\iup_names.c Mon Oct 05 17:15:42 2015 > +++ b\src\iup_names.c Tue Jan 16

[Iup-users] CID 210635 (#1 of 1): Uninitialized scalar variable (UNINIT)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210635 (#1 of 1): Uninitialized scalar variable (UNINIT) --- a\srcview\iup_view.cFri Sep 29 14:05:12 2017 +++ b\srcview\iup_view.cTue Jan 16 22:29:20 2018 @@ -656,7 +656,7 @@ { char *names[MAX_NAMES]; Ihandle* ih; - Ihandle*

[Iup-users] CID 210656 (#1 of 1): Uninitialized pointer read (UNINIT)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coverity Scan. CID 210656 (#1 of 1): Uninitialized pointer read (UNINIT) --- a\src\iup_names.c Mon Oct 05 17:15:42 2015 +++ b\src\iup_names.c Tue Jan 16 22:20:35 2018 @@ -64,6 +64,7 @@ return; ih_array = (Ihandle**)malloc(count * sizeof(Ihandle*)); +

Re: [Iup-users] CID 210642 (#3 of 3): Dereference after null check (FORWARD_NULL)

2018-01-16 Thread Antonio Scuri
Fixed and committed to SVN. Best, Scuri 2018-01-16 15:35 GMT-02:00 Ranier VF : > Hi, > Multiplie issues found by Coverity Scan. > CID 210642 (#3 of 3): Dereference after null check (FORWARD_NULL) > file: iup_font.c > Function:iupGetFontInfo > > Vars: size, is_bold,

Re: [Iup-users] CID 210685 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)

2018-01-16 Thread Antonio Scuri
That's correct. value can be NULL Best, Scuri 2018-01-16 15:53 GMT-02:00 Ranier VF : > Hi, > Sorry by mistake. > Function affected is iAttribParse > Line: 1408 > > IupStoreAttribute(ih, name, value); > > Best. > Ranier > > De:

Re: [Iup-users] CID 210688 (#1 of 1): Dereference after null check (FORWARD_NULL)

2018-01-16 Thread Antonio Scuri
That's correct. The color is set even if the value is NULL. The default value will be set internally. Best, Scuri 2018-01-16 15:25 GMT-02:00 Ranier VF : > Hi, > Isse found by Coverity Scan. > CID 210688 (#1 of 1): Dereference after null check (FORWARD_NULL) > > Best.

Re: [Iup-users] CID 210631 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)

2018-01-16 Thread Antonio Scuri
Fixed and committed to SVN. Best, Scuri 2018-01-16 15:04 GMT-02:00 Ranier VF : > Hi, > Actual version of iMatrixExSetPasteFileAttrib, still have a big waste of > resources and processing. > > If iupStrToIntInt != 2, is ok, all steps to read file are lost. > Maybe, this

[Iup-users] CID 210685 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)

2018-01-16 Thread Ranier VF
Hi, Issue found by Coveriy Scan. CID 210685 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) file: iup_attrib.c function: IupStoreAttribute line: 584 7. var_deref_model: Passing null pointer value to IupStoreAttribute, which dereferences it. Function IupStoreGlobal dereference var

[Iup-users] CID 210642 (#3 of 3): Dereference after null check (FORWARD_NULL)

2018-01-16 Thread Ranier VF
Hi, Multiplie issues found by Coverity Scan. CID 210642 (#3 of 3): Dereference after null check (FORWARD_NULL) file: iup_font.c Function:iupGetFontInfo Vars: size, is_bold, is_italic, is_underline, is_strikeout, typeface, can be NULL according with code: if (size) *size = 0; if (is_bold)

Re: [Iup-users] CID 210631 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)

2018-01-16 Thread Ranier VF
Hi, Actual version of iMatrixExSetPasteFileAttrib, still have a big waste of resources and processing. If iupStrToIntInt != 2, is ok, all steps to read file are lost. Maybe, this is better? --- a\srcmatrixex\iupmatex_clipboard.c Tue Jan 16 14:58:55 2018 +++ b\srcmatrixex\iupmatex_clipboard.c

Re: [Iup-users] CID 210631 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)

2018-01-16 Thread Antonio Scuri
Fixed and committed to SVN. I decided to split the code in two functions. Best, Scuri 2018-01-13 19:07 GMT-02:00 Ranier VF : > Hi, > Multiple issues found by Coverity Scan. > CID 210684: Ignoring number of bytes read (CHECKED_RETURN) > CID 210631 (#1 of 1): Argument

Re: [Iup-users] CID 210626 (#1 of 1): Resource leak (RESOURCE_LEAK)

2018-01-16 Thread Antonio Scuri
Fixed and committed to SVN. Best, Scuri 2018-01-12 17:35 GMT-02:00 Ranier VF : > Hi, > Issue found by Coverity Scan. > > CID 210626 (#1 of 1): Resource leak (RESOURCE_LEAK) > file: iup_ledparse.c > function: iParseFunction > > 6. leaked_storage: Variable attr going