From c918391887c08d5ab4874daa5267401c08d6563a Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 23 Dec 2002 20:49:18 +0000 Subject: VC6 is definitively a broken compiler... --- lib/Exceptions.cc | 2 ++ lib/Image.cc | 4 +++- lib/Input.cc | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index 1ff8b6a..e9c5861 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -124,11 +124,13 @@ void * xrealloc(void * ptr, size_t s) { void xfree(unsigned char *& p) { char * t = (char *) p; xfree(t); + p = 0; } void xfree(void *& p) { char * t = (char *) p; xfree(t); + p = 0; } void xfree(char *& p) { diff --git a/lib/Image.cc b/lib/Image.cc index ad986f6..2e33da7 100644 --- a/lib/Image.cc +++ b/lib/Image.cc @@ -9,7 +9,9 @@ Image::Image(unsigned int ax, unsigned int ay) : x(ax), y(ay), img((Color *) mal } Image::~Image() { - free((void *)img); + char * t = (char *) img; + free(t); + img = 0; } bool Image::CanWrite() const { diff --git a/lib/Input.cc b/lib/Input.cc index 719c560..c7cd1d9 100644 --- a/lib/Input.cc +++ b/lib/Input.cc @@ -7,6 +7,11 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif +#ifdef HAVE_UNISTD_H +#include +#else +#include +#endif #include "Input.h" #include "Exceptions.h" #include "gettext.h" -- cgit v1.2.3