Skip to content

Commit

Permalink
Enable more compiler warnings and fix them.
Browse files Browse the repository at this point in the history
  • Loading branch information
stump committed Jul 23, 2013
1 parent 95fe202 commit 84d335f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
CFLAGS="$CFLAGS -W -Wall -Wno-sign-compare" # that last one's a project for another day
LT_INIT

# Checks for libraries.
Expand Down
1 change: 1 addition & 0 deletions src/smf.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ smf_skip_next_event(smf_t *smf)
void *notused;

notused = smf_get_next_event(smf);
(void) notused;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/smf_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ extract_sysex_event(const unsigned char *buf, const int buffer_length, smf_event
{
int status, message_length, vlq_length;
const unsigned char *c = buf;
(void) last_status;

status = *buf;

Expand Down Expand Up @@ -430,6 +431,7 @@ extract_escaped_event(const unsigned char *buf, const int buffer_length, smf_eve
{
int status, message_length, vlq_length;
const unsigned char *c = buf;
(void) last_status;

status = *buf;

Expand Down
12 changes: 11 additions & 1 deletion src/smfsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ char *last_file_name = NULL;
static void
log_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer notused)
{
(void) notused;
if (strcmp(log_domain, "smfsh") == 0)
fprintf(stderr, "%s\n", message);
else
Expand Down Expand Up @@ -220,6 +221,7 @@ cmd_format(char *new_format)
static int
cmd_tracks(char *notused)
{
(void) notused;
if (smf->number_of_tracks > 0)
g_message("There are %d tracks, numbered from 1 to %d.", smf->number_of_tracks, smf->number_of_tracks);
else
Expand Down Expand Up @@ -301,6 +303,7 @@ cmd_track(char *arg)
static int
cmd_trackadd(char *notused)
{
(void) notused;
selected_track = smf_track_new();
if (selected_track == NULL) {
g_critical("smf_track_new() failed, track not created.");
Expand Down Expand Up @@ -376,6 +379,7 @@ static int
cmd_events(char *notused)
{
smf_event_t *event;
(void) notused;

if (selected_track == NULL) {
g_critical("No track selected - please use 'track <number>' command first.");
Expand Down Expand Up @@ -718,6 +722,7 @@ cmd_tempo(char *notused)
{
int i;
smf_tempo_t *tempo;
(void) notused;

for (i = 0;; i++) {
tempo = smf_get_tempo_by_number(smf, i);
Expand All @@ -737,6 +742,7 @@ cmd_tempo(char *notused)
static int
cmd_length(char *notused)
{
(void) notused;
g_message("Length: %d pulses, %f seconds.", smf_get_length_pulses(smf), smf_get_length_seconds(smf));

return (0);
Expand All @@ -745,6 +751,7 @@ cmd_length(char *notused)
static int
cmd_version(char *notused)
{
(void) notused;
g_message("libsmf version %s.", smf_get_version());

return (0);
Expand All @@ -753,6 +760,7 @@ cmd_version(char *notused)
static int
cmd_exit(char *notused)
{
(void) notused;
g_debug("Good bye.");
exit(0);
}
Expand All @@ -766,7 +774,7 @@ static struct command_struct {
} commands[] = {{"help", cmd_help, "Show this help."},
{"?", cmd_help, NULL},
{"load", cmd_load, "Load named file."},
{"open", cmd_load},
{"open", cmd_load, NULL},
{"save", cmd_save, "Save to named file."},
{"ppqn", cmd_ppqn, "Show ppqn (aka division), or set ppqn if used with parameter."},
{"format", cmd_format, "Show format, or set format if used with parameter."},
Expand Down Expand Up @@ -797,6 +805,7 @@ cmd_help(char *notused)
int i, padding_length;
char padding[COMMAND_LENGTH + 1];
struct command_struct *tmp;
(void) notused;

g_message("Available commands:");

Expand Down Expand Up @@ -971,6 +980,7 @@ static char **
smfsh_completion(const char *text, int start, int end)
{
int i;
(void) end;

/* Return NULL if "text" is not the first word in the input line. */
if (start != 0) {
Expand Down

0 comments on commit 84d335f

Please sign in to comment.