slang-devel mailing list

[2020 Date Index] [2020 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-devel] Re: [slang-users] Bugs in SLgtk functions


Bernd Eggink <bernd.eggink@xxxxxxxxxx> wrote:
> I found what I think are bugs in gtk_progress_bar_set_fraction() and in
> gtk_progress_bar_pulse(). According to the GTK reference manual the GTK
> functions are defined as
>
> 	void gtk_progress_bar_set_fraction(...)
> 	void gtk_progress_bar_pulse(...)

What version of the GTK library are you using, and what version of
slirp did you use to generate the wrappers?  The header file that is
distributed with gtk-2.0 contains:

void       gtk_progress_bar_set_fraction         (GtkProgressBar *pbar,
                                                  gdouble         fraction);
void       gtk_progress_bar_pulse                (GtkProgressBar *pbar);

> However, the SLgtk function gtk_progress_bar_set_fraction() leaves two
> NULL values on the stack, and gtk_progress_bar_pulse() leaves one NULL
> value. So, when these functions are called very often, the stack gets
> quickly populated until a stack overflow occurs.

How are you calling these functions?  The slirp-generated wrappers
look ok to me:

static void sl_gtk_progress_bar_set_fraction (void)
{
   GtkProgressBar* arg1;
   Slirp_Opaque* arg1_o = NULL;
   gdouble arg2;
   int issue_usage = 1;

   if (SLang_Num_Function_Args != 2) goto usage_label;
   if (-1 == SLang_pop_double((double*)&arg2)) goto usage_label;
   if (-1 == SLang_pop_opaque(GtkWidget_Type, (void**)&arg1, &arg1_o)) goto usage_label;
   issue_usage = 0;

   gtk_progress_bar_set_fraction(arg1,  arg2);
   goto free_and_return;
free_and_return:
   /* drop */
   SLang_free_opaque(arg1_o);
usage_label:
   if (issue_usage) Slirp_usage (10, 10, 0);
}

static void sl_gtk_progress_bar_pulse (void)
{
   GtkProgressBar* arg1;
   Slirp_Opaque* arg1_o = NULL;
   int issue_usage = 1;

   if (SLang_Num_Function_Args != 1) goto usage_label;
   if (-1 == SLang_pop_opaque(GtkWidget_Type, (void**)&arg1, &arg1_o)) goto usage_label;
   issue_usage = 0;

   gtk_progress_bar_pulse(arg1);
   goto free_and_return;
free_and_return:
   /* drop */
   SLang_free_opaque(arg1_o);
usage_label:
   if (issue_usage) Slirp_usage (1517, 1517, 0);
}

Thanks,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


[2020 date index] [2020 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]