* this way arround some compilers like the casts better.
authorWilfried Göesgens <willi@citadel.org>
Wed, 19 Mar 2008 23:19:38 +0000 (23:19 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 19 Mar 2008 23:19:38 +0000 (23:19 +0000)
webcit/addressbook_popup.c
webcit/preferences.c
webcit/siteconfig.c
webcit/who.c

index 5758ec3b0641d7e91c6e2f106b73dd7ae8828705..89c52b5bc9c7c5679012845e9db0d8531012149f 100644 (file)
@@ -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("<option value=\"");
-               urlescputs(Namee);
+               urlescputs((char*)Namee);
                wprintf("\">");
-               escputs(Namee);
+               escputs((char*)Namee);
                wprintf("</option>\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("<option value=\"");
-                       escputs(Namee);
+                       escputs((char*)Namee);
                        wprintf("\">");
-                       escputs(Namee);
+                       escputs((char*)Namee);
                        wprintf("</option>\n");
                }
                DeleteHashPos(&it);
@@ -149,9 +151,9 @@ void display_address_book_inner_div() {
                it = GetNewHashPos();
                while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) {
                        wprintf("<option value=\"");
-                       escputs(Namee);
+                       escputs((char*)Namee);
                        wprintf("\">");
-                       escputs(Namee);
+                       escputs((char*)Namee);
                        wprintf("</option>\n");
                }
                DeleteHashPos(&it);
index ea5e3c6a05314a3456fcee64dd2139d93f312b45..c8ec33116afa8f0cb1714486a114912d8c81f8cf 100644 (file)
@@ -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");
index 5963b010f3e55f7aedf3a298c50408a71dc13f76..0ab15744aadd314508b24dbd2094fd59e784909e 100644 (file)
@@ -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)], "<option %s value=\"%s\">%s</option>\n",
-                                       (!strcasecmp(ZName, buf) ? "selected" : ""),
+                                       (!strcasecmp((char*)ZName, buf) ? "selected" : ""),
                                        ZName, ZName
                                );
                        }
index f13ba59d396a84c64a560e0ad2d5cef19766b973..c88d3a90de9d97de737b88731394a06aea28451a 100644 (file)
@@ -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("<tr class=\"%s\">",
                                (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("<li class=\"");
                                if (User->Idle) {