On Fri, Jul 1, 2011 at 09:14, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx> wrote:
>> +/* from libxl_json */
>> +typedef enum {
>> + JSON_ERROR,
>> + JSON_NULL,
>> + JSON_TRUE,
>> + JSON_FALSE,
>> + JSON_INTEGER,
>> + JSON_DOUBLE,
>> + JSON_STRING,
>> + JSON_MAP,
>> + JSON_ARRAY,
>> + JSON_ANY
>> +} libxl__json_node_type;
>
> Could be internal IDL? Maybe no much point if you aren't using the
> to_string functions etc?
The to_string function could be use for debug messages. But that all.
>> +
>> +typedef struct libxl__json_object {
>> + libxl__json_node_type type;
>> + union {
>> + long i;
>> + double d;
>> + const char *string;
>
> Is it really const? Seems to be malloc/freed?
Yes, the string belong only to this structure. In that case, there is no const ?
>> [...]+#ifdef DEBUG_ANSWER
>> +# define DEBUG_GEN_ALLOC(h) \
>> + if (h == NULL) { \
>> + yajl_gen_config conf = { 1, " " }; \
>> + h = yajl_gen_alloc(&conf, NULL); \
>> + }
>
> All the callers of these macros use ctx->g. I think you could push the
> ->g down into the macros.
Yes, maybe better, specially for the case of the _alloc where the
parameter is modified.
Thanks,
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|