From efe4a24b7eb328ace6fb442c99e0041b0ca9b14b Mon Sep 17 00:00:00 2001 From: "osboxes.org" Date: Mon, 9 Mar 2015 09:07:49 -0600 Subject: [PATCH] got rid of compile warnings, added -Wall to AM_CFLAGS for now --- Makefile.am | 2 +- Makefile.in | 2 +- filters.c | 2 +- flam3-convert.c | 5 ++--- flam3-genome.c | 4 +--- flam3-render.c | 4 +--- flam3.c | 5 ++--- interpolation.c | 2 +- jpeg.c | 3 +-- libtool | 2 +- palettes.c | 2 +- parser.c | 23 +++++++++++------------ variations.c | 5 +---- 13 files changed, 25 insertions(+), 36 deletions(-) diff --git a/Makefile.am b/Makefile.am index 50faba6..0cd62a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"' -AM_CFLAGS = -g -O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fvect-cost-model -ftree-partial-pre -fipa-cp-clone -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) +AM_CFLAGS = -g -O2 -Wall -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fvect-cost-model -ftree-partial-pre -fipa-cp-clone -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) ACLOCAL_AMFLAGS = -I m4 diff --git a/Makefile.in b/Makefile.in index 0cc1375..ccb598a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -360,7 +360,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies SVN_DEF = -D'SVN_REV="$(shell svnversion -n .)"' -AM_CFLAGS = -g -O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fvect-cost-model -ftree-partial-pre -fipa-cp-clone -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) +AM_CFLAGS = -g -O2 -Wall -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fvect-cost-model -ftree-partial-pre -fipa-cp-clone -std=gnu99 -ffast-math -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" $(SVN_DEF) ACLOCAL_AMFLAGS = -I m4 man1_MANS = flam3-animate.man flam3-genome.man flam3-render.man flam3-convert.man lib_LTLIBRARIES = libflam3.la diff --git a/filters.c b/filters.c index 1af5d4a..4e400c8 100644 --- a/filters.c +++ b/filters.c @@ -197,7 +197,7 @@ double flam3_spatial_filter(int knum, double x) { return flam3_lanczos3_filter(x)*flam3_sinc(x/3.0); else if (knum==12) return flam3_lanczos2_filter(x)*flam3_sinc(x/2.0); - else if (knum==13) + else // if (knum==13) return flam3_quadratic_filter(x); } diff --git a/flam3-convert.c b/flam3-convert.c index 3062a4b..279ef71 100644 --- a/flam3-convert.c +++ b/flam3-convert.c @@ -71,9 +71,9 @@ void tokenize(ss, argv, argc) void parse_control_point_old(char **ss, flam3_genome *cp) { char *argv[MAXARGS]; int argc, i, j; - int set_cm = 0, set_image_size = 0, set_nbatches = 0, set_white_level = 0, set_cmap_inter = 0; + int set_cm = 0, set_image_size = 0, set_nbatches = 0, set_white_level = 0; int set_spatial_oversample = 0, set_hr = 0; - double *slot, xf, cm, t, nbatches, white_level, spatial_oversample, cmap_inter; + double *slot = NULL, xf, cm, t, nbatches, white_level, spatial_oversample, cmap_inter; double image_size[2]; memset(cp, 0, sizeof(flam3_genome)); @@ -153,7 +153,6 @@ void parse_control_point_old(char **ss, flam3_genome *cp) { slot = cp->xform[(int)xf].var; else if (streql("cmap_inter", argv[i])) { slot = &cmap_inter; - set_cmap_inter = 1; } else *slot++ = atof(argv[i]); } diff --git a/flam3-genome.c b/flam3-genome.c index 8bd1684..3b6ea41 100644 --- a/flam3-genome.c +++ b/flam3-genome.c @@ -383,7 +383,6 @@ static void print_find_parents(xmlNode *node, int last, int level) { xmlAttrPtr att_ptr, cur_att; xmlNodePtr chld_ptr=NULL, cur_chld=NULL; xmlNode *this_node; - int i; int next_last; //for (i = 0; i < level; i++) // fprintf(stdout, "+"); @@ -748,7 +747,7 @@ main(argc, argv) if (sequence) { - double blend, spread; + double blend; int seqflag; int framecount; @@ -760,7 +759,6 @@ main(argc, argv) cp = string_to_cp(sequence, &ncp, flam3_defaults_on); if (enclosed) printf("\n", flam3_version()); - spread = 1.0/nframes; framecount = 0; #if 1 for (i = 0; i < ncp; i++) { diff --git a/flam3-render.c b/flam3-render.c index ddab377..80451f2 100644 --- a/flam3-render.c +++ b/flam3-render.c @@ -118,7 +118,7 @@ int main(int argc, char **argv) { double imgmem; unsigned int strip; double center_y, center_base; - unsigned int nstrips; + unsigned int nstrips = 1; randctx savectx; char *prefix = args("prefix", ""); char *out = args("out", NULL); @@ -126,7 +126,6 @@ int main(int argc, char **argv) { int verbose = argi("verbose", 1); int bits = argi("bits", 33); int bpc = argi("bpc",8); - int seed = argi("seed", 0); int transparency = argi("transparency", 0); char *inf = getenv("in"); double qs = argf("qs", 1.0); @@ -249,7 +248,6 @@ int main(int argc, char **argv) { "to one file. all but last will be lost.\n"); } - for (i = 0; i < ncps; i++) { int real_height; diff --git a/flam3.c b/flam3.c index 3ab6b89..e0e6aa5 100644 --- a/flam3.c +++ b/flam3.c @@ -1628,7 +1628,6 @@ char *flam3_print_to_string(flam3_genome *cp) { char *genome_string; int using_tmpdir = 0; - char *tmp_path; char tmpnam[256]; tmpflame = tmpfile(); @@ -2650,7 +2649,7 @@ void add_to_action(char *action, char *addtoaction) { void flam3_cross(flam3_genome *cp0, flam3_genome *cp1, flam3_genome *out, int cross_mode, randctx *rc, char *action) { - int i0,i1, i,j, rb; + int i,j, rb; char ministr[10]; if (cross_mode == CROSS_NOT_SPECIFIED) { @@ -3064,7 +3063,7 @@ static int random_varn(int n) { void flam3_random(flam3_genome *cp, int *ivars, int ivars_n, int sym, int spec_xforms) { - int i, j, nxforms, var, samed, multid, samepost, postid, addfinal=0; + int i, nxforms, var, samed, multid, samepost, postid, addfinal=0; int finum = -1; int n; char *ai; diff --git a/interpolation.c b/interpolation.c index 0a8525d..0cfe668 100644 --- a/interpolation.c +++ b/interpolation.c @@ -513,7 +513,7 @@ void flam3_interpolate_n(flam3_genome *result, int ncp, /* Interpolate each xform */ for (i = 0; i < cpi[0].num_xforms; i++) { - double csave[2]; + double csave[2] = {0, 0}; double td; int all_id; int nx = cpi[0].num_xforms-(cpi[0].final_xform_index>=0); diff --git a/jpeg.c b/jpeg.c index 218f1be..f309993 100644 --- a/jpeg.c +++ b/jpeg.c @@ -102,7 +102,6 @@ write_jpeg(FILE *file, unsigned char *image, int width, int height, flam3_img_co unsigned char *read_jpeg(FILE *ifp, int *width, int *height) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; - int num_scanlines; unsigned char *p, *q, *t; cinfo.err = jpeg_std_error(&jerr); @@ -126,7 +125,7 @@ unsigned char *read_jpeg(FILE *ifp, int *width, int *height) { while (cinfo.output_scanline < cinfo.output_height) { unsigned char *s = t; int i; - num_scanlines = jpeg_read_scanlines(&cinfo, &t, 1); + jpeg_read_scanlines(&cinfo, &t, 1); for (i = 0; i < *width; i++) { p[0] = s[0]; p[1] = s[1]; diff --git a/libtool b/libtool index ca5fb46..1cdbc45 100755 --- a/libtool +++ b/libtool @@ -86,7 +86,7 @@ NM="/usr/bin/nm -B" LN_S="ln -s" # What is the maximum length of a command? -max_cmd_len=1572864 +max_cmd_len=3458764513820540925 # Object file suffix (normally "o"). objext=o diff --git a/palettes.c b/palettes.c index 3b0c26f..3447828 100644 --- a/palettes.c +++ b/palettes.c @@ -26,7 +26,7 @@ static void parse_palettes(xmlNode *node) { xmlAttrPtr attr; char *val; lib_palette *pal; - int hex_error; + int hex_error = 0; while (node) { if (node->type == XML_ELEMENT_NODE && !xmlStrcmp(node->name, (const xmlChar *)"palette")) { diff --git a/parser.c b/parser.c index fdb3d45..ff5b51a 100644 --- a/parser.c +++ b/parser.c @@ -142,7 +142,8 @@ int flam3_interp_missing_colors(flam3_genome *cp) { int str,enr; int i,j,k; double prcr; - + + minix = 0; for (i=0; i<256; i++) { if (cp->palette[i].index >= 0) { minix = i; @@ -158,7 +159,8 @@ int flam3_interp_missing_colors(flam3_genome *cp) { } wrapmin = minix + 256; - + + maxix = 255; for (i=255;i>=0;i--) { if (cp->palette[i].index >= 0) { maxix = i; @@ -176,7 +178,9 @@ int flam3_interp_missing_colors(flam3_genome *cp) { /* Start of a range of negs */ str = i; intl = i-1; + intr = i+1; colorli = intl; + colorri = intr; while (cp->palette[i].index<0 && i<256) { enr = i; intr = i+1; @@ -290,7 +294,7 @@ int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp) { char *att_str; int num_std_xforms=-1; char tmps[2]; - int i,j; + int i; flam3_xform tmpcpy; flam3_chaos_entry *xaos=NULL; int num_xaos=0; @@ -554,7 +558,7 @@ int parse_flame_element(xmlNode *flame_node, flam3_genome *loc_current_cp) { } } else if (!xmlStrcmp(chld_node->name, (const xmlChar *)"colors")) { - int count; + int count = 0; /* Loop through the attributes of the colors element */ att_ptr = chld_node->properties; @@ -1255,14 +1259,14 @@ void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting) { int ti,strl; xmlAttrPtr att_ptr=NULL,cur_att=NULL; xmlNodePtr chld_ptr=NULL, cur_chld=NULL; - int edit_or_sheep = 0, indent_printed = 0; + int indent_printed = 0; char *ai; int tablim = argi("print_edit_depth",0); char *att_str,*cont_str,*cpy_string; if (tablim>0 && tabs>tablim) - return; + return; /* If this node is an XML_ELEMENT_NODE, print it and it's attributes */ if (editNode->type==XML_ELEMENT_NODE) { @@ -1278,13 +1282,8 @@ void flam3_edit_print(FILE *f, xmlNodePtr editNode, int tabs, int formatting) { /* This can either be an edit node or a sheep node */ /* If it's an edit node, add one to the tab */ if (!xmlStrcmp(editNode->name, (const xmlChar *)"edit")) { - edit_or_sheep = 1; tabs ++; - } else if (!xmlStrcmp(editNode->name, (const xmlChar *)"sheep")) - edit_or_sheep = 2; - else - edit_or_sheep = 0; - + } /* Print the attributes */ att_ptr = editNode->properties; diff --git a/variations.c b/variations.c index cc5c4c3..d83bf60 100644 --- a/variations.c +++ b/variations.c @@ -1916,9 +1916,6 @@ void var97_flux (flam3_iter_helper *f, double weight) { double avgr = weight * (2 + f->xform->flux_spread) * sqrt( sqrt(f->ty*f->ty + xpw*xpw) / sqrt(f->ty*f->ty + xmw*xmw)); double avga = ( atan2(f->ty, xmw) - atan2(f->ty,xpw) ) * 0.5; - double s = sin(avga); - double c = cos(avga); - f->p0 += avgr * cos(avga); f->p1 += avgr * sin(avga); } @@ -2133,7 +2130,7 @@ int apply_xform(flam3_genome *cp, int fn, double *p, double *q, randctx *rc) { flam3_iter_helper f; int var_n; - double next_color,s,s1; + double s1; double weight; f.rc = rc;