[iface/nips/nips_vm]

Kill a warning on Ubuntu.

* interactive.c (interactive_simulate): Explicitly ignore the
return of scanf to kill a warning.
This commit is contained in:
Alexandre Duret-Lutz 2010-01-21 16:00:10 +01:00
parent a6b9583628
commit bfadcf8021
2 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2010-01-21 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Kill a warning on Ubuntu.
* interactive.c (interactive_simulate): Explicitly ignore the
return of scanf to kill a warning.
2007-03-27 Michael Weber <michaelw@foldr.org> 2007-03-27 Michael Weber <michaelw@foldr.org>
* Released version 1.2.7 * Released version 1.2.7
@ -43,7 +50,7 @@
* tests/spin/pftp: commented out unused variable * tests/spin/pftp: commented out unused variable
* bytecode.h, bytecode.c (bytecode_str_inf): added interface to * bytecode.h, bytecode.c (bytecode_str_inf): added interface to
query structure information. query structure information.
TODO: use binary search to find record. TODO: use binary search to find record.
TODO: adapt interface for bytecode_src_loc TODO: adapt interface for bytecode_src_loc
@ -79,7 +86,7 @@
sections sections
* timeval.h: shift platform specifics here, just include if needed * timeval.h: shift platform specifics here, just include if needed
* instr_step.c: conditionalize on SMALLSTACK * instr_step.c: conditionalize on SMALLSTACK
2006-03-09 Michael Weber <michaelw@foldr.org> 2006-03-09 Michael Weber <michaelw@foldr.org>
* hashtab.c (hashtab_hash): fixed signedness oversight * hashtab.c (hashtab_hash): fixed signedness oversight
@ -112,12 +119,12 @@
* nips_asm_instr.pl (get_instructions): tag instructions whether * nips_asm_instr.pl (get_instructions): tag instructions whether
they change control-flow or yield errors. they change control-flow or yield errors.
(instruction_cfun): bytecode to C-function name mapping (instruction_cfun): bytecode to C-function name mapping
* instr.c (instr_ldc): renamed from instr_load_constant to match * instr.c (instr_ldc): renamed from instr_load_constant to match
functions names generated by disassembler script functions names generated by disassembler script
(instr_trunc): renamed from instr_truncate (instr_trunc): renamed from instr_truncate
(instr_exec): replaced occurrences of renamed functions (instr_exec): replaced occurrences of renamed functions
2006-02-15 Michael Weber <michaelw@foldr.org> 2006-02-15 Michael Weber <michaelw@foldr.org>
* nips_asm.pl: collate flags for the same address instead of * nips_asm.pl: collate flags for the same address instead of
@ -146,7 +153,7 @@
* search.c (t_search_context, search, search_succ_cb): count * search.c (t_search_context, search, search_succ_cb): count
transitions transitions
* nipsvm.h (nipsvm_state_monitor_accepting) * nipsvm.h (nipsvm_state_monitor_accepting)
(nipsvm_state_monitor_terminated) (nipsvm_state_monitor_terminated)
(nipsvm_state_monitor_acc_or_term): added (nipsvm_state_monitor_acc_or_term): added
@ -186,8 +193,8 @@
* Makefile: added -g option by default, removed rt_err.o from * Makefile: added -g option by default, removed rt_err.o from
libnips_vm (not needed) libnips_vm (not needed)
2005-10-11, 2005-10-12 2005-10-11, 2005-10-12
---------------------- ----------------------
added range errors in assembler added range errors in assembler

View file

@ -132,7 +132,7 @@ void interactive_simulate( nipsvm_bytecode_t *bytecode,
} }
else else
{ {
// show successor states // show successor states
printf( "\n=== %ld successor state%s ===\n", cnt, cnt == 1 ? "" : "s" ); printf( "\n=== %ld successor state%s ===\n", cnt, cnt == 1 ? "" : "s" );
for( i = 0; i < cnt; i++ ) for( i = 0; i < cnt; i++ )
@ -176,7 +176,7 @@ void interactive_simulate( nipsvm_bytecode_t *bytecode,
else else
printf( "enter state number (1..%ld) or anything else to quit: ", cnt ); printf( "enter state number (1..%ld) or anything else to quit: ", cnt );
fflush( stdout ); fflush( stdout );
scanf( "%lu", &sel ); (void) scanf( "%lu", &sel );
printf( "\n" ); printf( "\n" );
sel--; // convert to 0 based index sel--; // convert to 0 based index
@ -191,7 +191,7 @@ void interactive_simulate( nipsvm_bytecode_t *bytecode,
// keep flag register of selected state (just for testing) // keep flag register of selected state (just for testing)
flag_reg = states[sel].flag_reg; flag_reg = states[sel].flag_reg;
// move selected state to beginning of buffer and use it as current state // move selected state to beginning of buffer and use it as current state
len = nipsvm_state_size( states[sel].p_state ); len = nipsvm_state_size( states[sel].p_state );
memmove( p_buffer, states[sel].p_state, len ); memmove( p_buffer, states[sel].p_state, len );