Moved verbose output to a shared module in the common/ directory.

git-svn-id: svn://svn.cc65.org/cc65/trunk@619 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-03-10 10:21:03 +00:00
parent d10079ccdc
commit 1eff067ff9
28 changed files with 53 additions and 76 deletions

View File

@@ -38,6 +38,7 @@
#include <errno.h>
/* common */
#include "print.h"
#include "xmalloc.h"
/* ld65 */
@@ -133,9 +134,7 @@ static void BinWriteMem (BinDesc* D, Memory* M)
SegDesc* S = N->Seg;
/* Keep the user happy */
if (Verbose) {
printf (" Writing `%s'\n", S->Name);
}
Print (stdout, 1, " Writing `%s'\n", S->Name);
/* Writes do only occur in the load area and not for BSS segments */
DoWrite = (S->Flags & SF_BSS) == 0 && /* No BSS segment */
@@ -143,7 +142,7 @@ static void BinWriteMem (BinDesc* D, Memory* M)
S->Seg->Dumped == 0; /* Not already written */
/* Output the DoWrite flag for debugging */
if (Verbose > 1) {
if (Verbosity > 1) {
PrintBoolVal ("bss", S->Flags & SF_BSS);
PrintBoolVal ("LoadArea", S->Load == M);
PrintBoolVal ("Dumped", S->Seg->Dumped);
@@ -253,16 +252,12 @@ void BinWriteTarget (BinDesc* D, struct File* F)
}
/* Keep the user happy */
if (Verbose) {
printf ("Opened `%s'...\n", F->Name);
}
Print (stdout, 1, "Opened `%s'...\n", F->Name);
/* Dump all memory areas */
M = F->MemList;
while (M) {
if (Verbose) {
printf (" Dumping `%s'\n", M->Name);
}
Print (stdout, 1, " Dumping `%s'\n", M->Name);
BinWriteMem (D, M);
M = M->FNext;
}

View File

@@ -41,6 +41,7 @@
/* common */
#include "check.h"
#include "bitops.h"
#include "print.h"
#include "xmalloc.h"
/* ld65 */
@@ -1405,9 +1406,7 @@ void CfgWriteTarget (void)
MemListNode* N;
/* Debugging */
if (Verbose > 1) {
printf ("Skipping `%s'...\n", M->Name);
}
Print (stdout, 2, "Skipping `%s'...\n", M->Name);
/* Walk throught the segments */
N = M->SegList;

View File

@@ -47,7 +47,6 @@ const char* OutputName = "a.out"; /* Name of output file */
unsigned long StartAddr = 0x200; /* Start address */
unsigned char Verbose = 0; /* Verbose operation flag */
unsigned char VerboseMap = 0; /* Verbose map file */
const char* MapFileName = 0; /* Name of the map file */
const char* LabelFileName = 0; /* Name of the label file */

View File

@@ -48,7 +48,6 @@ extern const char* OutputName; /* Name of output file */
extern unsigned long StartAddr; /* Start address */
extern unsigned char Verbose; /* Verbose operation flag */
extern unsigned char VerboseMap; /* Verbose map file */
extern const char* MapFileName; /* Name of the map file */
extern const char* LabelFileName; /* Name of the label file */

View File

@@ -42,6 +42,7 @@
#include "cmdline.h"
#include "libdefs.h"
#include "objdefs.h"
#include "print.h"
#include "target.h"
#include "version.h"
#include "xmalloc.h"
@@ -351,7 +352,7 @@ int main (int argc, char* argv [])
case 'v':
switch (Arg [2]) {
case 'm': VerboseMap = 1; break;
case '\0': ++Verbose; break;
case '\0': ++Verbosity; break;
default: UnknownOption (Arg);
}
break;
@@ -426,7 +427,7 @@ int main (int argc, char* argv [])
}
/* Dump the data for debugging */
if (Verbose > 1) {
if (Verbosity > 1) {
SegDump ();
ConDesDump ();
}

View File

@@ -40,6 +40,7 @@
/* common */
#include "check.h"
#include "print.h"
#include "version.h"
#include "xmalloc.h"
@@ -575,9 +576,7 @@ static void O65WriteSeg (O65Desc* D, SegDesc** Seg, unsigned Count, int DoWrite)
S = Seg [I];
/* Keep the user happy */
if (Verbose) {
printf (" Writing `%s'\n", S->Name);
}
Print (stdout, 1, " Writing `%s'\n", S->Name);
/* Write this segment */
if (DoWrite) {
@@ -1018,9 +1017,7 @@ void O65WriteTarget (O65Desc* D, File* F)
}
/* Keep the user happy */
if (Verbose) {
printf ("Opened `%s'...\n", F->Name);
}
Print (stdout, 1, "Opened `%s'...\n", F->Name);
/* Define some more options: A timestamp and the linker version */
T = time (0);

View File

@@ -40,6 +40,7 @@
#include "check.h"
#include "exprdefs.h"
#include "hashstr.h"
#include "print.h"
#include "segdefs.h"
#include "symdefs.h"
#include "xmalloc.h"
@@ -229,10 +230,8 @@ Section* ReadSection (FILE* F, ObjData* O)
Type = Read8 (F);
/* Print some data */
if (Verbose > 1) {
printf ("Module `%s': Found segment `%s', size = %lu, align = %u, type = %u\n",
GetObjFileName (O), Name, Size, Align, Type);
}
Print (stdout, 1, "Module `%s': Found segment `%s', size = %lu, align = %u, type = %u\n",
GetObjFileName (O), Name, Size, Align, Type);
/* Get the segment for this section */
S = GetSegment (Name, Type, GetObjFileName (O));