summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2013-09-30 13:43:38 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2013-09-30 13:43:38 +0300
commitd45716228fdf01459e4b583cb4c3f94435eca302 (patch)
tree5abed1f244448af89c208ce8213f385a3a473a1c
parentfa64d9b9397c0912e5f95f257138573a14a8cd82 (diff)
downloadxine-lib-d45716228fdf01459e4b583cb4c3f94435eca302.tar.gz
xine-lib-d45716228fdf01459e4b583cb4c3f94435eca302.tar.bz2
goom: Mark data static const. Use union to fix initialization.
-rw-r--r--src/post/goom/convolve_fx.c8
-rw-r--r--src/post/goom/motif_goom1.h7
-rw-r--r--src/post/goom/motif_goom2.h7
3 files changed, 14 insertions, 8 deletions
diff --git a/src/post/goom/convolve_fx.c b/src/post/goom/convolve_fx.c
index ee36dfd0b..ada619155 100644
--- a/src/post/goom/convolve_fx.c
+++ b/src/post/goom/convolve_fx.c
@@ -64,7 +64,7 @@ static void compute_tables(VisualFX *_this, PluginInfo *info)
}
}
-static void set_motif(ConvData *data, Motif motif)
+static void set_motif(ConvData *data, const Motif motif)
{
int i,j;
for (i=0;i<CONV_MOTIF_W;++i) for (j=0;j<CONV_MOTIF_W;++j)
@@ -100,7 +100,7 @@ static void convolve_init(VisualFX *_this, PluginInfo *info) {
data->theta = 0;
data->ftheta = 0.0;
data->visibility = 1.0;
- set_motif(data, CONV_MOTIF2);
+ set_motif(data, CONV_MOTIF2.motif);
data->inverse_motif = 0;
_this->params = &data->params;
@@ -296,9 +296,9 @@ static void convolve_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo
switch (goom_irand(info->gRandom, 300))
{
case 1:
- set_motif(data, CONV_MOTIF1); data->inverse_motif = 1; break;
+ set_motif(data, CONV_MOTIF1.motif); data->inverse_motif = 1; break;
case 2:
- set_motif(data, CONV_MOTIF2); data->inverse_motif = 0; break;
+ set_motif(data, CONV_MOTIF2.motif); data->inverse_motif = 0; break;
}
}
diff --git a/src/post/goom/motif_goom1.h b/src/post/goom/motif_goom1.h
index b4a9f3f1d..0a40a35c2 100644
--- a/src/post/goom/motif_goom1.h
+++ b/src/post/goom/motif_goom1.h
@@ -1,4 +1,7 @@
-static Motif CONV_MOTIF1 = {
+static const union {
+ const char u8[sizeof(Motif)];
+ const Motif motif;
+} CONV_MOTIF1 = {{
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
@@ -1023,4 +1026,4 @@ static Motif CONV_MOTIF1 = {
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
- };
+ }};
diff --git a/src/post/goom/motif_goom2.h b/src/post/goom/motif_goom2.h
index 4bde2a3d0..2d507c9dd 100644
--- a/src/post/goom/motif_goom2.h
+++ b/src/post/goom/motif_goom2.h
@@ -1,4 +1,7 @@
-static Motif CONV_MOTIF2 = {
+static const union {
+ const char u8[sizeof(Motif)];
+ const Motif motif;
+} CONV_MOTIF2 = {{
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
@@ -1023,4 +1026,4 @@ static Motif CONV_MOTIF2 = {
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
- };
+ }};