From f180cc819f0ae6312dde6270314f85723e90f280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 8 Sep 2014 09:46:08 +0000 Subject: getting rid of compiler-warnings svn path=/trunk/externals/iem/iemmatrix/; revision=17345 --- src/mtx_conv.c | 4 ++-- src/mtx_dispersive_dline.c | 2 +- src/mtx_fill.c | 2 ++ src/mtx_qhull/entry.h | 2 +- src/mtx_qhull/list.c | 5 +++-- src/mtx_qhull/zhull.c | 14 +++++++------- src/mtx_reverse.c | 13 +++++++------ 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/mtx_conv.c b/src/mtx_conv.c index de1e260..8ab49c8 100644 --- a/src/mtx_conv.c +++ b/src/mtx_conv.c @@ -53,8 +53,8 @@ static void getTFloatMatrix (int rows, int columns, t_float ***mtx, t_float **ar if (!size) return; - if (*array=ptr=(t_float *)calloc(size, sizeof(t_float))) { - if (*mtx=dptr=(t_float **)calloc(rows, sizeof(t_float *))) { + if ((*array=ptr=(t_float *)calloc(size, sizeof(t_float)))) { + if ((*mtx=dptr=(t_float **)calloc(rows, sizeof(t_float *)))) { for(;rows-- ; ptr+=columns) { *dptr++ = ptr; } diff --git a/src/mtx_dispersive_dline.c b/src/mtx_dispersive_dline.c index a016336..649ceab 100644 --- a/src/mtx_dispersive_dline.c +++ b/src/mtx_dispersive_dline.c @@ -141,7 +141,7 @@ static void mtx_dispersive_dline_resize(t_mtx_dispersive_dline *x, t_symbol *s, } } -static allpass_chain_cycle (t_float x, t_float *y, t_float *z, int n, t_float a) { +static void allpass_chain_cycle (t_float x, t_float *y, t_float *z, int n, t_float a) { t_float w, in; int c; in = y[0] = x; diff --git a/src/mtx_fill.c b/src/mtx_fill.c index 0c2089f..293c6f7 100644 --- a/src/mtx_fill.c +++ b/src/mtx_fill.c @@ -291,6 +291,7 @@ static void mTXFillMatrix (MTXfill *mtx_fill_obj, t_symbol *s, return; } break; + case DONT_FILL_JUST_PASS: break; } if (mtx_fill_obj->size == 0) { post("mtx_fill: no matrix defined for filling"); @@ -309,6 +310,7 @@ static void mTXFillMatrix (MTXfill *mtx_fill_obj, t_symbol *s, writeIndexedValuesIntoMatrix (mtx_fill_obj->num_idcs_used, mtx_fill_obj->index, fill_mtx,list_out+2); break; + case DONT_FILL_JUST_PASS: break; } mTXFillBang(mtx_fill_obj); } diff --git a/src/mtx_qhull/entry.h b/src/mtx_qhull/entry.h index d85da9a..f524d56 100644 --- a/src/mtx_qhull/entry.h +++ b/src/mtx_qhull/entry.h @@ -85,7 +85,7 @@ static void print_entry(const entry_t e) { switch(e.typ) { case INDEX: - printf("%d", e.val.i); + printf("%ul", (unsigned long)(e.val.i)); return; case POINTER: printf("0x%p", e.val.p); diff --git a/src/mtx_qhull/list.c b/src/mtx_qhull/list.c index 754516f..bc19c50 100644 --- a/src/mtx_qhull/list.c +++ b/src/mtx_qhull/list.c @@ -170,6 +170,7 @@ list_t getSubList(const list_t list, const list_t indices) { getEntry(list,entry_getIndex(&e1)) ); } + return new_list; } list_t getSubListFromTo(const list_t list, const index_t start, @@ -257,7 +258,7 @@ void removeValueListFromList(list_t *list, const list_t excl_list) { void reverseList(list_t * const list) { index_t i,j; entry_t v; - const cnt = getLength(*list)/ 2; + const size_t cnt = getLength(*list)/ 2; if (cnt>0) for (i=0, j=getLength(*list)-1; i0) { print_entry(getEntry(list,0)); } diff --git a/src/mtx_qhull/zhull.c b/src/mtx_qhull/zhull.c index 7832f39..5291980 100644 --- a/src/mtx_qhull/zhull.c +++ b/src/mtx_qhull/zhull.c @@ -337,7 +337,7 @@ static void printHorizonEdges(list_t *horizon_fcts, for (i=0; i%d",c1[0],c1[1]); + printf(", %ul->%ul",(unsigned long)c1[0],(unsigned long)c1[1]); } printf("\n"); } @@ -612,7 +612,7 @@ static void makePyramidFacetsToHorizon(zhull_t *zh, index_t point_index, freeList(&new_facets); } -static appendExteriorPoints(zhull_t *zh) { +static void appendExteriorPoints(zhull_t *zh) { index_t i; vector_t center = initVector(0.0f,0.0f,0.0f); list_t facet_delete_list=emptyList(); @@ -623,7 +623,7 @@ static appendExteriorPoints(zhull_t *zh) { printf("\n"); for (i=0; ifacets); i++) { f=getFacetByIndex(zh->facets,i); - printf("distance of plane %d, d=%5.2f\n",i, + printf("distance of plane %ul, d=%5.2f\n",(unsigned long)i, distancePointPlane(center,f->plane)); if (distancePointPlane(center,f->plane)>-0.5f) { appendToList(&facet_delete_list,entry_makePointer(f)); @@ -702,10 +702,10 @@ void printZhull(const zhull_t * const zh) { printList(indices); freeList(&indices); */ - printf("zhull has %d facets\n", getLength(zh->facets)); + printf("zhull has %ul facets\n", (unsigned long)getLength(zh->facets)); for (fi=0; fifacets); fi++) { - printf("facet %d<%d>: ",fi,getFacetByIndex(zh->facets,fi)); - printFacet(zh,getFacetByIndex(zh->facets,fi)); + printf("facet %ul<%p>: ",(unsigned long)fi,getFacetByIndex(zh->facets,fi)); + printFacet(zh,getFacetByIndex(zh->facets,fi)); } } @@ -725,6 +725,6 @@ void printFacet(const zhull_t * const zh, printf("neighbors: "); printList(indices); freeList(&indices); - printf("pt %d with maxdist %5.2f\n",f->farthest_outside_point, f->maxdistance); + printf("pt %ul with maxdist %5.2f\n",(unsigned long)(f->farthest_outside_point), f->maxdistance); } diff --git a/src/mtx_reverse.c b/src/mtx_reverse.c index 5e51423..62fa250 100644 --- a/src/mtx_reverse.c +++ b/src/mtx_reverse.c @@ -139,17 +139,18 @@ static void mTXreverseMatrix (MTXreverse *mtx_reverse_obj, t_symbol *s, list_out += 2; copyList (size, argv, list_out); - if ((mtx_reverse_obj->reverse_mode == 0)) { + switch(mtx_reverse_obj->reverse_mode) { + case 0: for (count = columns; count--; list_out++) reverseListStep (size, columns, list_out); - } - else if (mtx_reverse_obj->reverse_mode == 1) { + break; + case 1: for (count = rows; count--; list_out += columns) reverseList (columns, list_out); - } - else + break; + default: reverseList (size, list_out); - + } list_out = mtx_reverse_obj->list_out; SETSYMBOL(list_out, gensym("matrix")); -- cgit v1.2.1