summaryrefslogtreecommitdiff
path: root/textproc/kbanner/patches/patch-ab
blob: 73061bc54fdb9f16a610c3514b999e96ef217d27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
$NetBSD: patch-ab,v 1.2 2012/12/20 21:33:07 joerg Exp $

--- kbanner.c.orig	1993-10-15 08:43:31.000000000 +0000
+++ kbanner.c
@@ -1,9 +1,11 @@
 /* Kanji Banner Version 2.1 by Koichi Yasuoka, October 15, 1993 */
 
 #include <stdio.h>
+#include <stdlib.h>
 
-extern char *malloc();
-extern unsigned short
+static void kputchar(unsigned int c);
+
+extern const unsigned short
          font21[],font22[],font23[],font24[],font25[],font26[],font27[],
 font28[],
 font30[],font31[],font32[],font33[],font34[],font35[],font36[],font37[],
@@ -16,7 +18,7 @@ font60[],font61[],font62[],font63[],font
 font68[],font69[],font6a[],font6b[],font6c[],font6d[],font6e[],font6f[],
 font70[],font71[],font72[],font73[],font74[];
 
-unsigned short *font[]={
+const unsigned short *const font[]={
        font21,font22,font23,font24,font25,font26,font27,
 font28,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
 font30,font31,font32,font33,font34,font35,font36,font37,
@@ -31,7 +33,7 @@ font70,font71,font72,font73,font74,  NUL
   NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL
 };
 
-int table[]={
+const int table[]={
 	 0x212a,0x2149,0x2174,0x2170,0x2173,0x2175,0x2147,
   0x214a,0x214b,0x2176,0x215c,0x2124,0x215d,0x2125,0x213f,
   0x2330,0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337,
@@ -55,10 +57,10 @@ int table[]={
 };
 
 int landscape,small,column,col,mime,encoding,bufindex,buflength;
-unsigned short **image;
+const unsigned short **image;
 int buf[16];
 
-int b_encoding[]={
+const int b_encoding[]={
   -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
   -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
   -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,
@@ -121,7 +123,7 @@ char *argv[];
   }
   if(landscape)
     column=1;
-  if((image=(unsigned short**)malloc(sizeof(unsigned short*)*column))==NULL){
+  if((image=(const unsigned short**)malloc(sizeof(unsigned short*)*column))==NULL){
     fprintf(stderr,"%s: Not enough memory\n",com);
     exit(1);
   }
@@ -199,8 +201,7 @@ FILE *fp;
   kputchar(-1);
 }
 
-kputchar(c)
-unsigned int c;
+static void kputchar(unsigned int c)
 {
   int i,j,k;
   if((c==-1)||(column==col)){