From 502a3baa576469141cf6f72fd805f1317d35fa12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 19 Mar 2008 23:19:38 +0000 Subject: [PATCH] * this way arround some compilers like the casts better. --- webcit/addressbook_popup.c | 22 ++++++++++++---------- webcit/preferences.c | 6 +++--- webcit/siteconfig.c | 7 ++++--- webcit/who.c | 13 +++++++++---- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/webcit/addressbook_popup.c b/webcit/addressbook_popup.c index 5758ec3b0..89c52b5bc 100644 --- a/webcit/addressbook_popup.c +++ b/webcit/addressbook_popup.c @@ -29,7 +29,8 @@ void address_book_popup(void) { void display_address_book_middle_div(void) { char buf[256]; long len; - char *Name, *Namee; + char *Name; + void *Namee; HashList *List; HashPos *it; @@ -63,11 +64,11 @@ void display_address_book_middle_div(void) { SortByHashKey(List); it = GetNewHashPos(); - while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) { + while (GetNextHashPos(List, it, &len, &Name, &Namee)) { wprintf("\n"); } DeleteHashPos(&it); @@ -100,7 +101,8 @@ void display_address_book_inner_div() { char target_id[64]; char target_label[64]; long len; - char *Name, *Namee; + char *Name; + void *Namee; HashList *List; HashPos *it; int i; @@ -123,11 +125,11 @@ void display_address_book_inner_div() { } SortByHashKey(List); it = GetNewHashPos(); - while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) { + while (GetNextHashPos(List, it, &len, &Name, &Namee)) { wprintf("\n"); } DeleteHashPos(&it); @@ -149,9 +151,9 @@ void display_address_book_inner_div() { it = GetNewHashPos(); while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) { wprintf("\n"); } DeleteHashPos(&it); diff --git a/webcit/preferences.c b/webcit/preferences.c index ea5e3c6a0..c8ec33116 100644 --- a/webcit/preferences.c +++ b/webcit/preferences.c @@ -107,15 +107,15 @@ void save_preferences(void) { long len; HashPos *HashPos; HashList *Hash; - char *Value; + void *Value; char *Key; Hash = WC->hash_prefs; PrintHash(Hash, PrintPref, NULL); HashPos = GetNewHashPos(); - while (GetNextHashPos(Hash, HashPos, &len, &Key, (void**)&Value)!=0) + while (GetNextHashPos(Hash, HashPos, &len, &Key, &Value)!=0) { - serv_printf("%s|%s", Key, Value); + serv_printf("%s|%s", Key, (char*)Value); } serv_puts(""); serv_puts("000"); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 5963b010f..0ab15744a 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -500,7 +500,8 @@ void display_siteconfig(void) int z; long len; char this_zone[128]; - char *ZName, *ZNamee; + char *ZName; + void *ZNamee; HashList *List; HashPos *it; @@ -519,9 +520,9 @@ void display_siteconfig(void) } SortByHashKey(List); it = GetNewHashPos(); - while (GetNextHashPos(List, it, &len, &ZName, (void**)&ZNamee)) { + while (GetNextHashPos(List, it, &len, &ZName, &ZNamee)) { sprintf(&general[strlen(general)], "\n", - (!strcasecmp(ZName, buf) ? "selected" : ""), + (!strcasecmp((char*)ZName, buf) ? "selected" : ""), ZName, ZName ); } diff --git a/webcit/who.c b/webcit/who.c index f13ba59d3..c88d3a90d 100644 --- a/webcit/who.c +++ b/webcit/who.c @@ -52,6 +52,7 @@ int GetWholistSection(HashList *List, time_t now) { struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ UserStateStruct *User, *OldUser; + void *VOldUser; char buf[SIZ], user[SIZ], room[SIZ], host[SIZ], realroom[SIZ], realhost[SIZ]; size_t BufLen; @@ -89,7 +90,8 @@ int GetWholistSection(HashList *List, time_t now) User->Idle = (now - User->LastActive) > 900L; User->SessionCount = 1; - if (GetHash(List, User->UserName, User->UserNameLen, (void**)&OldUser)) { + if (GetHash(List, User->UserName, User->UserNameLen, &VOldUser)) { + OldUser = VOldUser; OldUser->SessionCount++; if (!User->Idle) { if (User->Session == WCC->ctdl_pid) @@ -115,6 +117,7 @@ int GetWholistSection(HashList *List, time_t now) */ void who_inner_div(void) { UserStateStruct *User; + void *VUser; char buf[SIZ]; struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */ HashList *List; @@ -146,8 +149,8 @@ void who_inner_div(void) { if (GetWholistSection(List, now)) { it = GetNewHashPos(); - while (GetNextHashPos(List, it, &len, &UserName, (void**)&User)) { - + while (GetNextHashPos(List, it, &len, &UserName, &VUser)) { + User = VUser; bg = 1 - bg; wprintf("", (bg ? "even" : "odd") @@ -393,6 +396,7 @@ void edit_me(void) */ void wholist_section(void) { UserStateStruct *User; + void *VUser; HashList *List; HashPos *it; char *UserName; @@ -414,7 +418,8 @@ void wholist_section(void) { if (GetWholistSection(List, now)) { SortByPayload(List, CompareUserStruct); it = GetNewHashPos(); - while (GetNextHashPos(List, it, &len, &UserName, (void**)&User)) { + while (GetNextHashPos(List, it, &len, &UserName, &VUser)) { + User = VUser; if (strcmp(User->UserName, NLI)) { wprintf("
  • Idle) { -- 2.30.2