comparison src/network/network_gui.cpp @ 5609:358c07fb3212 draft

(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
author KUDr <KUDr@openttd.org>
date Thu, 11 Jan 2007 17:29:39 +0000
parents c44c070c5032
children 407aa599bd6f
comparison
equal deleted inserted replaced
5608:5dcef0df6a67 5609:358c07fb3212
165 for (ngl_temp = _network_game_list; ngl_temp != NULL; ngl_temp = ngl_temp->next) n++; 165 for (ngl_temp = _network_game_list; ngl_temp != NULL; ngl_temp = ngl_temp->next) n++;
166 if (n == 0) return; 166 if (n == 0) return;
167 167
168 /* Create temporary array of games to use for listing */ 168 /* Create temporary array of games to use for listing */
169 free(nqld->sort_list); 169 free(nqld->sort_list);
170 MallocT(&nqld->sort_list, n); 170 nqld->sort_list = MallocT<NetworkGameList*>(n);
171 if (nqld->sort_list == NULL) error("Could not allocate memory for the network-game-sorting-list"); 171 if (nqld->sort_list == NULL) error("Could not allocate memory for the network-game-sorting-list");
172 nqld->l.list_length = n; 172 nqld->l.list_length = n;
173 173
174 for (n = 0, ngl_temp = _network_game_list; ngl_temp != NULL; ngl_temp = ngl_temp->next) { 174 for (n = 0, ngl_temp = _network_game_list; ngl_temp != NULL; ngl_temp = ngl_temp->next) {
175 nqld->sort_list[n++] = ngl_temp; 175 nqld->sort_list[n++] = ngl_temp;