diff options
| author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-15 17:55:55 +0000 |
|---|---|---|
| committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-15 17:55:55 +0000 |
| commit | b2b0e1d235686ff8389d2930a53366abefd1bb9d (patch) | |
| tree | 262a47642e64f91d8a240dad7d281cd205e13b50 /src/nickserv.c | |
| parent | 5384c97c141c9b3acfecb154b8bd41e57f706e00 (diff) | |
Create and use constructors for NickInfo, NickAlias, ChannelInfo. Inherit all three from Extensible. Convert to use that instead of moduleData stuff.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1705 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/nickserv.c')
| -rw-r--r-- | src/nickserv.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/nickserv.c b/src/nickserv.c index 42a417cae..2e1a68934 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -197,7 +197,7 @@ void load_old_ns_dbase(void) if (c != 1) fatal("Invalid format in %s", NickDBName); - na = (NickAlias *)scalloc(sizeof(NickAlias), 1); + na = new NickAlias(); SAFE(read_buffer(bufn, f)); na->nick = sstrdup(bufn); @@ -268,7 +268,7 @@ void load_old_ns_dbase(void) /* This nick was a master nick, so it also has all the * core info! =) */ - nc = (NickCore *)scalloc(1, sizeof(NickCore)); + nc = new NickCore(); slist_init(&nc->aliases); /* The initial display is what used to be the master nick */ @@ -479,7 +479,7 @@ void load_ns_dbase(void) if (c != 1) fatal("Invalid format in %s", NickDBName); - nc = (NickCore *)scalloc(1, sizeof(NickCore)); + nc = new NickCore(); *nclast = nc; nclast = &nc->next; nc->prev = ncprev; @@ -565,7 +565,7 @@ void load_ns_dbase(void) if (c != 1) fatal("Invalid format in %s", NickDBName); - na = (NickAlias *)scalloc(1, sizeof(NickAlias)); + na = new NickAlias(); SAFE(read_string(&na->nick, f)); @@ -1262,10 +1262,7 @@ static int delcore(NickCore * nc) free(nc->memos.memos); } - moduleCleanStruct(&nc->moduleData); - - free(nc); - + delete nc; return 1; } @@ -1346,11 +1343,7 @@ int delnick(NickAlias * na) if (na->last_quit) free(na->last_quit); - moduleCleanStruct(&na->moduleData); - - free(na); - - + delete na; return 1; } |
