Browse files

cosmetic tweak

  • Loading branch information...
1 parent 45ec003 commit fb9341dfb22b3aa2d39a7c51f9dbe27bd88ffa5c @richcarl richcarl committed with Eric Merritt Jul 25, 2010
View
5 chapter_12/plain_port/json_parser/c_src/jp_prog.c
@@ -285,12 +285,11 @@ static int handle_end(void *ctx, int array)
{
state_t *st = (state_t *)ctx;
container_t *c = st->c;
- int index = st->c->index; /* temporary variable needed */
/* back-patch the header */
if (array) {
- ei_encode_tuple_header(st->x.buff, &index, st->c->count);
+ ei_encode_tuple_header(st->x.buff, &st->c->index, st->c->count);
} else {
- ei_encode_list_header(st->x.buff, &index, st->c->count);
+ ei_encode_list_header(st->x.buff, &st->c->index, st->c->count);
ei_x_encode_empty_list(&st->x); /* also terminate the list */
}
/* unlink and decallocate container struct */
View
5 chapter_12/port_driver/json_parser/c_src/jp_driver.c
@@ -304,12 +304,11 @@ static int handle_end(void *ctx, int array)
{
state_t *st = (state_t *)ctx;
container_t *c = st->c;
- int index = st->c->index; /* temporary variable needed */
/* back-patch the header */
if (array) {
- ei_encode_tuple_header(st->x.buff, &index, st->c->count);
+ ei_encode_tuple_header(st->x.buff, &st->c->index, st->c->count);
} else {
- ei_encode_list_header(st->x.buff, &index, st->c->count);
+ ei_encode_list_header(st->x.buff, &st->c->index, st->c->count);
ei_x_encode_empty_list(&st->x); /* also terminate the list */
}
/* unlink and decallocate container struct */

0 comments on commit fb9341d

Please sign in to comment.