summaryrefslogtreecommitdiff
path: root/babl/babl-fish.c
diff options
context:
space:
mode:
authorØyvind Kolås <ok@src.gnome.org>2007-03-25 21:44:16 +0000
committerØyvind Kolås <ok@src.gnome.org>2007-03-25 21:44:16 +0000
commitd11613ab2afc0d1b29d1570887ec1dcc2d2eb4a5 (patch)
treec51abacdbe4a6f79e658471d289a288c19c570c5 /babl/babl-fish.c
parentf19f77dd972a6daaa5efa02d2123046dab2ea6ec (diff)
reindented all of the code using uncrustify
svn path=/trunk/; revision=233
Diffstat (limited to 'babl/babl-fish.c')
-rw-r--r--babl/babl-fish.c145
1 files changed, 73 insertions, 72 deletions
diff --git a/babl/babl-fish.c b/babl/babl-fish.c
index 5675ea8..515ea16 100644
--- a/babl/babl-fish.c
+++ b/babl/babl-fish.c
@@ -23,14 +23,14 @@
static int
-match_conversion (Babl *conversion,
- void *inout)
+match_conversion (Babl *conversion,
+ void *inout)
{
void **data = inout;
- if ((Babl *) conversion->conversion.destination == (Babl*) *data)
+ if ((Babl *) conversion->conversion.destination == (Babl *) *data)
{
- *data = (void *)conversion;
+ *data = (void *) conversion;
return 1;
}
return 0;
@@ -40,9 +40,9 @@ Babl *
babl_conversion_find (void *source,
void *destination)
{
- void *data=destination;
+ void *data = destination;
- babl_list_each ((void*)BABL(source)->type.from, match_conversion, &data);
+ babl_list_each ((void *) BABL (source)->type.from, match_conversion, &data);
if (data == destination)
return NULL;
return data;
@@ -63,31 +63,31 @@ typedef struct BablFishingData
Babl *ret;
} BablFishingData;
-static int
+static int
fishing_result_examine (Babl *babl,
void *void_data)
{
BablFishingData *data = void_data;
- if ((void*)data->source == (void*)babl->fish.source &&
- (void*)data->destination == (void*)babl->fish.destination)
+ if ((void *) data->source == (void *) babl->fish.source &&
+ (void *) data->destination == (void *) babl->fish.destination)
{
- data->ret = babl;
- return 1; /* stop iterating */
+ data->ret = babl;
+ return 1; /* stop iterating */
}
return 0; /* continue iterating */
}
-static Babl *
-go_fishing (Babl *source,
- Babl *destination)
+static Babl *
+go_fishing (Babl *source,
+ Babl *destination)
{
{
BablFishingData data;
- data.source = source;
+ data.source = source;
data.destination = destination;
- data.ret = NULL;
+ data.ret = NULL;
babl_db_each (db, fishing_result_examine, &data);
return data.ret;
@@ -112,7 +112,7 @@ babl_fish (void *source,
if (!source_format)
{
- source_format = babl_format ((char*)source);
+ source_format = babl_format ((char *) source);
}
if (!source_format)
@@ -128,7 +128,7 @@ babl_fish (void *source,
if (!destination_format)
{
- destination_format = babl_format ((char*)destination);
+ destination_format = babl_format ((char *) destination);
}
if (!destination_format)
@@ -137,34 +137,34 @@ babl_fish (void *source,
return NULL;
}
- {
- Babl *lucky;
- lucky = go_fishing (source_format, destination_format);
- if (lucky)
- return lucky;
- }
-
+ {
+ Babl *lucky;
+ lucky = go_fishing (source_format, destination_format);
+ if (lucky)
+ return lucky;
+ }
+
if (0)
{
- Babl *shortcut_conversion;
-
- shortcut_conversion = babl_conversion_find (
- source_format, destination_format);
+ Babl *shortcut_conversion;
- if (shortcut_conversion)
- {
- return babl_fish_simple (&(shortcut_conversion->conversion));
- }
- }
+ shortcut_conversion = babl_conversion_find (
+ source_format, destination_format);
+
+ if (shortcut_conversion)
+ {
+ return babl_fish_simple (&(shortcut_conversion->conversion));
+ }
+ }
{
Babl *fish_path;
-
+
fish_path = babl_fish_path (source_format, destination_format);
if (fish_path)
{
- return fish_path;
+ return fish_path;
}
}
@@ -179,7 +179,7 @@ babl_fish_process (Babl *babl,
{
BablImage *source_image = NULL;
BablImage *destination_image = NULL;
- long ret=0;
+ long ret = 0;
switch (babl->class_type)
{
@@ -188,45 +188,46 @@ babl_fish_process (Babl *babl,
case BABL_FISH_PATH:
#if 0
- if (BABL_IS_BABL (source))
- source_image = source;
+ if (BABL_IS_BABL (source))
+ source_image = source;
#endif
- if (!source_image)
- source_image = (BablImage*) babl_image_from_linear (
- source, (Babl*)babl->fish.source);
+ if (!source_image)
+ source_image = (BablImage *) babl_image_from_linear (
+ source, (Babl *) babl->fish.source);
#if 0
- if (BABL_IS_BABL (destination))
- destination_image = destination;
+ if (BABL_IS_BABL (destination))
+ destination_image = destination;
#endif
- if (!destination_image)
- destination_image = (BablImage*) babl_image_from_linear (
- destination, (Babl*)babl->fish.destination);
-
- if (babl->class_type == BABL_FISH_REFERENCE)
- {
- ret = babl_fish_reference_process (babl, source, destination, n);
- }
- else if (babl->class_type == BABL_FISH_PATH)
- {
- ret = babl_fish_path_process (babl, source, destination, n);
- }
- else if (babl->class_type == BABL_FISH_SIMPLE)
- {
- if (BABL(babl->fish_simple.conversion)->class_type==BABL_CONVERSION_LINEAR)
- {
- ret = babl_conversion_process (BABL(babl->fish_simple.conversion),
- source, destination, n);
- }
- else
- {
- ret = babl_conversion_process (BABL(babl->fish_simple.conversion),
- (char*)source_image, (char*)destination_image, n);
- }
- }
+ if (!destination_image)
+ destination_image = (BablImage *) babl_image_from_linear (
+ destination, (Babl *) babl->fish.destination);
+
+ if (babl->class_type == BABL_FISH_REFERENCE)
+ {
+ ret = babl_fish_reference_process (babl, source, destination, n);
+ }
+ else if (babl->class_type == BABL_FISH_PATH)
+ {
+ ret = babl_fish_path_process (babl, source, destination, n);
+ }
+ else if (babl->class_type == BABL_FISH_SIMPLE)
+ {
+ if (BABL (babl->fish_simple.conversion)->class_type == BABL_CONVERSION_LINEAR)
+ {
+ ret = babl_conversion_process (BABL (babl->fish_simple.conversion),
+ source, destination, n);
+ }
+ else
+ {
+ ret = babl_conversion_process (BABL (babl->fish_simple.conversion),
+ (char *) source_image, (char *) destination_image, n);
+ }
+ }
babl_free (source_image);
babl_free (destination_image);
break;
+
default:
babl_log ("NYI");
ret = -1;
@@ -236,7 +237,7 @@ babl_fish_process (Babl *babl,
return ret;
}
-static int
+static int
each_babl_fish_destroy (Babl *babl,
void *data)
{
@@ -244,6 +245,6 @@ each_babl_fish_destroy (Babl *babl,
return 0; /* continue iterating */
}
-BABL_DEFINE_INIT (fish)
+BABL_DEFINE_INIT (fish)
BABL_DEFINE_DESTROY (fish)
-BABL_DEFINE_EACH (fish)
+BABL_DEFINE_EACH (fish)