# HG changeset patch # User Matti Hamalainen # Date 1578950017 -7200 # Node ID 203b0fbb05d303bf499b243c3af488846091c9e1 # Parent 829e3080e0adbc43b808ddef89e01153dd050386 Make default verbosity quieter. diff -r 829e3080e0ad -r 203b0fbb05d3 tools/objlink.c --- a/tools/objlink.c Mon Jan 13 23:12:21 2020 +0200 +++ b/tools/objlink.c Mon Jan 13 23:13:37 2020 +0200 @@ -809,12 +809,11 @@ */ int main(int argc, char *argv[]) { - FILE *dfile = NULL; + FILE *outFile = NULL; BOOL hasOverlaps; int startAddr, endAddr, dataSize, totalSize; dmInitProg("objlink", "Simple file-linker", "0.82", NULL, NULL); - dmVerbosity = 1; // Parse arguments if (!dmArgsProcess(argc, argv, optList, optListN, @@ -957,7 +956,7 @@ if (optLinkFileName) { dmMsg(1, "Writing linkfile to '%s'\n", optLinkFileName); - if ((dfile = fopen(optLinkFileName, "wb")) == NULL) + if ((outFile = fopen(optLinkFileName, "wb")) == NULL) { int err = dmGetErrno(); dmErrorMsg("Error creating file '%s' #%d: %s.\n", @@ -969,7 +968,7 @@ { case FMT_GENERIC: default: - fprintf(dfile, "; Definitions generated by %s v%s\n", + fprintf(outFile, "; Definitions generated by %s v%s\n", dmProgName, dmProgVersion); break; } @@ -977,10 +976,10 @@ for (int i = 0; i < nmemBlocks; i++) { DMMemBlock *mbi = &memBlocks[i]; - outputLinkData(dfile, mbi->name, mbi->start, mbi->end); + outputLinkData(outFile, mbi->name, mbi->start, mbi->end); } - fclose(dfile); + fclose(outFile); } // Show some information @@ -1005,10 +1004,10 @@ // Open the destination file if (optDestName == NULL) { - dfile = stdout; + outFile = stdout; dmPrint(1, "...\n"); } - else if ((dfile = fopen(optDestName, "wb")) == NULL) + else if ((outFile = fopen(optDestName, "wb")) == NULL) { int err = dmGetErrno(); dmErrorMsg("Error creating output file '%s' #%d: %s.\n", @@ -1022,13 +1021,13 @@ if (optLoadAddress >= 0) { dmMsg(1, "Using specified loading address $%.4x\n", optLoadAddress); - dm_fwrite_le16(dfile, optLoadAddress); + dm_fwrite_le16(outFile, optLoadAddress); } else if (optLoadAddress == LA_AUTO) { dmMsg(1, "Using automatic loading address $%.4x\n", startAddr); - dm_fwrite_le16(dfile, startAddr); + dm_fwrite_le16(outFile, startAddr); } else { @@ -1036,7 +1035,7 @@ } // Save the data - if (fwrite(&memory[startAddr], dataSize, 1, dfile) < 1) + if (fwrite(&memory[startAddr], dataSize, 1, outFile) < 1) { int err = dmGetErrno(); dmErrorMsg("Error writing to file #%d: %s.\n", @@ -1046,11 +1045,11 @@ // Describe the memory layout if (optDescribe) - dmDescribeMemory(dfile != stdout ? stdout : stderr); + dmDescribeMemory(outFile != stdout ? stdout : stderr); out: - if (dfile != NULL && dfile != stdout) - fclose(dfile); + if (outFile != NULL && outFile != stdout) + fclose(outFile); return 0; }