From 51ebb7602f67ae068e7803db4d79f393f8b1ccf1 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Tue, 26 Mar 2002 00:25:15 +0000 Subject: [PATCH] 2003-03-26 Robert Collins * package_meta.cc (package_meta::~package_meta): Remove duplicate. (CategoryPackage::~CategoryPackage): Ditto. (Thanks to Ton van Overbeek for the report). * mklink2.cc: Moved from mklink2.c to avoid 'not a prototype error'. Make g++ compatible. * mklink2.c: Remove. * site.cc (site_list_type::init): Delete the correct memory addres. Thanks to Pavel Tsekov for tracking this down. --- ChangeLog | 11 +++++++++++ mklink2.c => mklink2.cc | 9 ++++++--- package_meta.cc | 26 -------------------------- site.cc | 5 +++-- 4 files changed, 20 insertions(+), 31 deletions(-) rename mklink2.c => mklink2.cc (85%) diff --git a/ChangeLog b/ChangeLog index be2187d8..93ca3acc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-03-26 Robert Collins + + * package_meta.cc (package_meta::~package_meta): Remove duplicate. + (CategoryPackage::~CategoryPackage): Ditto. (Thanks to Ton van + Overbeek for the report). + * mklink2.cc: Moved from mklink2.c to avoid 'not a prototype error'. + Make g++ compatible. + * mklink2.c: Remove. + * site.cc (site_list_type::init): Delete the correct memory addres. + Thanks to Pavel Tsekov for tracking this down. + 2002-03-20 Robert Collins * win32.h: Only define alloca if it's not already. diff --git a/mklink2.c b/mklink2.cc similarity index 85% rename from mklink2.c rename to mklink2.cc index b71b22ae..9cc2c86a 100644 --- a/mklink2.c +++ b/mklink2.cc @@ -1,3 +1,4 @@ +#define CINTERFACE #include #include "win32.h" #include "shlobj.h" @@ -11,6 +12,7 @@ static const char *cvsid = /* This part of the code must be in C because the C++ interface to COM doesn't work. */ +extern "C" void make_link_2 (char const *exepath, char const *args, char const *icon, char const *lname) { @@ -18,9 +20,9 @@ make_link_2 (char const *exepath, char const *args, char const *icon, char const IPersistFile *pf; WCHAR widepath[_MAX_PATH]; - CoCreateInstance (&CLSID_ShellLink, NULL, - CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID *) & sl); - sl->lpVtbl->QueryInterface (sl, &IID_IPersistFile, (void **) &pf); + CoCreateInstance (CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *) & sl); + sl->lpVtbl->QueryInterface (sl, IID_IPersistFile, (void **) &pf); sl->lpVtbl->SetPath (sl, exepath); sl->lpVtbl->SetArguments (sl, args); @@ -38,6 +40,7 @@ make_link_2 (char const *exepath, char const *args, char const *icon, char const /* Predicate: file is not currently in existence. * A file race can occur otherwise. */ +extern "C" int mkcygsymlink (const char *from, const char *to) { diff --git a/package_meta.cc b/package_meta.cc index 83790b27..c6a28b9f 100644 --- a/package_meta.cc +++ b/package_meta.cc @@ -97,18 +97,6 @@ CategoryPackage::~CategoryPackage() /*****************/ -/*****************/ - -CategoryPackage::~CategoryPackage() -{ - CategoryPackage **temp = &key.packages; - while (*temp != this) - temp = &((*temp)->next); - *temp = next; -} - -/*****************/ - const packagemeta::_actions packagemeta::Default_action (0); @@ -162,20 +150,6 @@ packagemeta::~packagemeta() } } -packagemeta::~packagemeta() -{ - while (Categories.number ()) - { - CategoryPackage *catpkg = Categories.removebyindex (1); - delete catpkg; - } - while (versions.number ()) - { - packageversion *pv = versions.removebyindex(1); - delete pv; - } -} - void packagemeta::add_version (packageversion & thepkg) { diff --git a/site.cc b/site.cc index a28a78ef..778e37e4 100644 --- a/site.cc +++ b/site.cc @@ -64,7 +64,8 @@ site_list_type::init (String const &newurl) dot = dots + strlen (dots); - char *dp = new char[2 * newurl.size() + 3]; + char *dpsave, *dp = new char[2 * newurl.size() + 3]; + dpsave = dp; while (dot != dots) { if (*dot == '.' || *dot == '/') @@ -82,7 +83,7 @@ site_list_type::init (String const &newurl) strcpy (dp, dots); delete[] dots; key = String (dp); - delete[] dp; + delete[] dpsave; } site_list_type::site_list_type (String const &newurl) -- 2.43.5