lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
December 2013
----- 2025 -----
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
26 discussions
Start a n
N
ew thread
[geany/geany] 3522e8: Merge branch 'wip/color-parsing-improvements'
by Colomban Wendling
03 Dec '13
03 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Tue, 03 Dec 2013 02:09:41 UTC Commit: 3522e81d7344c584a78c2f52cf8bcd32f14dd38d
https://github.com/geany/geany/commit/3522e81d7344c584a78c2f52cf8bcd32f14dd…
Log Message: ----------- Merge branch 'wip/color-parsing-improvements' Modified Paths: -------------- src/highlighting.c src/sciwrappers.c src/utils.c src/utils.h src/win32.c Modified: src/highlighting.c 32 files changed, 4 insertions(+), 28 deletions(-) =================================================================== @@ -219,9 +219,7 @@ static gboolean read_named_style(const gchar *named_style, GeanyLexerStyle *styl static void parse_color(GKeyFile *kf, const gchar *str, gint *clr) { gint c; - gchar hex_clr[9] = { 0 }; gchar *named_color = NULL; - const gchar *start; g_return_if_fail(clr != NULL); @@ -229,38 +227,16 @@ static void parse_color(GKeyFile *kf, const gchar *str, gint *clr) return; named_color = g_key_file_get_string(kf, "named_colors", str, NULL); - if (named_color) + if (named_color) str = named_color; - if (str[0] == '#') - start = str + 1; - else if (strlen(str) > 1 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) - start = str + 2; - else - { + c = utils_parse_color(str); + if (c == -1) geany_debug("Bad color '%s'", str); - g_free(named_color); - return; - } - - if (strlen(start) == 3) - { - g_snprintf(hex_clr, 9, "0x%c%c%c%c%c%c", start[0], start[0], - start[1], start[1], start[2], start[2]); - } else - g_snprintf(hex_clr, 9, "0x%s", start); + *clr = c; g_free(named_color); - - c = utils_strtod(hex_clr, NULL, FALSE); - - if (c > -1) - { - *clr = c; - return; - } - geany_debug("Bad color '%s'", str); } Modified: src/sciwrappers.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -69,7 +69,7 @@ void sci_set_line_numbers(ScintillaObject *sci, gboolean set, gint extra_width) void sci_set_mark_long_lines(ScintillaObject *sci, gint type, gint column, const gchar *colour) { - glong colour_val = utils_strtod(colour, NULL, TRUE); /* Scintilla uses a "long" value */ + glong colour_val = utils_parse_color(colour); /* Scintilla uses a "long" value */ if (column == 0) type = 2; Modified: src/utils.c 69 files changed, 37 insertions(+), 32 deletions(-) =================================================================== @@ -964,50 +964,55 @@ gchar *utils_make_human_readable_str(guint64 size, gulong block_size, } - static guint utils_get_value_of_hex(const gchar ch) -{ - if (ch >= '0' && ch <= '9') - return ch - '0'; - else if (ch >= 'A' && ch <= 'F') - return ch - 'A' + 10; - else if (ch >= 'a' && ch <= 'f') - return ch - 'a' + 10; - else - return 0; +static gboolean read_hex(const gchar *s, guint len, gint *h) +{ + guint i; + *h = 0; + for (i = 0; i < len; i++) + { + if (! g_ascii_isxdigit(s[i])) + return FALSE; + *h = (*h << 4) | g_ascii_xdigit_value(s[i]); + } + return TRUE; } -/* utils_strtod() converts a string containing a hex colour ("0x00ff00") into an integer. - * Basically, it is the same as strtod() would do, but it does not understand hex colour values, - * before ANSI-C99. With with_route set, it takes strings of the format "#00ff00". - * Returns -1 on failure. */ -gint utils_strtod(const gchar *source, gchar **end, gboolean with_route) +/* Converts a string containing an hex or HTML RGB color with 1 or 2 digits per + * channel (0x00ff11, 0x0f1, #00ff11, #0f1) to an integer. + * Returns an integer color in the format BBGGRR or -1 on failure. */ +gint utils_parse_color(const gchar *source) { - guint red, green, blue, offset = 0; + gint r, g, b; + guint len; g_return_val_if_fail(source != NULL, -1); - if (with_route && (strlen(source) != 7 || source[0] != '#')) + if (source[0] == '#') + source++; + else if (source[0] == '0' && (source[1] == 'x' || source[1] == 'X')) + source += 2; + else return -1; - else if (! with_route && (strlen(source) != 8 || source[0] != '0' || - (source[1] != 'x' && source[1] != 'X'))) - { + + len = strlen(source); + if (len % 3 || len < 3 || len > 6) return -1; - } + len /= 3; - /* offset is set to 1 when the string starts with 0x, otherwise it starts with # - * and we don't need to increase the index */ - if (! with_route) - offset = 1; + if (! read_hex(source, len, &r) || + ! read_hex(source + len, len, &g) || + ! read_hex(source + len * 2, len, &b)) + return -1; - red = utils_get_value_of_hex( - source[1 + offset]) * 16 + utils_get_value_of_hex(source[2 + offset]); - green = utils_get_value_of_hex( - source[3 + offset]) * 16 + utils_get_value_of_hex(source[4 + offset]); - blue = utils_get_value_of_hex( - source[5 + offset]) * 16 + utils_get_value_of_hex(source[6 + offset]); + if (len < 2) + { + r |= r << 4; + g |= g << 4; + b |= b << 4; + } - return (red | (green << 8) | (blue << 16)); + return (r | (g << 8) | (b << 16)); } Modified: src/utils.h 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -220,7 +220,7 @@ guint utils_string_regex_replace_all(GString *haystack, GRegex *regex, gchar *utils_make_human_readable_str(guint64 size, gulong block_size, gulong display_unit); -gint utils_strtod(const gchar *source, gchar **end, gboolean with_route); +gint utils_parse_color(const gchar *source); gchar *utils_get_current_time_string(void); Modified: src/win32.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -565,7 +565,7 @@ void win32_show_color_dialog(const gchar *colour) cc.lStructSize = sizeof(cc); cc.hwndOwner = GDK_WINDOW_HWND(gtk_widget_get_window(main_widgets.window)); cc.lpCustColors = (LPDWORD) acr_cust_clr; - cc.rgbResult = (colour != NULL) ? utils_strtod(colour, NULL, colour[0] == '#') : 0; + cc.rgbResult = (colour != NULL) ? utils_parse_color(colour) : 0; cc.Flags = CC_FULLOPEN | CC_RGBINIT; if (ChooseColor(&cc)) -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] f07b54: Simplify fold toggling code using higher-level Scintilla API
by Colomban Wendling
02 Dec '13
02 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Mon, 02 Dec 2013 22:19:44 UTC Commit: f07b5457d6505ce8127c4b823b18ee42ffbc7730
https://github.com/geany/geany/commit/f07b5457d6505ce8127c4b823b18ee42ffbc7…
Log Message: ----------- Simplify fold toggling code using higher-level Scintilla API Modified Paths: -------------- src/editor.c Modified: src/editor.c 41 files changed, 12 insertions(+), 29 deletions(-) =================================================================== @@ -442,6 +442,7 @@ const GeanyEditorPrefs *editor_get_prefs(GeanyEditor *editor) void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers) { ScintillaObject *sci; + gint header; g_return_if_fail(editor != NULL); @@ -460,39 +461,21 @@ void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers) if (first > parent) SSM(sci, SCI_SETFIRSTVISIBLELINE, parent, 0); } - sci_toggle_fold(sci, line); - /* extra toggling of child fold points - * use when editor_prefs.unfold_all_children is set and Shift is NOT pressed or when - * editor_prefs.unfold_all_children is NOT set but Shift is pressed */ + /* find the fold header of the given line in case the one clicked isn't a fold point */ + if (sci_get_fold_level(sci, line) & SC_FOLDLEVELHEADERFLAG) + header = line; + else + header = sci_get_fold_parent(sci, line); + if ((editor_prefs.unfold_all_children && ! (modifiers & SCMOD_SHIFT)) || (! editor_prefs.unfold_all_children && (modifiers & SCMOD_SHIFT))) { - gint last_line = SSM(sci, SCI_GETLASTCHILD, line, -1); - gint i; - - if (sci_get_line_is_visible(sci, line + 1)) - { /* unfold all children of the current fold point */ - for (i = line; i <= last_line; i++) - { - if (! sci_get_line_is_visible(sci, i)) - { - sci_toggle_fold(sci, sci_get_fold_parent(sci, i)); - } - } - } - else - { /* fold all children of the current fold point */ - for (i = line; i <= last_line; i++) - { - gint level = sci_get_fold_level(sci, i); - if (level & SC_FOLDLEVELHEADERFLAG) - { - if (sci_get_fold_expanded(sci, i)) - sci_toggle_fold(sci, i); - } - } - } + SSM(sci, SCI_FOLDCHILDREN, header, SC_FOLDACTION_TOGGLE); + } + else + { + SSM(sci, SCI_FOLDLINE, header, SC_FOLDACTION_TOGGLE); } } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 375956: Simplify reading highlighting colors with new utils_parse_color()
by Colomban Wendling
02 Dec '13
02 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Mon, 02 Dec 2013 21:58:54 UTC Commit: 3759562d7c3b53b19f363a47413a8b04b75661a7
https://github.com/geany/geany/commit/3759562d7c3b53b19f363a47413a8b04b7566…
Log Message: ----------- Simplify reading highlighting colors with new utils_parse_color() Drop redundant code converting # and short formats to hex colors now utils_parse_color() can parse them. Modified Paths: -------------- src/highlighting.c Modified: src/highlighting.c 32 files changed, 4 insertions(+), 28 deletions(-) =================================================================== @@ -219,9 +219,7 @@ static gboolean read_named_style(const gchar *named_style, GeanyLexerStyle *styl static void parse_color(GKeyFile *kf, const gchar *str, gint *clr) { gint c; - gchar hex_clr[9] = { 0 }; gchar *named_color = NULL; - const gchar *start; g_return_if_fail(clr != NULL); @@ -229,38 +227,16 @@ static void parse_color(GKeyFile *kf, const gchar *str, gint *clr) return; named_color = g_key_file_get_string(kf, "named_colors", str, NULL); - if (named_color) + if (named_color) str = named_color; - if (str[0] == '#') - start = str + 1; - else if (strlen(str) > 1 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) - start = str + 2; - else - { + c = utils_parse_color(str); + if (c == -1) geany_debug("Bad color '%s'", str); - g_free(named_color); - return; - } - - if (strlen(start) == 3) - { - g_snprintf(hex_clr, 9, "0x%c%c%c%c%c%c", start[0], start[0], - start[1], start[1], start[2], start[2]); - } else - g_snprintf(hex_clr, 9, "0x%s", start); + *clr = c; g_free(named_color); - - c = utils_parse_color(hex_clr); - - if (c > -1) - { - *clr = c; - return; - } - geany_debug("Bad color '%s'", str); } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] ebde42: Accept colors with only 1 digit per channel in utils_parse_color()
by Colomban Wendling
02 Dec '13
02 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Mon, 02 Dec 2013 21:53:35 UTC Commit: ebde42617a5c4e57ae0d717b56a03201f51e0988
https://github.com/geany/geany/commit/ebde42617a5c4e57ae0d717b56a03201f51e0…
Log Message: ----------- Accept colors with only 1 digit per channel in utils_parse_color() AKA short HTML color notation. Modified Paths: -------------- src/utils.c Modified: src/utils.c 25 files changed, 18 insertions(+), 7 deletions(-) =================================================================== @@ -978,11 +978,13 @@ static gboolean read_hex(const gchar *s, guint len, gint *h) } -/* Converts a string containing a hex colour ("0x00ff00") into an integer. +/* Converts a string containing an hex or HTML RGB color with 1 or 2 digits per + * channel (0x00ff11, 0x0f1, #00ff11, #0f1) to an integer. * Returns an integer color in the format BBGGRR or -1 on failure. */ gint utils_parse_color(const gchar *source) { - gint red, green, blue; + gint r, g, b; + guint len; g_return_val_if_fail(source != NULL, -1); @@ -993,15 +995,24 @@ gint utils_parse_color(const gchar *source) else return -1; - if (strlen(source) != 6) + len = strlen(source); + if (len % 3 || len < 3 || len > 6) return -1; + len /= 3; - if (! read_hex(source, 2, &red) || - ! read_hex(source + 2, 2, &green) || - ! read_hex(source + 4, 2, &blue)) + if (! read_hex(source, len, &r) || + ! read_hex(source + len, len, &g) || + ! read_hex(source + len * 2, len, &b)) return -1; - return (red | (green << 8) | (blue << 16)); + if (len < 2) + { + r |= r << 4; + g |= g << 4; + b |= b << 4; + } + + return (r | (g << 8) | (b << 16)); } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 11a2f0: Properly validate input in utils_parse_color()
by Colomban Wendling
02 Dec '13
02 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Mon, 02 Dec 2013 21:44:40 UTC Commit: 11a2f0ee91be81991c9d1b3dfe9b8b9680ca3abf
https://github.com/geany/geany/commit/11a2f0ee91be81991c9d1b3dfe9b8b9680ca3…
Log Message: ----------- Properly validate input in utils_parse_color() Modified Paths: -------------- src/utils.c Modified: src/utils.c 33 files changed, 16 insertions(+), 17 deletions(-) =================================================================== @@ -964,16 +964,17 @@ gchar *utils_make_human_readable_str(guint64 size, gulong block_size, } - static guint utils_get_value_of_hex(const gchar ch) -{ - if (ch >= '0' && ch <= '9') - return ch - '0'; - else if (ch >= 'A' && ch <= 'F') - return ch - 'A' + 10; - else if (ch >= 'a' && ch <= 'f') - return ch - 'a' + 10; - else - return 0; +static gboolean read_hex(const gchar *s, guint len, gint *h) +{ + guint i; + *h = 0; + for (i = 0; i < len; i++) + { + if (! g_ascii_isxdigit(s[i])) + return FALSE; + *h = (*h << 4) | g_ascii_xdigit_value(s[i]); + } + return TRUE; } @@ -981,7 +982,7 @@ gchar *utils_make_human_readable_str(guint64 size, gulong block_size, * Returns an integer color in the format BBGGRR or -1 on failure. */ gint utils_parse_color(const gchar *source) { - guint red, green, blue; + gint red, green, blue; g_return_val_if_fail(source != NULL, -1); @@ -995,12 +996,10 @@ gint utils_parse_color(const gchar *source) if (strlen(source) != 6) return -1; - red = utils_get_value_of_hex( - source[0]) * 16 + utils_get_value_of_hex(source[1]); - green = utils_get_value_of_hex( - source[2]) * 16 + utils_get_value_of_hex(source[3]); - blue = utils_get_value_of_hex( - source[4]) * 16 + utils_get_value_of_hex(source[5]); + if (! read_hex(source, 2, &red) || + ! read_hex(source + 2, 2, &green) || + ! read_hex(source + 4, 2, &blue)) + return -1; return (red | (green << 8) | (blue << 16)); } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 507005: Rename utils_strtod() to utils_parse_color()
by Colomban Wendling
02 Dec '13
02 Dec '13
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Mon, 02 Dec 2013 21:38:11 UTC Commit: 507005ca549a4f6b7c45c1c27b4a219ca6b03f7e
https://github.com/geany/geany/commit/507005ca549a4f6b7c45c1c27b4a219ca6b03…
Log Message: ----------- Rename utils_strtod() to utils_parse_color() Rename the function to a more sensible name, and remove unnecessary arguments. Now, format (# or 0x) is auto-detected. Modified Paths: -------------- src/highlighting.c src/sciwrappers.c src/utils.c src/utils.h src/win32.c Modified: src/highlighting.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -253,7 +253,7 @@ static void parse_color(GKeyFile *kf, const gchar *str, gint *clr) g_free(named_color); - c = utils_strtod(hex_clr, NULL, FALSE); + c = utils_parse_color(hex_clr); if (c > -1) { Modified: src/sciwrappers.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -69,7 +69,7 @@ void sci_set_line_numbers(ScintillaObject *sci, gboolean set, gint extra_width) void sci_set_mark_long_lines(ScintillaObject *sci, gint type, gint column, const gchar *colour) { - glong colour_val = utils_strtod(colour, NULL, TRUE); /* Scintilla uses a "long" value */ + glong colour_val = utils_parse_color(colour); /* Scintilla uses a "long" value */ if (column == 0) type = 2; Modified: src/utils.c 33 files changed, 14 insertions(+), 19 deletions(-) =================================================================== @@ -977,35 +977,30 @@ gchar *utils_make_human_readable_str(guint64 size, gulong block_size, } -/* utils_strtod() converts a string containing a hex colour ("0x00ff00") into an integer. - * Basically, it is the same as strtod() would do, but it does not understand hex colour values, - * before ANSI-C99. With with_route set, it takes strings of the format "#00ff00". - * Returns -1 on failure. */ -gint utils_strtod(const gchar *source, gchar **end, gboolean with_route) +/* Converts a string containing a hex colour ("0x00ff00") into an integer. + * Returns an integer color in the format BBGGRR or -1 on failure. */ +gint utils_parse_color(const gchar *source) { - guint red, green, blue, offset = 0; + guint red, green, blue; g_return_val_if_fail(source != NULL, -1); - if (with_route && (strlen(source) != 7 || source[0] != '#')) - return -1; - else if (! with_route && (strlen(source) != 8 || source[0] != '0' || - (source[1] != 'x' && source[1] != 'X'))) - { + if (source[0] == '#') + source++; + else if (source[0] == '0' && (source[1] == 'x' || source[1] == 'X')) + source += 2; + else return -1; - } - /* offset is set to 1 when the string starts with 0x, otherwise it starts with # - * and we don't need to increase the index */ - if (! with_route) - offset = 1; + if (strlen(source) != 6) + return -1; red = utils_get_value_of_hex( - source[1 + offset]) * 16 + utils_get_value_of_hex(source[2 + offset]); + source[0]) * 16 + utils_get_value_of_hex(source[1]); green = utils_get_value_of_hex( - source[3 + offset]) * 16 + utils_get_value_of_hex(source[4 + offset]); + source[2]) * 16 + utils_get_value_of_hex(source[3]); blue = utils_get_value_of_hex( - source[5 + offset]) * 16 + utils_get_value_of_hex(source[6 + offset]); + source[4]) * 16 + utils_get_value_of_hex(source[5]); return (red | (green << 8) | (blue << 16)); } Modified: src/utils.h 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -220,7 +220,7 @@ guint utils_string_regex_replace_all(GString *haystack, GRegex *regex, gchar *utils_make_human_readable_str(guint64 size, gulong block_size, gulong display_unit); -gint utils_strtod(const gchar *source, gchar **end, gboolean with_route); +gint utils_parse_color(const gchar *source); gchar *utils_get_current_time_string(void); Modified: src/win32.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -565,7 +565,7 @@ void win32_show_color_dialog(const gchar *colour) cc.lStructSize = sizeof(cc); cc.hwndOwner = GDK_WINDOW_HWND(gtk_widget_get_window(main_widgets.window)); cc.lpCustColors = (LPDWORD) acr_cust_clr; - cc.rgbResult = (colour != NULL) ? utils_strtod(colour, NULL, colour[0] == '#') : 0; + cc.rgbResult = (colour != NULL) ? utils_parse_color(colour) : 0; cc.Flags = CC_FULLOPEN | CC_RGBINIT; if (ChooseColor(&cc)) -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
Older →
Jump to page:
1
2
3
Results per page:
10
25
50
100
200