Hi Joseph, all!
Sergei Golubchik wrote:
> Hi, Joseph!
>
> On Jul 07, Joseph Lukas wrote:
>> I am having an issues getting through my loop for the List.
>>
>> int sql_statement_set(THD *thd, List<set_var_base> *var_list){
>>
>> List_iterator_fast<set_var_base> it(*var_list);
>> DBUG_ENTER("sql_set_variables");
>> int count = 0;
>> set_var_base *var;
>> while ((var=it++))
>> {
>> count++;
>> printf("I looped");
>> }
>> printf("The number of objects is: %d \n",count);
>> return 0;
>
> if you use DBUG_ENTER() you need to use DBUG_RETURN (or
> DBUG_VOID_RETURN) - these always should be paired.
Also, you should have the declarations of all variables *before* the
DBUG_ENTER(), because this macro will (when doing a debug build) expand
to an executable statement.
There are compilers that consider a variable declaration after an
executable statement to be a syntax error, so your current code sequence
is not fully portable.
>
>> }
>>
>> [[...]]
Regards,
Jörg
--
Joerg Bruehe, MySQL Build Team, Joerg.Bruehe@stripped
Sun Microsystems GmbH, Komturstraße 18a, D-12099 Berlin
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Haering Muenchen: HRB161028