Skip to content

Commit

Permalink
Slightly more elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jun 14, 2016
1 parent debfe97 commit 104490d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/yajl/yajl_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,13 @@ void yajl_tree_free (yajl_val v)
* Stuff below added by Jeroen to support push parsing over connection interface.
*/

unsigned char mem_callbacks[sizeof(yajl_callbacks)];
unsigned char mem_ctx[sizeof(context_t)];
yajl_callbacks mem_callbacks;
context_t mem_ctx;

yajl_handle push_parser_new () {

/* init callback handlers */
yajl_callbacks *callbacks = (yajl_callbacks*) mem_callbacks;
yajl_callbacks *callbacks = &mem_callbacks;
memset(callbacks, 0, sizeof(yajl_callbacks));

callbacks->yajl_null = handle_null;
Expand All @@ -539,7 +539,7 @@ yajl_handle push_parser_new () {
callbacks->yajl_end_array = handle_end_array;

/* init context */
context_t *ctx = (context_t*) mem_ctx;
context_t *ctx = &mem_ctx;
memset(ctx, 0, sizeof(context_t));

/* init handle */
Expand Down

0 comments on commit 104490d

Please sign in to comment.