Fix typo in the G_LIKELY checks, introduced in last commit.

Fix the size of the styles array.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3688 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-04-05 21:22:49 +00:00
parent a9dc990049
commit 1f7def7b71
2 changed files with 7 additions and 4 deletions

View File

@ -20,6 +20,9 @@
src/utils.c, src/utils.h, src/vte.c:
Start using G_LIKELY/G_UNLIKELY macros to gain a little more
performance when building the code with gcc.
* src/highlighting.c:
Fix typo in the G_LIKELY checks, introduced in last commit.
Fix the size of the styles array.
2009-04-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -58,7 +58,7 @@ typedef struct
} StyleSet;
/* each filetype has a styleset except GEANY_FILETYPES_NONE, which uses common_style_set */
static StyleSet style_sets[GEANY_MAX_BUILT_IN_FILETYPES - 1] = {{0, NULL, NULL, NULL}};
static StyleSet style_sets[GEANY_MAX_BUILT_IN_FILETYPES] = {{0, NULL, NULL, NULL}};
enum /* Geany common styling */
@ -189,7 +189,7 @@ static void get_keyfile_style(GKeyFile *config, GKeyFile *configh,
if (list == NULL)
list = g_key_file_get_string_list(config, "styling", key_name, &len, NULL);
if (G_LIKELY(list) != NULL && G_UNLIKELY(list[0] != NULL))
if (G_LIKELY(list != NULL) && G_UNLIKELY(list[0] != NULL))
style->foreground = (gint) utils_strtod(list[0], NULL, FALSE);
else
style->foreground = rotate_rgb(default_style->foreground);
@ -199,11 +199,11 @@ static void get_keyfile_style(GKeyFile *config, GKeyFile *configh,
else
style->background = rotate_rgb(default_style->background);
if (G_LIKELY(list) != NULL && G_LIKELY(list[2] != NULL))
if (G_LIKELY(list != NULL) && G_LIKELY(list[2] != NULL))
style->bold = utils_atob(list[2]);
else style->bold = default_style->bold;
if (G_LIKELY(list) != NULL && list[3] != NULL)
if (G_LIKELY(list != NULL) && list[3] != NULL)
style->italic = utils_atob(list[3]);
else style->italic = default_style->italic;