Four instances where 'default:' is at the end of a block replaced with 'default: break;' (reported by mscherer). One typo where [j] should have been [1] (array out of bounds error). Missing <unistd.h> includes for _exit(), and <string.h> for memcpy().
66 lines
1.0 KiB
C
66 lines
1.0 KiB
C
/* this file is a part of amp software
|
|
|
|
util.c: created by Andrew Richards
|
|
|
|
*/
|
|
|
|
#define AMP_UTIL
|
|
#include "amp.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include "audio.h"
|
|
|
|
/* die - for terminal conditions prints the error message and exits */
|
|
/* can not be suppressed with -q,-quiet */
|
|
void
|
|
die(char *fmt, ...)
|
|
{
|
|
#if 0
|
|
va_list ap;
|
|
va_start(ap,fmt);
|
|
vfprintf(stderr, fmt, ap);
|
|
#endif
|
|
_exit(-1);
|
|
}
|
|
|
|
|
|
/* warn - for warning messages. Can be suppressed by -q,-quiet */
|
|
void
|
|
warn(char *fmt, ...)
|
|
{
|
|
#if 0
|
|
va_list ap;
|
|
va_start(ap,fmt);
|
|
if (!A_QUIET) {
|
|
fprintf(stderr,"Warning: ");
|
|
vfprintf(stderr, fmt, ap);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
|
|
/* msg - for general output. Can be suppressed by -q,-quiet. Output */
|
|
/* goes to stderr so it doesn't conflict with stdout output */
|
|
void
|
|
msg(char *fmt, ...)
|
|
{
|
|
#if 0
|
|
va_list ap;
|
|
va_start(ap,fmt);
|
|
|
|
if (!A_QUIET)
|
|
if (A_MSG_STDOUT) {
|
|
vfprintf(stdout, fmt, ap);
|
|
fflush(stdout);
|
|
} else {
|
|
vfprintf(stderr, fmt, ap);
|
|
fflush(stderr);
|
|
}
|
|
#endif
|
|
}
|
|
|