Permalink
Browse files

Warnings--

  • Loading branch information...
1 parent 3c2d720 commit 0cc8d9b808481a1bf241561c46757d170fab6ca3 @pornel committed Jan 23, 2012
Showing with 13 additions and 13 deletions.
  1. +1 −1 Makefile
  2. +10 −10 mediancut.c
  3. +2 −2 nearest.c
View
@@ -12,7 +12,7 @@ CUSTOMZLIB ?= ../zlib
CFLAGSOPT ?= -O3 -fearly-inlining -fstrict-aliasing -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -ffinite-math-only -funsafe-loop-optimizations -ftree-vectorize
-CFLAGS ?= -DNDEBUG -Wall -I. -I$(CUSTOMLIBPNG) -I$(CUSTOMZLIB) -I/usr/local/include/ -I/usr/include/ -I/usr/X11/include/ $(CFLAGSOPT)
+CFLAGS ?= -DNDEBUG -Wall -Wno-unknown-pragmas -I. -I$(CUSTOMLIBPNG) -I$(CUSTOMZLIB) -I/usr/local/include/ -I/usr/include/ -I/usr/X11/include/ $(CFLAGSOPT)
CFLAGS += -std=c99 $(CFLAGSADD)
LDFLAGS ?= -L$(CUSTOMLIBPNG) -L$(CUSTOMZLIB) -L/usr/local/lib/ -L/usr/lib/ -L/usr/X11/lib/
View
@@ -37,8 +37,8 @@ typedef struct {
static int comparevariance(const void *ch1, const void *ch2)
{
- return ((channelvariance*)ch1)->variance > ((channelvariance*)ch2)->variance ? -1 :
- (((channelvariance*)ch1)->variance < ((channelvariance*)ch2)->variance ? 1 : 0);
+ return ((const channelvariance*)ch1)->variance > ((const channelvariance*)ch2)->variance ? -1 :
+ (((const channelvariance*)ch1)->variance < ((const channelvariance*)ch2)->variance ? 1 : 0);
}
static channelvariance channel_sort_order[4];
@@ -61,8 +61,8 @@ inline static int weightedcompare_other(const float *restrict c1p, const float *
/** these are specialised functions to make first comparison faster without lookup in channel_sort_order[] */
static int weightedcompare_r(const void *ch1, const void *ch2)
{
- const float *c1p = (const float *)&((hist_item*)ch1)->acolor;
- const float *c2p = (const float *)&((hist_item*)ch2)->acolor;
+ const float *c1p = (const float *)&((const hist_item*)ch1)->acolor;
+ const float *c2p = (const float *)&((const hist_item*)ch2)->acolor;
if (c1p[index_of_channel(r)] > c2p[index_of_channel(r)]) return 1;
if (c1p[index_of_channel(r)] < c2p[index_of_channel(r)]) return -1;
@@ -72,8 +72,8 @@ static int weightedcompare_r(const void *ch1, const void *ch2)
static int weightedcompare_g(const void *ch1, const void *ch2)
{
- const float *c1p = (const float *)&((hist_item*)ch1)->acolor;
- const float *c2p = (const float *)&((hist_item*)ch2)->acolor;
+ const float *c1p = (const float *)&((const hist_item*)ch1)->acolor;
+ const float *c2p = (const float *)&((const hist_item*)ch2)->acolor;
if (c1p[index_of_channel(g)] > c2p[index_of_channel(g)]) return 1;
if (c1p[index_of_channel(g)] < c2p[index_of_channel(g)]) return -1;
@@ -83,8 +83,8 @@ static int weightedcompare_g(const void *ch1, const void *ch2)
static int weightedcompare_b(const void *ch1, const void *ch2)
{
- const float *c1p = (const float *)&((hist_item*)ch1)->acolor;
- const float *c2p = (const float *)&((hist_item*)ch2)->acolor;
+ const float *c1p = (const float *)&((const hist_item*)ch1)->acolor;
+ const float *c2p = (const float *)&((const hist_item*)ch2)->acolor;
if (c1p[index_of_channel(b)] > c2p[index_of_channel(b)]) return 1;
if (c1p[index_of_channel(b)] < c2p[index_of_channel(b)]) return -1;
@@ -94,8 +94,8 @@ static int weightedcompare_b(const void *ch1, const void *ch2)
static int weightedcompare_a(const void *ch1, const void *ch2)
{
- const float *c1p = (const float *)&((hist_item*)ch1)->acolor;
- const float *c2p = (const float *)&((hist_item*)ch2)->acolor;
+ const float *c1p = (const float *)&((const hist_item*)ch1)->acolor;
+ const float *c2p = (const float *)&((const hist_item*)ch2)->acolor;
if (c1p[index_of_channel(a)] > c2p[index_of_channel(a)]) return 1;
if (c1p[index_of_channel(a)] < c2p[index_of_channel(a)]) return -1;
View
@@ -30,8 +30,8 @@ struct nearest_map {
static int compareradius(const void *ap, const void *bp)
{
- float a = ((struct sorttmp*)ap)->radius;
- float b = ((struct sorttmp*)bp)->radius;
+ float a = ((const struct sorttmp*)ap)->radius;
+ float b = ((const struct sorttmp*)bp)->radius;
return a > b ? 1 : (a < b ? -1 : 0);
}

0 comments on commit 0cc8d9b

Please sign in to comment.