Mercurial > hg > batmud > maputils
changeset 1692:f5d432ccc9d6
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 14 Jun 2017 17:23:53 +0300 |
parents | f67eb35d141e |
children | 9685febcbd87 |
files | combine.c diffmap.c liblocfile.c map2ppm.c mapstats.c mkcitymap.c mkloc.c mkspecial.c patchmap.c |
diffstat | 9 files changed, 46 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/combine.c Wed Jun 14 17:10:57 2017 +0300 +++ b/combine.c Wed Jun 14 17:23:53 2017 +0300 @@ -348,7 +348,8 @@ if (destFile == NULL) tmpFile = stdout; - else if ((tmpFile = fopen(destFile, "wb")) == NULL) + else + if ((tmpFile = fopen(destFile, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFile); exit(1);
--- a/diffmap.c Wed Jun 14 17:10:57 2017 +0300 +++ b/diffmap.c Wed Jun 14 17:23:53 2017 +0300 @@ -100,7 +100,8 @@ { if (!srcFilename1) srcFilename1 = currArg; - else if (!srcFilename2) + else + if (!srcFilename2) srcFilename2 = currArg; else { @@ -215,7 +216,8 @@ if (destFilename == NULL) outFile = stdout; - else if ((outFile = fopen(destFilename, "wb")) == NULL) + else + if ((outFile = fopen(destFilename, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFilename);
--- a/liblocfile.c Wed Jun 14 17:10:57 2017 +0300 +++ b/liblocfile.c Wed Jun 14 17:23:53 2017 +0300 @@ -301,7 +301,8 @@ locPMErr(f, "Unexpected EOF inside text field.\n"); return NULL; } - else if (i == '\n' || i == '\r') + else + if (i == '\n' || i == '\r') { f->ch = locFGetc(f); if (i == '\r' && f->ch == '\n') @@ -594,29 +595,34 @@ case PM_IDLE: if (ctx.ch == EOF) locPMSet(&ctx, PM_EOF, -1); - else if (ctx.ch == '\r') + else + if (ctx.ch == '\r') { ctx.lineNum++; ctx.ch = locFGetc(&ctx); if (ctx.ch == '\n') ctx.ch = locFGetc(&ctx); } - else if (ctx.ch == '\n') + else + if (ctx.ch == '\n') { ctx.lineNum++; ctx.ch = locFGetc(&ctx); } - else if (ctx.ch == '#') + else + if (ctx.ch == '#') { locPMSet(&ctx, PM_COMMENT, PM_IDLE); } - else if (isdigit(ctx.ch)) + else + if (isdigit(ctx.ch)) { /* Start of a record */ locPMSet(&ctx, PM_FIELD, -1); ctx.field = 1; } - else if (isspace(ctx.ch)) + else + if (isspace(ctx.ch)) { ctx.ch = locFGetc(&ctx); } @@ -675,7 +681,8 @@ verMajor, verMinor, LOC_VERSION_MAJOR, LOC_VERSION_MINOR); ctx.parseMode = PM_ERROR; } - else if (verMinor != LOC_VERSION_MINOR) + else + if (verMinor != LOC_VERSION_MINOR) { /* Minor version mismatch, just inform about it */ THERR("LOC file format version %d.%d detected, internal version is %d.%d, proceeding.\n",
--- a/map2ppm.c Wed Jun 14 17:10:57 2017 +0300 +++ b/map2ppm.c Wed Jun 14 17:23:53 2017 +0300 @@ -379,7 +379,8 @@ /* Open output file */ if (destFilename == NULL) outFile = stdout; - else if ((outFile = fopen(destFilename, "wb")) == NULL) + else + if ((outFile = fopen(destFilename, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFilename);
--- a/mapstats.c Wed Jun 14 17:10:57 2017 +0300 +++ b/mapstats.c Wed Jun 14 17:23:53 2017 +0300 @@ -99,9 +99,11 @@ case 6: if (!strncmp(optArg, "n", 1)) optSortBy = SORT_NAME; - else if (!strncmp(optArg, "s", 1)) + else + if (!strncmp(optArg, "s", 1)) optSortBy = SORT_SYMBOL; - else if (!strncmp(optArg, "a", 1)) + else + if (!strncmp(optArg, "a", 1)) optSortBy = SORT_AMOUNT; else { @@ -192,7 +194,8 @@ if (vp1->n < vp2->n) return -1; - else if (vp1->n > vp2->n) + else + if (vp1->n > vp2->n) return 1; else return 0; @@ -287,7 +290,8 @@ /* Open output file */ if (destFilename == NULL) outFile = stdout; - else if ((outFile = fopen(destFilename, "wb")) == NULL) + else + if ((outFile = fopen(destFilename, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFilename);
--- a/mkcitymap.c Wed Jun 14 17:10:57 2017 +0300 +++ b/mkcitymap.c Wed Jun 14 17:23:53 2017 +0300 @@ -88,7 +88,8 @@ { if (!optMapFilename) optMapFilename = currArg; - else if (!optLocFilename) + else + if (!optLocFilename) optLocFilename = currArg; else { @@ -443,7 +444,8 @@ if (optDestFilename == NULL) outFile = stdout; - else if ((outFile = fopen(optDestFilename, "wb")) == NULL) + else + if ((outFile = fopen(optDestFilename, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", optDestFilename);
--- a/mkloc.c Wed Jun 14 17:10:57 2017 +0300 +++ b/mkloc.c Wed Jun 14 17:23:53 2017 +0300 @@ -654,7 +654,8 @@ char *s = NULL; if (tmp->flags & LOCF_NOMARKER) s = "Location missing marker"; - else if (tmp->flags & LOCF_INVALID) + else + if (tmp->flags & LOCF_INVALID) s = "Possibly invalid location"; if (s) @@ -1138,7 +1139,8 @@ /* Open output file */ if (destFile == NULL) outFile = stdout; - else if ((outFile = fopen(destFile, "wb")) == NULL) + else + if ((outFile = fopen(destFile, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFile);
--- a/mkspecial.c Wed Jun 14 17:10:57 2017 +0300 +++ b/mkspecial.c Wed Jun 14 17:23:53 2017 +0300 @@ -650,7 +650,8 @@ if (destFile == NULL) tmpFile = stdout; - else if ((tmpFile = fopen(destFile, "wb")) == NULL) { + else + if ((tmpFile = fopen(destFile, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFile); exit(1);
--- a/patchmap.c Wed Jun 14 17:10:57 2017 +0300 +++ b/patchmap.c Wed Jun 14 17:23:53 2017 +0300 @@ -77,7 +77,8 @@ { if (!mapFilename) mapFilename = currArg; - else if (!patchFilename) + else + if (!patchFilename) patchFilename = currArg; else { @@ -140,7 +141,8 @@ if (*s == 0xfd) c = ' '; - else if (i < nmapPieces) + else + if (i < nmapPieces) c = mapPieces[i].symbol; else { @@ -167,7 +169,8 @@ /* Open output file */ if (destFilename == NULL) outFile = stdout; - else if ((outFile = fopen(destFilename, "wb")) == NULL) + else + if ((outFile = fopen(destFilename, "wb")) == NULL) { THERR("Error opening output file '%s'!\n", destFilename);