--- deliantra/server/common/porting.C 2007/01/06 14:42:29 1.11 +++ deliantra/server/common/porting.C 2007/11/08 19:43:23 1.19 @@ -1,26 +1,25 @@ /* - CrossFire, A Multiplayer game for X-windows - - Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - Copyright (C) 2002 Mark Wedel & Crossfire Development Team - Copyright (C) 1992 Frank Tore Johansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - The authors can be reached via e-mail at -*/ + * This file is part of Deliantra, the Roguelike Realtime MMORPG. + * + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen + * + * Deliantra is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * The authors can be reached via e-mail to + */ /* This file contains various functions that are not really unique for * crossfire, but rather provides what should be standard functions @@ -50,8 +49,6 @@ /* Has to be after above includes so we don't redefine some values */ #include "global.h" -static unsigned int curtmp = 0; - /* This function removes everything in the directory. */ void remove_directory (const char *path) @@ -128,32 +125,6 @@ } /* - * Based on (n+1)^2 = n^2 + 2n + 1 - * given that 1^2 = 1, then - * 2^2 = 1 + (2 + 1) = 1 + 3 = 4 - * 3^2 = 4 + (4 + 1) = 4 + 5 = 1 + 3 + 5 = 9 - * 4^2 = 9 + (6 + 1) = 9 + 7 = 1 + 3 + 5 + 7 = 16 - * ... - * In other words, a square number can be express as the sum of the - * series n^2 = 1 + 3 + ... + (2n-1) - */ -int -isqrt (int n) -{ - int result, sum, prev; - - result = 0; - prev = sum = 1; - while (sum <= n) - { - prev += 2; - sum += prev; - ++result; - } - return result; -} - -/* * returns a char-pointer to a static array, in which a representation * of the decimal number given will be stored. */ @@ -208,7 +179,8 @@ if (!filename || !*filename) return; - strcpy (buf, filename); + + assign (buf, filename); while ((cp = strchr (cp + 1, (int) '/'))) {