Include file/line info without DEBUG_MSGS

For some reason the __FILE__ and __LINE__ stuff was disabled when
DEBUG_MSGS wasn't enabled.  It's now enabled.
This commit is contained in:
Andy McFadden 2015-01-07 14:55:21 -08:00
parent 137f209a3f
commit 6ba112fdfe
2 changed files with 15 additions and 15 deletions

View File

@ -429,25 +429,25 @@ union NuDataSink {
* the first arguments to Nu_ReportError, so we don't have to type them * the first arguments to Nu_ReportError, so we don't have to type them
* in every time we use the function. It would've been much easier to * in every time we use the function. It would've been much easier to
* use a gcc-style varargs macro, but not everybody uses gcc. * use a gcc-style varargs macro, but not everybody uses gcc.
*
* TODO: Visual C++ has vararg macros now; time to replace this.
*/ */
#ifdef DEBUG_MSGS #ifdef HAS__FUNCTION__
#ifdef HAS__FUNCTION__ # define _FUNCTION_ __FUNCTION__
#define _FUNCTION_ __FUNCTION__ #else
#else # define _FUNCTION_ ""
#define _FUNCTION_ "" #endif
#endif
#define NU_BLOB pArchive, __FILE__, __LINE__, _FUNCTION_, false #define NU_BLOB pArchive, __FILE__, __LINE__, _FUNCTION_, false
#define NU_BLOB_DEBUG pArchive, __FILE__, __LINE__, _FUNCTION_, true #define NU_BLOB_DEBUG pArchive, __FILE__, __LINE__, _FUNCTION_, true
#define NU_NILBLOB NULL, __FILE__, __LINE__, _FUNCTION_, false #define NU_NILBLOB NULL, __FILE__, __LINE__, _FUNCTION_, false
#define DebugShowError(err) \
#ifdef DEBUG_MSGS
# define DebugShowError(err) \
Nu_ReportError(pArchive, __FILE__, __LINE__, _FUNCTION_, \ Nu_ReportError(pArchive, __FILE__, __LINE__, _FUNCTION_, \
true, err, "(DEBUG)"); true, err, "(DEBUG)");
#else #else
#define NU_BLOB pArchive, "", 0, "", false # define DebugShowError(err) ((void)0)
#define NU_BLOB_DEBUG pArchive, "", 0, "", true
#define NU_NILBLOB NULL, "", 0, "", false
#define DebugShowError(err) ((void)0)
#endif #endif
/* /*

View File

@ -277,7 +277,7 @@ NuError CreateDosSource(const ImgHeader* pHeader, FILE* fp,
* reversible transformation, i.e. if you do this twice you're back * reversible transformation, i.e. if you do this twice you're back
* to ProDOS ordering. * to ProDOS ordering.
*/ */
for (offset = 0; offset < pHeader->dataLen; offset += 4096) { for (offset = 0; offset < (long) pHeader->dataLen; offset += 4096) {
size_t ignored; size_t ignored;
ignored = fread(diskBuffer + offset + 0x0000, 256, 1, fp); ignored = fread(diskBuffer + offset + 0x0000, 256, 1, fp);
ignored = fread(diskBuffer + offset + 0x0e00, 256, 1, fp); ignored = fread(diskBuffer + offset + 0x0e00, 256, 1, fp);