diff --git a/Makefile b/Makefile index 6403639..327048a 100644 --- a/Makefile +++ b/Makefile @@ -232,7 +232,6 @@ MEDNAFEN_SOURCES := $(MEDNAFEN_DIR)/mednafen.cpp \ $(MEDNAFEN_DIR)/state.cpp \ $(MEDNAFEN_DIR)/endian.cpp \ $(CDROM_SOURCES) \ - $(MEDNAFEN_DIR)/memory.cpp \ $(MEDNAFEN_DIR)/mempatcher.cpp \ $(MEDNAFEN_DIR)/video/video.cpp \ $(MEDNAFEN_DIR)/video/Deinterlacer.cpp \ diff --git a/mednafen/clamp.h b/mednafen/clamp.h index 7ec72fc..6544b83 100644 --- a/mednafen/clamp.h +++ b/mednafen/clamp.h @@ -21,15 +21,9 @@ static INLINE int32 clamp_to_u16(int32 i) template static INLINE void clamp(T *val, U minimum, V maximum) { if(*val < minimum) - { - //printf("Warning: clamping to minimum(%d)\n", (int)minimum); *val = minimum; - } if(*val > maximum) - { - //printf("Warning: clamping to maximum(%d)\n", (int)maximum); *val = maximum; - } } #endif diff --git a/mednafen/error.h b/mednafen/error.h index eecce18..79f47d2 100644 --- a/mednafen/error.h +++ b/mednafen/error.h @@ -37,7 +37,6 @@ class ErrnoHolder ErrnoHolder() { - //SetErrno(0); local_errno = 0; local_strerror[0] = 0; } diff --git a/mednafen/file.cpp b/mednafen/file.cpp index 375628e..a2aebf5 100644 --- a/mednafen/file.cpp +++ b/mednafen/file.cpp @@ -18,18 +18,12 @@ #include "mednafen.h" #include #include -#include -#include #include #include #include "file.h" #include "general.h" -#ifndef __GNUC__ - #define strcasecmp strcmp -#endif - static const int64 MaxROMImageSize = (int64)1 << 26; // 2 ^ 26 = 64MiB enum diff --git a/mednafen/include/trio/triodef.h b/mednafen/include/trio/triodef.h index 95d41d1..9c45240 100644 --- a/mednafen/include/trio/triodef.h +++ b/mednafen/include/trio/triodef.h @@ -173,10 +173,6 @@ # define PREDEF_STANDARD_CXX89 #endif -#if defined(TRIO_PLATFORM_UNIX) -# include -#endif - #if defined(_POSIX_VERSION) # define PREDEF_STANDARD_POSIX _POSIX_VERSION # if (_POSIX_VERSION >= 199506L) diff --git a/mednafen/memory.cpp b/mednafen/memory.cpp deleted file mode 100644 index c69344c..0000000 --- a/mednafen/memory.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* Mednafen - Multi-system Emulator - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "mednafen.h" - -#include -#include - -#include "memory.h" - -void *MDFN_calloc_real(uint32 nmemb, uint32 size, const char *purpose, const char *_file, const int _line) -{ - return calloc(nmemb, size); -} - -void *MDFN_malloc_real(uint32 size, const char *purpose, const char *_file, const int _line) -{ - return malloc(size); -} - -void *MDFN_realloc_real(void *ptr, uint32 size, const char *purpose, const char *_file, const int _line) -{ - return realloc(ptr, size); -} - -void MDFN_free(void *ptr) -{ - free(ptr); -} - diff --git a/mednafen/memory.h b/mednafen/memory.h index 8b89fdc..a46f3c9 100644 --- a/mednafen/memory.h +++ b/mednafen/memory.h @@ -6,14 +6,14 @@ #include -#define MDFN_malloc(size, purpose) MDFN_malloc_real(size, purpose, __FILE__, __LINE__) -#define MDFN_calloc(nmemb, size, purpose) MDFN_calloc_real(nmemb, size, purpose, __FILE__, __LINE__) -#define MDFN_realloc(ptr, size, purpose) MDFN_realloc_real(ptr, size, purpose, __FILE__, __LINE__) +#define MDFN_malloc(size, purpose) malloc(size) +#define MDFN_calloc(nmemb, size, purpose) calloc(nmemb, size) +#define MDFN_realloc(ptr, size, purpose) realloc(ptr, size) -void *MDFN_malloc_real(uint32_t size, const char *purpose, const char *_file, const int _line); -void *MDFN_calloc_real(uint32_t nmemb, uint32_t size, const char *purpose, const char *_file, const int _line); -void *MDFN_realloc_real(void *ptr, uint32_t size, const char *purpose, const char *_file, const int _line); -void MDFN_free(void *ptr); +#define MDFN_malloc_real(size, purpose) malloc(size) +#define MDFN_calloc_real(nmemb, size, purpose) calloc(nmemb, size) +#define MDFN_realloc_real(ptr, size, purpose) realloc(ptr, size) +#define MDFN_free(ptr) free(ptr) static inline void MDFN_FastU32MemsetM8(uint32_t *array, uint32_t value_32, unsigned int u32len) {