BONOBO_ARG_GET_STRING(a) - no compile and then segv.



Hi,
    my code failed to compile with the macro as defined normally

#define BONOBO_ARG_GET_STRING(a)    (g_assert ((a)->_type->kind ==
CORBA_tk_string),    \
                                     *((CORBA_char **)(a->_value)))

    The compile time error is below.
ViewItem_class.cpp: In function `void ViewItem_set_prop
(BonoboPropertyBag *, const BonoboArg *, unsigned int, void *)':
ViewItem_class.cpp:91: parse error before `do'
ViewItem_class.cpp:91: parse error before `)'
ViewItem_class.cpp:91: parse error before `,'
ViewItem_class.cpp:92: `cs' undeclared (first use this function)
ViewItem_class.cpp:92: (Each undeclared identifier is reported only
once for each function it appears in.)
Line 91 is
const CORBA_char* cs = BONOBO_ARG_GET_STRING(arg);



    When I changed the macro to this

#define BONOBO_ARG_GET_STRING(a)    *((CORBA_char **)(a->_value))

    I gives nothing the first time, junk the second, and a segv the
third
time it is used in my set property function
  const CORBA_char* cs = BONOBO_ARG_GET_STRING(arg);


this is with bonobo 0.32  Build Date: Thu 11 Jan 2001 04:03:33. I will
recompile bonobo
tonite to see if that helps.

--
-----------------------------------------------------------------------
i a/v\ eli+3. P|-|e4/? mE







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]