Move the Debug flag into a new module "debugflag" in the common directory.
Remove the const qualifier from the argument of xfree(). git-svn-id: svn://svn.cc65.org/cc65/trunk@1877 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
50
src/common/debugflag.c
Normal file
50
src/common/debugflag.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* debugflag.c */
|
||||
/* */
|
||||
/* Global debug flag */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
/* warranty. In no event will the authors be held liable for any damages */
|
||||
/* arising from the use of this software. */
|
||||
/* */
|
||||
/* Permission is granted to anyone to use this software for any purpose, */
|
||||
/* including commercial applications, and to alter it and redistribute it */
|
||||
/* freely, subject to the following restrictions: */
|
||||
/* */
|
||||
/* 1. The origin of this software must not be misrepresented; you must not */
|
||||
/* claim that you wrote the original software. If you use this software */
|
||||
/* in a product, an acknowledgment in the product documentation would be */
|
||||
/* appreciated but is not required. */
|
||||
/* 2. Altered source versions must be plainly marked as such, and must not */
|
||||
/* be misrepresented as being the original software. */
|
||||
/* 3. This notice may not be removed or altered from any source */
|
||||
/* distribution. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* common */
|
||||
#include "debugflag.h"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
unsigned char Debug = 0; /* Debug mode */
|
||||
|
||||
|
||||
|
||||
55
src/common/debugflag.h
Normal file
55
src/common/debugflag.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* debugflag.h */
|
||||
/* */
|
||||
/* Global debug flag */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 2002 Ullrich von Bassewitz */
|
||||
/* Wacholderweg 14 */
|
||||
/* D-70597 Stuttgart */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
/* */
|
||||
/* This software is provided 'as-is', without any expressed or implied */
|
||||
/* warranty. In no event will the authors be held liable for any damages */
|
||||
/* arising from the use of this software. */
|
||||
/* */
|
||||
/* Permission is granted to anyone to use this software for any purpose, */
|
||||
/* including commercial applications, and to alter it and redistribute it */
|
||||
/* freely, subject to the following restrictions: */
|
||||
/* */
|
||||
/* 1. The origin of this software must not be misrepresented; you must not */
|
||||
/* claim that you wrote the original software. If you use this software */
|
||||
/* in a product, an acknowledgment in the product documentation would be */
|
||||
/* appreciated but is not required. */
|
||||
/* 2. Altered source versions must be plainly marked as such, and must not */
|
||||
/* be misrepresented as being the original software. */
|
||||
/* 3. This notice may not be removed or altered from any source */
|
||||
/* distribution. */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef DEBUGFLAG_H
|
||||
#define DEBUGFLAG_H
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
extern unsigned char Debug; /* Debug mode */
|
||||
|
||||
|
||||
|
||||
/* End of debugflag.h */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ OBJS = abend.o \
|
||||
check.o \
|
||||
cmdline.o \
|
||||
coll.o \
|
||||
debugflag.o \
|
||||
exprdefs.o \
|
||||
filepos.o \
|
||||
fname.o \
|
||||
|
||||
@@ -47,6 +47,7 @@ OBJS = abend.obj \
|
||||
check.obj \
|
||||
cmdline.obj \
|
||||
coll.obj \
|
||||
debugflag.obj \
|
||||
exprdefs.obj \
|
||||
filepos.obj \
|
||||
fname.obj \
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
/* Segment definition */
|
||||
typedef struct SegDef SegDef;
|
||||
struct SegDef {
|
||||
const char* Name; /* Segment name */
|
||||
char* Name; /* Segment name */
|
||||
unsigned Type; /* Segment type, see above */
|
||||
};
|
||||
|
||||
|
||||
@@ -37,12 +37,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "abend.h"
|
||||
#include "debugflag.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* code */
|
||||
/* code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
@@ -81,10 +82,10 @@ void* xrealloc (void* P, size_t Size)
|
||||
|
||||
|
||||
|
||||
void xfree (const void* Block)
|
||||
void xfree (void* Block)
|
||||
/* Free the block, do some debugging */
|
||||
{
|
||||
free ((void*) Block);
|
||||
free (Block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ void* xmalloc (size_t Size);
|
||||
void* xrealloc (void* P, size_t Size);
|
||||
/* Reallocate a memory block, check for out of memory */
|
||||
|
||||
void xfree (const void* Block);
|
||||
void xfree (void* Block);
|
||||
/* Free the block, do some debugging */
|
||||
|
||||
char* xstrdup (const char* S);
|
||||
|
||||
Reference in New Issue
Block a user