Skip to content

Commit

Permalink
Merge pull request #30 from udo-stenzel/master
Browse files Browse the repository at this point in the history
changed update_spinner to 'static inline'
  • Loading branch information
jstjohn committed Mar 18, 2016
2 parents b670dc6 + 4bad2ab commit bda7a3d
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions SeqPrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,33 +79,19 @@ void help ( char *prog_name ) {
exit( 1 );
}

static unsigned short spcount = 0;
/**
* Have a nice spinner to give you a false sense of hope
*/
extern inline void update_spinner(unsigned long long num_reads){
static inline void update_spinner(unsigned long long num_reads){
static unsigned short spcount = 0;

if(num_reads == 0){
fprintf(stderr,"Processing reads... |");
fflush(stderr);
}else if (num_reads % SPIN_INTERVAL == 0){
switch(spcount % 4){
case 0:
fprintf(stderr,"\b/");
fflush(stderr);
break;
case 1:
fprintf(stderr,"\b-");
fflush(stderr);
break;
case 2:
fprintf(stderr,"\b\\");
fflush(stderr);
break;
default:
fprintf(stderr,"\b|");
fflush(stderr);
break;
}
putc('\b',stderr);
putc("/-\\|"[spcount % 4],stderr);
fflush(stderr);
spcount++;
}
}
Expand Down

0 comments on commit bda7a3d

Please sign in to comment.