[babl/unitybuild: 4/7] rename functions / variables
- From: Félix Piédallu <fpiedallu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl/unitybuild: 4/7] rename functions / variables
- Date: Tue, 27 Feb 2018 14:42:31 +0000 (UTC)
commit 85a3e3ff3fe76e2952aec3544740d9e64c5f56b9
Author: Félix Piédallu <felix piedallu me>
Date: Tue Feb 27 15:19:01 2018 +0100
rename functions / variables
babl/babl-conversion.c | 14 +++++-----
babl/babl-fish-reference.c | 20 +++++++-------
babl/babl-fish-simple.c | 4 +-
babl/babl-format.c | 5 +--
babl/base/model-gray.c | 60 ++++++++++++++++++++++----------------------
babl/base/model-rgb.c | 60 ++++++++++++++++++++++----------------------
babl/base/model-ycbcr.c | 24 +++++++++---------
7 files changed, 93 insertions(+), 94 deletions(-)
---
diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c
index 8add99a..6873515 100644
--- a/babl/babl-conversion.c
+++ b/babl/babl-conversion.c
@@ -255,14 +255,14 @@ _conversion_new (const char *name,
return babl;
}
-static char buf[512] = "";
+static char conversion_buf[512] = "";
static int collisions = 0;
static char *
-create_name (Babl *source, Babl *destination, int type)
+conversion_create_name (Babl *source, Babl *destination, int type)
{
if (babl_extender ())
{
- snprintf (buf, sizeof (buf), "%s %i: %s%s to %s",
+ snprintf (conversion_buf, sizeof (conversion_buf), "%s %i: %s%s to %s",
BABL (babl_extender ())->instance.name,
collisions,
type == BABL_CONVERSION_LINEAR ? "" :
@@ -273,7 +273,7 @@ create_name (Babl *source, Babl *destination, int type)
}
else
{
- snprintf (buf, sizeof (buf), "%s %s to %s %i",
+ snprintf (conversion_buf, sizeof (conversion_buf), "%s %s to %s %i",
type == BABL_CONVERSION_LINEAR ? "" :
type == BABL_CONVERSION_PLANE ? "plane " :
type == BABL_CONVERSION_PLANAR ? "planar " : "Eeeek! ",
@@ -281,7 +281,7 @@ create_name (Babl *source, Babl *destination, int type)
destination->instance.name,
collisions);
}
- return buf;
+ return conversion_buf;
}
const char *
babl_conversion_create_name (Babl *source, Babl *destination, int type);
@@ -293,7 +293,7 @@ babl_conversion_create_name (Babl *source, Babl *destination, int type)
char *name;
int id = 0;
collisions = 0;
- name = create_name (source, destination, type);
+ name = conversion_create_name (source, destination, type);
babl = babl_db_exist (db, id, name);
while (babl)
{
@@ -301,7 +301,7 @@ babl_conversion_create_name (Babl *source, Babl *destination, int type)
of them ending up with their own unique name
*/
collisions++;
- name = create_name (source, destination, type);
+ name = conversion_create_name (source, destination, type);
babl = babl_db_exist (db, id, name);
}
return name;
diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c
index 54ca110..f3fe7a6 100644
--- a/babl/babl-fish-reference.c
+++ b/babl/babl-fish-reference.c
@@ -46,30 +46,30 @@ create_name_internal (char *buf,
#ifdef HAVE_TLS
-static __thread char buf[1024];
+static __thread char tls_buf[1024];
static char *
-create_name (const Babl *source,
- const Babl *destination,
- int is_reference)
+fish_reference_create_name (const Babl *source,
+ const Babl *destination,
+ int is_reference)
{
int size = 0;
- size = create_name_internal (buf, sizeof(buf), source, destination, is_reference);
+ size = create_name_internal (tls_buf, sizeof(tls_buf), source, destination, is_reference);
if (size < 0)
return NULL;
- return buf;
+ return tls_buf;
}
#else
static char *
-create_name (const Babl *source,
- const Babl *destination,
- int is_reference)
+fish_reference_create_name (const Babl *source,
+ const Babl *destination,
+ int is_reference)
{
int size = 0;
char *buf = NULL;
@@ -102,7 +102,7 @@ babl_fish_reference (const Babl *source,
const Babl *destination)
{
Babl *babl = NULL;
- char *name = create_name (source, destination, 1);
+ char *name = fish_reference_create_name (source, destination, 1);
babl_assert (name);
diff --git a/babl/babl-fish-simple.c b/babl/babl-fish-simple.c
index a6a3730..474bd86 100644
--- a/babl/babl-fish-simple.c
+++ b/babl/babl-fish-simple.c
@@ -20,7 +20,7 @@
#include "babl-internal.h"
static char *
-create_name (BablConversion *conversion)
+fish_simple_create_name (BablConversion *conversion)
{
return conversion->instance.name;
}
@@ -32,7 +32,7 @@ babl_fish_simple (BablConversion *conversion)
char *name;
babl_assert (BABL_IS_BABL (conversion));
- name = create_name (conversion);
+ name = fish_simple_create_name (conversion);
babl = babl_db_exist_by_name (babl_fish_db (), name);
if (babl)
{
diff --git a/babl/babl-format.c b/babl/babl-format.c
index c5ddf56..8963706 100644
--- a/babl/babl-format.c
+++ b/babl/babl-format.c
@@ -154,7 +154,7 @@ format_new_from_format_with_space (const Babl *format, const Babl *space)
static char *
-create_name (const BablModel *model,
+format_create_name (const BablModel *model,
int components,
BablComponent **component,
const BablType **type)
@@ -456,7 +456,7 @@ babl_format_new (const void *first_arg,
va_end (varg);
if (!name)
- name = create_name (model, components, component, type);
+ name = format_create_name (model, components, component, type);
if (space != babl_space ("sRGB"))
{
@@ -755,4 +755,3 @@ babl_format_exists (const char *name)
return 1;
return 0;
}
-
diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c
index 6a2764e..3a095ce 100644
--- a/babl/base/model-gray.c
+++ b/babl/base/model-gray.c
@@ -25,21 +25,21 @@
#include "math.h"
#include "babl-base.h"
-static void components (void);
-static void models (void);
-static void conversions (void);
-static void formats (void);
+static void gray_components (void);
+static void gray_models (void);
+static void gray_conversions (void);
+static void gray_formats (void);
void babl_base_model_gray (void)
{
- components ();
- models ();
- conversions ();
- formats ();
+ gray_components ();
+ gray_models ();
+ gray_conversions ();
+ gray_formats ();
}
static void
-components (void)
+gray_components (void)
{
babl_component_new (
"Y",
@@ -67,7 +67,7 @@ components (void)
}
static void
-models (void)
+gray_models (void)
{
babl_model_new (
"id", BABL_GRAY,
@@ -386,14 +386,14 @@ rgba_to_gray_alpha_premultiplied (Babl *conversion,
}
static void
-non_premultiplied_to_premultiplied (Babl *conversion,
- int src_bands,
- char **src,
- int *src_pitch,
- int dst_bands,
- char **dst,
- int *dst_pitch,
- long n)
+gray_non_premultiplied_to_premultiplied (Babl *conversion,
+ int src_bands,
+ char **src,
+ int *src_pitch,
+ int dst_bands,
+ char **dst,
+ int *dst_pitch,
+ long n)
{
BABL_PLANAR_SANITY
@@ -414,14 +414,14 @@ non_premultiplied_to_premultiplied (Babl *conversion,
}
static void
-premultiplied_to_non_premultiplied (Babl *conversion,
- int src_bands,
- char **src,
- int *src_pitch,
- int dst_bands,
- char **dst,
- int *dst_pitch,
- long n)
+gray_premultiplied_to_non_premultiplied (Babl *conversion,
+ int src_bands,
+ char **src,
+ int *src_pitch,
+ int dst_bands,
+ char **dst,
+ int *dst_pitch,
+ long n)
{
BABL_PLANAR_SANITY
@@ -518,7 +518,7 @@ gray_gamma_2_2_premultiplied2rgba (Babl *conversion,
static void
-conversions (void)
+gray_conversions (void)
{
babl_conversion_new (
babl_model_from_id (BABL_GRAY_GAMMA_2_2),
@@ -594,14 +594,14 @@ conversions (void)
babl_conversion_new (
babl_model_from_id (BABL_GRAY_ALPHA),
babl_model_from_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
- "planar", non_premultiplied_to_premultiplied,
+ "planar", gray_non_premultiplied_to_premultiplied,
NULL
);
babl_conversion_new (
babl_model_from_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
babl_model_from_id (BABL_GRAY_ALPHA),
- "planar", premultiplied_to_non_premultiplied,
+ "planar", gray_premultiplied_to_non_premultiplied,
NULL
);
@@ -621,7 +621,7 @@ conversions (void)
}
static void
-formats (void)
+gray_formats (void)
{
babl_format_new (
babl_model_from_id (BABL_GRAY_ALPHA),
diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c
index c5e74cd..be31fa4 100644
--- a/babl/base/model-rgb.c
+++ b/babl/base/model-rgb.c
@@ -25,22 +25,22 @@
#include "babl-ids.h"
#include "babl-base.h"
-static void models (void);
-static void components (void);
-static void conversions (void);
-static void formats (void);
+static void rgb_models (void);
+static void rgb_components (void);
+static void rgb_conversions (void);
+static void rgb_formats (void);
void
babl_base_model_rgb (void)
{
- components ();
- models ();
- conversions ();
- formats ();
+ rgb_components ();
+ rgb_models ();
+ rgb_conversions ();
+ rgb_formats ();
}
static void
-components (void)
+rgb_components (void)
{
babl_component_new (
"Ra",
@@ -108,7 +108,7 @@ components (void)
}
static void
-models (void)
+rgb_models (void)
{
babl_model_new (
"id", BABL_RGB,
@@ -243,14 +243,14 @@ g3_inv_gamma_2_2 (Babl *conversion,
}
static void
-non_premultiplied_to_premultiplied (Babl *conversion,
- int src_bands,
- char **src,
- int *src_pitch,
- int dst_bands,
- char **dst,
- int *dst_pitch,
- long samples)
+rgb_non_premultiplied_to_premultiplied (Babl *conversion,
+ int src_bands,
+ char **src,
+ int *src_pitch,
+ int dst_bands,
+ char **dst,
+ int *dst_pitch,
+ long samples)
{
long n = samples;
@@ -272,14 +272,14 @@ non_premultiplied_to_premultiplied (Babl *conversion,
}
static void
-premultiplied_to_non_premultiplied (Babl *conversion,
- int src_bands,
- char **src,
- int *src_pitch,
- int dst_bands,
- char **dst,
- int *dst_pitch,
- long samples)
+rgb_premultiplied_to_non_premultiplied (Babl *conversion,
+ int src_bands,
+ char **src,
+ int *src_pitch,
+ int dst_bands,
+ char **dst,
+ int *dst_pitch,
+ long samples)
{
long n = samples;
@@ -411,7 +411,7 @@ rgba_gamma_2_22rgba (Babl *conversion,
}
static void
-conversions (void)
+rgb_conversions (void)
{
babl_conversion_new (
babl_model_from_id (BABL_RGBA),
@@ -438,14 +438,14 @@ conversions (void)
babl_conversion_new (
babl_model_from_id (BABL_RGBA),
babl_model_from_id (BABL_RGBA_PREMULTIPLIED),
- "planar", non_premultiplied_to_premultiplied,
+ "planar", rgb_non_premultiplied_to_premultiplied,
NULL
);
babl_conversion_new (
babl_model_from_id (BABL_RGBA_PREMULTIPLIED),
babl_model_from_id (BABL_RGBA),
- "planar", premultiplied_to_non_premultiplied,
+ "planar", rgb_premultiplied_to_non_premultiplied,
NULL
);
@@ -486,7 +486,7 @@ conversions (void)
}
static void
-formats (void)
+rgb_formats (void)
{
babl_format_new (
"id", BABL_SRGB,
diff --git a/babl/base/model-ycbcr.c b/babl/base/model-ycbcr.c
index 6b34d20..7199b54 100644
--- a/babl/base/model-ycbcr.c
+++ b/babl/base/model-ycbcr.c
@@ -28,22 +28,22 @@
#include "util.h"
-static void components (void);
-static void models (void);
-static void conversions (void);
-static void formats (void);
+static void ycbcr_components (void);
+static void ycbcr_models (void);
+static void ycbcr_conversions (void);
+static void ycbcr_formats (void);
void
babl_base_model_ycbcr (void)
{
- components ();
- models ();
- conversions ();
- formats ();
+ ycbcr_components ();
+ ycbcr_models ();
+ ycbcr_conversions ();
+ ycbcr_formats ();
}
static void
-components (void)
+ycbcr_components (void)
{
babl_component_new (
"Cb",
@@ -59,7 +59,7 @@ components (void)
}
static void
-models (void)
+ycbcr_models (void)
{
babl_model_new (
"id", BABL_YCBCR,
@@ -208,7 +208,7 @@ ycbcr_to_rgba (BablConversion *conversion,
}
static void
-conversions (void)
+ycbcr_conversions (void)
{
babl_conversion_new (
babl_model_from_id (BABL_RGBA),
@@ -237,7 +237,7 @@ conversions (void)
}
static void
-formats (void)
+ycbcr_formats (void)
{
babl_format_new (
"name", "Y'CbCr u8",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]