pidgin/pidgin

Fix GdkRGBA initializer types.

2016-09-05, Elliott Sales de Andrade
e7fe02862977
Parents d5c90412b85e
Children bf90510e8273
Fix GdkRGBA initializer types.

It contains gdouble, not gfloat.
--- a/pidgin/gtkconv.c Mon Sep 05 03:17:41 2016 -0400
+++ b/pidgin/gtkconv.c Mon Sep 05 03:27:13 2016 -0400
@@ -203,8 +203,8 @@
static void update_typing_message(PidginConversation *gtkconv, const char *message);
gboolean pidgin_conv_has_focus(PurpleConversation *conv);
static GArray* generate_nick_colors(guint numcolors, GdkRGBA background);
-gfloat luminance(GdkRGBA color);
-static gboolean color_is_visible(GdkRGBA foreground, GdkRGBA background, gfloat min_contrast_ratio);
+gdouble luminance(GdkRGBA color);
+static gboolean color_is_visible(GdkRGBA foreground, GdkRGBA background, gdouble min_contrast_ratio);
static GtkTextTag *get_buddy_tag(PurpleChatConversation *chat, const char *who, PurpleMessageFlags flag, gboolean create);
static void pidgin_conv_update_fields(PurpleConversation *conv, PidginConvFields fields);
static void focus_out_from_menubar(GtkWidget *wid, PidginConvWindow *win);
@@ -5907,7 +5907,7 @@
font_desc = pango_font_description_from_string(string);
g_free(string);
if (color == NULL) {
- GdkRGBA def = {0x8888/65535.0f, 0x8888/65535.0f, 0x8888/65535.0f, 1.0};
+ GdkRGBA def = {0x8888/65535.0, 0x8888/65535.0, 0x8888/65535.0, 1.0};
color = gdk_rgba_copy(&def);
}
}
@@ -6072,9 +6072,9 @@
/* FIXME: No matter how I ask the GtkStyleContext, it always gives me
* back black instead of the _actual_ background colour. */
color = gtk_widget_get_style(gtkconv->webview)->base[GTK_STATE_NORMAL];
- rgba.red = color.red / 65535.0f;
- rgba.green = color.green / 65535.0f;
- rgba.blue = color.blue / 65535.0f;
+ rgba.red = color.red / 65535.0;
+ rgba.green = color.green / 65535.0;
+ rgba.blue = color.blue / 65535.0;
generated_nick_colors = generate_nick_colors(NICK_COLOR_GENERATE_COUNT, rgba);
}
@@ -11161,12 +11161,12 @@
}
-gfloat luminance(GdkRGBA color)
-{
- gfloat r, g, b;
- gfloat rr, gg, bb;
- gfloat cutoff = 0.03928, scale = 12.92;
- gfloat a = 0.055, d = 1.055, p = 2.2;
+gdouble luminance(GdkRGBA color)
+{
+ gdouble r, g, b;
+ gdouble rr, gg, bb;
+ gdouble cutoff = 0.03928, scale = 12.92;
+ gdouble a = 0.055, d = 1.055, p = 2.2;
rr = color.red;
gg = color.green;
@@ -11181,11 +11181,11 @@
/* Algorithm from https://www.w3.org/TR/2008/REC-WCAG20-20081211/relative-luminance.xml */
static gboolean
-color_is_visible(GdkRGBA foreground, GdkRGBA background, gfloat min_contrast_ratio)
-{
- gfloat lfg, lbg, lmin, lmax;
- gfloat luminosity_ratio;
- gfloat nr, dr;
+color_is_visible(GdkRGBA foreground, GdkRGBA background, gdouble min_contrast_ratio)
+{
+ gdouble lfg, lbg, lmin, lmax;
+ gdouble luminosity_ratio;
+ gdouble nr, dr;
lfg = luminance(foreground);
lbg = luminance(background);
@@ -11247,7 +11247,7 @@
*/
while(i < numcolors && time(NULL) < breakout_time)
{
- GdkRGBA color = {rand() % 65536 / 65535.f, rand() % 65536 / 65535.f, rand() % 65536 / 65535.f, 1};
+ GdkRGBA color = {rand() % 65536 / 65535.0, rand() % 65536 / 65535.0, rand() % 65536 / 65535.0, 1};
if (color_is_visible(color, background, MIN_LUMINANCE_CONTRAST_RATIO) &&
color_is_visible(color, nick_highlight, MIN_LUMINANCE_CONTRAST_RATIO) &&
--- a/pidgin/gtknickcolors.h Mon Sep 05 03:17:41 2016 -0400
+++ b/pidgin/gtknickcolors.h Mon Sep 05 03:27:13 2016 -0400
@@ -28,30 +28,30 @@
*/
static const GdkRGBA nick_seed_colors[] = {
- {64764/65535.0f, 59881/65535.0f, 20303/65535.0f, 1}, /* Butter #1 */
- {60909/65535.0f, 54484/65535.0f, 0/65535.0f, 1}, /* Butter #2 */
- {50372/65535.0f, 41120/65535.0f, 0/65535.0f, 1}, /* Butter #3 */
- {64764/65535.0f, 44975/65535.0f, 15934/65535.0f, 1}, /* Orange #1 */
- {62965/65535.0f, 31097/65535.0f, 0/65535.0f, 1}, /* Orange #2 */
- {52942/65535.0f, 23644/65535.0f, 0/65535.0f, 1}, /* Orange #3 */
- {59811/65535.0f, 47545/65535.0f, 28270/65535.0f, 1}, /* Chocolate #1 */
- {49601/65535.0f, 32125/65535.0f, 4369/65535.0f, 1}, /* Chocolate #2 */
- {36751/65535.0f, 22873/65535.0f, 514/65535.0f, 1}, /* Chocolate #3 */
- {35466/65535.0f, 58082/65535.0f, 13364/65535.0f, 1}, /* Chameleon #1 */
- {29555/65535.0f, 53970/65535.0f, 5654/65535.0f, 1}, /* Chameleon #2 */
- {20046/65535.0f, 39578/65535.0f, 1542/65535.0f, 1}, /* Chameleon #3 */
- {29289/65535.0f, 40863/65535.0f, 53199/65535.0f, 1}, /* Sky Blue #1 */
- {13364/65535.0f, 25957/65535.0f, 42148/65535.0f, 1}, /* Sky Blue #2 */
- { 8224/65535.0f, 19018/65535.0f, 34695/65535.0f, 1}, /* Sky Blue #3 */
- {44461/65535.0f, 32639/65535.0f, 43167/65535.0f, 1}, /* Plum #1 */
- {30069/65535.0f, 20560/65535.0f, 31611/65535.0f, 1}, /* Plum #2 */
- {23644/65535.0f, 13621/65535.0f, 26214/65535.0f, 1}, /* Plum #3 */
- {61423/65535.0f, 10537/65535.0f, 10537/65535.0f, 1}, /* Scarlet Red #1 */
- {52428/65535.0f, 0/65535.0f, 0/65535.0f, 1}, /* Scarlet Red #2 */
- {42148/65535.0f, 0/65535.0f, 0/65535.0f, 1}, /* Scarlet Red #3 */
- {34952/65535.0f, 35466/65535.0f, 34181/65535.0f, 1}, /* Aluminium #4*/
- {21845/65535.0f, 22359/65535.0f, 21331/65535.0f, 1}, /* Aluminium #5*/
- {11822/65535.0f, 13364/65535.0f, 13878/65535.0f, 1} /* Aluminium #6*/
+ {64764/65535.0, 59881/65535.0, 20303/65535.0, 1}, /* Butter #1 */
+ {60909/65535.0, 54484/65535.0, 0/65535.0, 1}, /* Butter #2 */
+ {50372/65535.0, 41120/65535.0, 0/65535.0, 1}, /* Butter #3 */
+ {64764/65535.0, 44975/65535.0, 15934/65535.0, 1}, /* Orange #1 */
+ {62965/65535.0, 31097/65535.0, 0/65535.0, 1}, /* Orange #2 */
+ {52942/65535.0, 23644/65535.0, 0/65535.0, 1}, /* Orange #3 */
+ {59811/65535.0, 47545/65535.0, 28270/65535.0, 1}, /* Chocolate #1 */
+ {49601/65535.0, 32125/65535.0, 4369/65535.0, 1}, /* Chocolate #2 */
+ {36751/65535.0, 22873/65535.0, 514/65535.0, 1}, /* Chocolate #3 */
+ {35466/65535.0, 58082/65535.0, 13364/65535.0, 1}, /* Chameleon #1 */
+ {29555/65535.0, 53970/65535.0, 5654/65535.0, 1}, /* Chameleon #2 */
+ {20046/65535.0, 39578/65535.0, 1542/65535.0, 1}, /* Chameleon #3 */
+ {29289/65535.0, 40863/65535.0, 53199/65535.0, 1}, /* Sky Blue #1 */
+ {13364/65535.0, 25957/65535.0, 42148/65535.0, 1}, /* Sky Blue #2 */
+ { 8224/65535.0, 19018/65535.0, 34695/65535.0, 1}, /* Sky Blue #3 */
+ {44461/65535.0, 32639/65535.0, 43167/65535.0, 1}, /* Plum #1 */
+ {30069/65535.0, 20560/65535.0, 31611/65535.0, 1}, /* Plum #2 */
+ {23644/65535.0, 13621/65535.0, 26214/65535.0, 1}, /* Plum #3 */
+ {61423/65535.0, 10537/65535.0, 10537/65535.0, 1}, /* Scarlet Red #1 */
+ {52428/65535.0, 0/65535.0, 0/65535.0, 1}, /* Scarlet Red #2 */
+ {42148/65535.0, 0/65535.0, 0/65535.0, 1}, /* Scarlet Red #3 */
+ {34952/65535.0, 35466/65535.0, 34181/65535.0, 1}, /* Aluminium #4*/
+ {21845/65535.0, 22359/65535.0, 21331/65535.0, 1}, /* Aluminium #5*/
+ {11822/65535.0, 13364/65535.0, 13878/65535.0, 1} /* Aluminium #6*/
};
#define PIDGIN_NUM_NICK_SEED_COLORS (sizeof(nick_seed_colors) / sizeof(nick_seed_colors[0]))