Mercurial > hg
diff mcabber/src/screen.c @ 1476:77afd831f8f7
Avoid mixed declarations and code
Build failures reported by H. D. Oezbilen.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 17 Apr 2008 21:01:09 +0200 |
parents | 3a537b4d7f8d |
children | e74cc83e7158 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Tue Apr 15 07:48:46 2008 +0200 +++ b/mcabber/src/screen.c Thu Apr 17 21:01:09 2008 +0200 @@ -302,9 +302,9 @@ g_free(muclow); } else {//Add or overwrite if (strcmp(muc, "*")) { - ensure_string_htable(&muccolors, g_free); muccoltype *value = g_new(muccoltype, 1); *value = type; + ensure_string_htable(&muccolors, g_free); g_hash_table_replace(muccolors, muclow, value); } else { glob_muccol = type; @@ -1095,25 +1095,32 @@ // The MUC nick - overwrite with proper color if (line->mucnicklen) { + char *mucjid; + char tmp; + nickcolor *actual = NULL; + muccoltype type, *typetmp; + // Store the char after the nick - char tmp = line->text[line->mucnicklen]; - muccoltype type = glob_muccol, *typetmp; + tmp = line->text[line->mucnicklen]; + type = glob_muccol; // Terminate the string after the nick line->text[line->mucnicklen] = '\0'; - char *mucjid = g_utf8_strdown(CURRENT_JID, -1); + mucjid = g_utf8_strdown(CURRENT_JID, -1); if (muccolors) { typetmp = g_hash_table_lookup(muccolors, mucjid); if (typetmp) type = *typetmp; } g_free(mucjid); - nickcolor *actual = NULL; // Need to generate some random color? if ((type == MC_ALL) && (!nickcolors || !g_hash_table_lookup(nickcolors, line->text))) { + char *snick, *mnick; + nickcolor *nc; + snick = g_strdup(line->text); + mnick = g_strdup(line->text); + nc = g_new(nickcolor, 1); ensure_string_htable(&nickcolors, NULL); - char *snick = g_strdup(line->text), *mnick = g_strdup(line->text); - nickcolor *nc = g_new(nickcolor, 1); nc->color = nickcols[random() % nickcolcount]; nc->manual = FALSE; *snick = '<';