Commit fca90104 authored by ale's avatar ale

Build with -Wall -Werror

And fix a couple of related warnings.
parent 47631740
AM_CPPFLAGS = -I$(top_srcdir)/engine $(SNDFILE_CFLAGS) $(SAMPLERATE_CFLAGS)
AM_CPPFLAGS = -Wall -Werror -I$(top_srcdir)/engine $(SNDFILE_CFLAGS) $(SAMPLERATE_CFLAGS)
noinst_LTLIBRARIES = libengine.la
......
......@@ -35,7 +35,7 @@ int main(int argc, char **argv) {
struct voice voice;
struct instrument *ins;
struct layer *layer;
float *out_l, *out_r;
float *out_l = NULL, *out_r = NULL;
int total_samples;
int lead_samples = 100;
int note_samples = 100000;
......@@ -88,8 +88,10 @@ int main(int argc, char **argv) {
write_sample("out.wav", out_l, out_r, total_samples);
cleanup:
free(out_l);
free(out_r);
if (out_l)
free(out_l);
if (out_r)
free(out_r);
drumkit_free(&kit);
/*
......
......@@ -473,7 +473,7 @@ int drumkit_load(struct drumkit *kit, const char *filename, int target_samplerat
// libxml2 to parse it anyway by setting the proper namespace on all
// elements.
root_element = xmlDocGetRootElement(doc);
if (!strcmp(root_element->name, "drumkit_info") && root_element->ns == NULL) {
if (!strcmp((const char *)root_element->name, "drumkit_info") && root_element->ns == NULL) {
fprintf(stderr, "spotted old-style (bad) XML\n");
ns = xmlNewNs(root_element, (xmlChar *)"http://www.hydrogen-music.org/drumkit", (xmlChar *)"");
fix_bad_xml(root_element, ns);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment