diff --git a/src/kernel.vcproj b/src/kernel.vcproj index 1ee01709a..faa1240f4 100644 --- a/src/kernel.vcproj +++ b/src/kernel.vcproj @@ -711,14 +711,6 @@ RelativePath=".\modules\museum.h" > - - - - diff --git a/src/kernel.vcxproj b/src/kernel.vcxproj index cc64219c6..b6beb08b2 100644 --- a/src/kernel.vcxproj +++ b/src/kernel.vcxproj @@ -152,7 +152,6 @@ - @@ -256,7 +255,6 @@ - diff --git a/src/kernel.vcxproj.filters b/src/kernel.vcxproj.filters index 38fd989f5..1eba9e2a2 100644 --- a/src/kernel.vcxproj.filters +++ b/src/kernel.vcxproj.filters @@ -213,9 +213,6 @@ modules - - modules - modules @@ -510,9 +507,6 @@ modules - - modules - modules diff --git a/src/kernel/save.c b/src/kernel/save.c index 4d0a450a0..ca140d313 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1178,7 +1178,7 @@ readfaction(struct storage * store) if (allianceid>0) f->alliance = findalliance(allianceid); if (f->alliance) { alliance * al = f->alliance; - faction_list * flist = malloc(sizeof(faction_list)); + faction_list * flist = (faction_list *)malloc(sizeof(faction_list)); if (al->flags&ALF_NON_ALLIED) { assert(!al->members || !"non-allied dummy-alliance has more than one member"); } diff --git a/src/modules/oceannames.c b/src/modules/oceannames.c deleted file mode 100644 index b52eddec3..000000000 --- a/src/modules/oceannames.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright (c) 1998-2010, Enno Rehling - Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#include -#include -#include "oceannames.h" - -/* kernel includes */ -#include -#include - -/* util includes */ -#include - -/* libc includes */ -#include -#include - -typedef struct namehash { - struct namehash * next; - const char * name; -} namehash; - -#define NMAXHASH 1023 -namehash names[NMAXHASH]; - -void nhash(const char * name); - -typedef struct oceanname { - struct oceanname * next; - struct faction_list * factions; - const char * name; -} oceanname; - -static void -free_names(attrib * a) -{ - oceanname * data = (oceanname*)a->data.v; - while (a->data.v) { - a->data.v = data->next; - free(data); - } -} - -struct attrib_type at_oceanname = { "names", NULL, free_names, NULL/*, write_names, read_names, ATF_UNIQUE */}; - -const char * -get_oceanname(const struct region * r, const struct faction * f) -{ - attrib * a = a_find(r->attribs, &at_oceanname); - if (a) { - oceanname * names = (oceanname*)a->data.v; - while (names) { - faction_list * fl = names->factions; - while (fl) { - if (fl->data==f) return names->name; - fl=fl->next; - } - names = names->next; - } - } - return NULL; -} - -void -nameocean(struct region *r, struct faction * f, const char * newname) -{ - attrib * a = a_find(r->attribs, &at_oceanname); - if (!a && newname) a = a_add(&r->attribs, a_new(&at_oceanname)); - if (a) { - faction_list **oldf = NULL, **newf = NULL; - faction_list * fl = NULL; - oceanname * names = (oceanname*)a->data.v; - while ((names && (!newf && newname)) || !oldf) { - faction_list ** fli = &names->factions; - if (oldf==NULL) while (*fli) { - if ((*fli)->data==f) { - oldf = fli; - break; - } - fli=&(*fli)->next; - } - if (newname && !newf && !strcmp(names->name, newname)) { - newf = fli; - } - names = names->next; - } - - if (oldf) { - fl = *oldf; - *oldf = fl->next; - } else if (newname) { - fl = calloc(1, sizeof(faction_list)); - } - - if (newf) { - fl->data = f; - fl->next = *newf; - *newf = fl; - } else if (newname) { - oceanname * nm = calloc(1, sizeof(oceanname)); - nm->factions = fl; - fl->data = f; - fl->next = NULL; - nm->next = (oceanname*)a->data.v; - a->data.v = nm; - } else if (fl) { - free(fl); - } - } -} diff --git a/src/modules/oceannames.h b/src/modules/oceannames.h deleted file mode 100644 index ed5e4b5cc..000000000 --- a/src/modules/oceannames.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) 1998-2010, Enno Rehling - Katja Zedel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -**/ - -#ifndef H_MOD_OCEANNAMES -#define H_MOD_OCEANNAMES -#ifdef __cplusplus -extern "C" { -#endif - -struct faction; -struct region; -extern const char * get_oceanname(const struct region * r, const struct faction * f); - -#ifdef __cplusplus -} -#endif -#endif