summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-27 23:10:09 -0400
committerJune McEnroe <june@causal.agency>2019-08-27 23:10:09 -0400
commitb7e363d56ec656930c3732794ca6127ed3aae8e8 (patch)
tree5bb905d9e47c395c12f1d8e7f63dd7b997a8664e /bin
parentRemove host thursday (diff)
downloadsrc-b7e363d56ec656930c3732794ca6127ed3aae8e8.tar.gz
src-b7e363d56ec656930c3732794ca6127ed3aae8e8.zip
Cast %lc parameter to wint_t
I hadn't realized that's what type %lc takes and suddenly started seeing
warnings about it for some reason.
Diffstat (limited to 'bin')
-rw-r--r--bin/aes.c4
-rw-r--r--bin/psfed.c5
-rw-r--r--bin/shotty.c10
-rw-r--r--bin/ttpre.c2
4 files changed, 12 insertions, 9 deletions
diff --git a/bin/aes.c b/bin/aes.c
index 640e9b9b..8ccc7899 100644
--- a/bin/aes.c
+++ b/bin/aes.c
@@ -36,7 +36,7 @@ static const wchar_t Table[128] = {
 
 static void enwiden(const char *ch) {
 	for (; *ch; ++ch) {
-		if ((byte)*ch < 128) printf("%lc", Table[(byte)*ch]);
+		if ((byte)*ch < 128) printf("%lc", (wint_t)Table[(byte)*ch]);
 		else printf("%c", *ch);
 	}
 }
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
 	setlocale(LC_CTYPE, "");
 	for (int i = 1; i < argc; ++i) {
 		enwiden(argv[i]);
-		if (i < argc - 1) printf("%lc", Table[' ']);
+		if (i < argc - 1) printf("%lc", (wint_t)Table[' ']);
 		else printf("\n");
 	}
 	if (argc > 1) return EXIT_SUCCESS;
diff --git a/bin/psfed.c b/bin/psfed.c
index 2eb8275d..3f72816a 100644
--- a/bin/psfed.c
+++ b/bin/psfed.c
@@ -289,7 +289,10 @@ static void normalInc(uint32_t n) {
 }
 static void normalPrint(const char *prefix) {
 	if (normal.index <= 256) {
-		printf("%s: %02X '%lc'\n", prefix, normal.index, CP437[normal.index]);
+		printf(
+			"%s: %02X '%lc'\n",
+			prefix, normal.index, (wint_t)CP437[normal.index]
+		);
 	} else {
 		printf("%s: %02X\n", prefix, normal.index);
 	}
diff --git a/bin/shotty.c b/bin/shotty.c
index 7cdf2d4a..1fde095f 100644
--- a/bin/shotty.c
+++ b/bin/shotty.c
@@ -98,7 +98,7 @@ static void span(const struct Style *prev, const struct Cell *cell) {
 		break; case '&': printf("&amp;");
 		break; case '<': printf("&lt;");
 		break; case '>': printf("&gt;");
-		break; default:  printf("%lc", cell->ch);
+		break; default:  printf("%lc", (wint_t)cell->ch);
 	}
 }
 
@@ -150,7 +150,7 @@ static char updateNUL(wchar_t ch) {
 				return NUL;
 			}
 			if (x + width > cols) {
-				warnx("cannot fit '%lc'", ch);
+				warnx("cannot fit '%lc'", (wint_t)ch);
 				return NUL;
 			}
 
@@ -218,7 +218,7 @@ static char updateESC(wchar_t ch) {
 		case '>': return NUL;
 		case CSI: return CSI;
 		case OSC: return OSC;
-		default: warnx("unhandled ESC %lc", ch); return NUL;
+		default: warnx("unhandled ESC %lc", (wint_t)ch); return NUL;
 	}
 }
 
@@ -350,7 +350,7 @@ static char updateCSI(wchar_t ch) {
 		}
 
 		break; case 't': // ignore
-		break; default: warnx("unhandled CSI %lc", ch);
+		break; default: warnx("unhandled CSI %lc", (wint_t)ch);
 	}
 
 	if (opts.debug) {
@@ -361,7 +361,7 @@ static char updateCSI(wchar_t ch) {
 		if (ch < 128 && Name[ch]) {
 			printf("%s\n", Name[ch]);
 		} else {
-			printf("%lc\n", ch);
+			printf("%lc\n", (wint_t)ch);
 		}
 		html();
 	}
diff --git a/bin/ttpre.c b/bin/ttpre.c
index a0a2f604..b91c416d 100644
--- a/bin/ttpre.c
+++ b/bin/ttpre.c
@@ -24,7 +24,7 @@ static void put(wchar_t ch) {
 		break; case L'&': printf("&amp;");
 		break; case L'<': printf("&lt;");
 		break; case L'>': printf("&gt;");
-		break; default:   printf("%lc", ch);
+		break; default:   printf("%lc", (wint_t)ch);
 	}
 }