@@ -141,7 +141,9 @@ static void set_sigint_handler(void) {
141141}
142142#endif /* DUK_CMDLINE_SIGNAL */
143143
144- static int get_stack_raw (duk_context * ctx ) {
144+ static int get_stack_raw (duk_context * ctx , void * udata ) {
145+ (void ) udata ;
146+
145147 if (!duk_is_object (ctx , -1 )) {
146148 return 1 ;
147149 }
@@ -164,17 +166,19 @@ static void print_pop_error(duk_context *ctx, FILE *f) {
164166 * Note that getting the stack trace may throw an error
165167 * so this also needs to be safe call wrapped.
166168 */
167- (void ) duk_safe_call (ctx , get_stack_raw , 1 /*nargs*/ , 1 /*nrets*/ );
169+ (void ) duk_safe_call (ctx , get_stack_raw , NULL /*udata*/ , 1 /*nargs*/ , 1 /*nrets*/ );
168170 fprintf (f , "%s\n" , duk_safe_to_string (ctx , -1 ));
169171 fflush (f );
170172 duk_pop (ctx );
171173}
172174
173- static int wrapped_compile_execute (duk_context * ctx ) {
175+ static int wrapped_compile_execute (duk_context * ctx , void * udata ) {
174176 const char * src_data ;
175177 duk_size_t src_len ;
176178 int comp_flags ;
177179
180+ (void ) udata ;
181+
178182 /* XXX: Here it'd be nice to get some stats for the compilation result
179183 * when a suitable command line is given (e.g. code size, constant
180184 * count, function count. These are available internally but not through
@@ -315,7 +319,7 @@ static int completion_digit(unsigned char c) {
315319 return (c >= (unsigned char ) '0' && c <= (unsigned char ) '9' );
316320}
317321
318- static duk_ret_t linenoise_completion_lookup (duk_context * ctx ) {
322+ static duk_ret_t linenoise_completion_lookup (duk_context * ctx , void * udata ) {
319323 duk_size_t len ;
320324 const char * orig ;
321325 const unsigned char * p ;
@@ -326,6 +330,8 @@ static duk_ret_t linenoise_completion_lookup(duk_context *ctx) {
326330 linenoiseCompletions * lc ;
327331 duk_idx_t idx_obj ;
328332
333+ (void ) udata ;
334+
329335 orig = duk_require_string (ctx , -3 );
330336 p_curr = (const unsigned char * ) duk_require_lstring (ctx , -2 , & len );
331337 p_end = p_curr + len ;
@@ -478,7 +484,7 @@ static void linenoise_completion(const char *buf, linenoiseCompletions *lc) {
478484 duk_push_lstring (ctx , (const char * ) p , (duk_size_t ) (p_end - p ));
479485 duk_push_pointer (ctx , (void * ) lc );
480486
481- rc = duk_safe_call (ctx , linenoise_completion_lookup , 3 /*nargs*/ , 1 /*nrets*/ );
487+ rc = duk_safe_call (ctx , linenoise_completion_lookup , NULL /*udata*/ , 3 /*nargs*/ , 1 /*nrets*/ );
482488 if (rc != DUK_EXEC_SUCCESS ) {
483489 fprintf (stderr , "Completion handling failure: %s\n" , duk_safe_to_string (ctx , -1 ));
484490 }
@@ -586,7 +592,7 @@ static int handle_fh(duk_context *ctx, FILE *f, const char *filename, const char
586592
587593 interactive_mode = 0 ; /* global */
588594
589- rc = duk_safe_call (ctx , wrapped_compile_execute , 4 /*nargs*/ , 1 /*nret*/ );
595+ rc = duk_safe_call (ctx , wrapped_compile_execute , NULL /*udata*/ , 4 /*nargs*/ , 1 /*nret*/ );
590596
591597#if defined(DUK_CMDLINE_AJSHEAP )
592598 ajsheap_clear_exec_timeout ();
@@ -664,7 +670,7 @@ static int handle_eval(duk_context *ctx, char *code) {
664670
665671 interactive_mode = 0 ; /* global */
666672
667- rc = duk_safe_call (ctx , wrapped_compile_execute , 3 /*nargs*/ , 1 /*nret*/ );
673+ rc = duk_safe_call (ctx , wrapped_compile_execute , NULL /*udata*/ , 3 /*nargs*/ , 1 /*nret*/ );
668674
669675#if defined(DUK_CMDLINE_AJSHEAP )
670676 ajsheap_clear_exec_timeout ();
@@ -724,7 +730,7 @@ static int handle_interactive(duk_context *ctx) {
724730
725731 interactive_mode = 1 ; /* global */
726732
727- rc = duk_safe_call (ctx , wrapped_compile_execute , 3 /*nargs*/ , 1 /*nret*/ );
733+ rc = duk_safe_call (ctx , wrapped_compile_execute , NULL /*udata*/ , 3 /*nargs*/ , 1 /*nret*/ );
728734
729735#if defined(DUK_CMDLINE_AJSHEAP )
730736 ajsheap_clear_exec_timeout ();
@@ -799,7 +805,7 @@ static int handle_interactive(duk_context *ctx) {
799805
800806 interactive_mode = 1 ; /* global */
801807
802- rc = duk_safe_call (ctx , wrapped_compile_execute , 3 /*nargs*/ , 1 /*nret*/ );
808+ rc = duk_safe_call (ctx , wrapped_compile_execute , NULL /*udata*/ , 3 /*nargs*/ , 1 /*nret*/ );
803809
804810#if defined(DUK_CMDLINE_AJSHEAP )
805811 ajsheap_clear_exec_timeout ();
0 commit comments