summaryrefslogtreecommitdiff
path: root/Build/source/texk/ps2pkm/pk2bm.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-11 07:58:18 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-11 07:58:18 +0000
commit6f0789bd6e4408b1876f05e1d4ad48451312b9b5 (patch)
treed46f123cb746257e847a58e3046f30d1dc77258b /Build/source/texk/ps2pkm/pk2bm.c
parent114b4c2453b3e1e5a379a57ff5be9fc0808bf1d6 (diff)
ps2pkm: Cleanup. Added a test case
git-svn-id: svn://tug.org/texlive/trunk@26996 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ps2pkm/pk2bm.c')
-rw-r--r--Build/source/texk/ps2pkm/pk2bm.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/Build/source/texk/ps2pkm/pk2bm.c b/Build/source/texk/ps2pkm/pk2bm.c
index efc334616e1..63b36d520b6 100644
--- a/Build/source/texk/ps2pkm/pk2bm.c
+++ b/Build/source/texk/ps2pkm/pk2bm.c
@@ -37,16 +37,18 @@
#include <fcntl.h>
#endif
+static quarterword lsbf(quarterword u);
+static void dots(quarterword u, int n);
+static int atoo(char *oct);
+
int main(int argc, char *argv[])
{
int done, C = 0, c, h = 0, w = 0, row, col;
unsigned int bitmap = 0, hexmap = 0;
halfword *word;
- quarterword lsbf();
- void dots();
chardesc cd;
- char *myname = "pk2bm", *pkname;
- int atoo(char *);
+ const char *myname = "pk2bm";
+ char *pkname;
while (--argc > 0 && (*++argv)[0] == '-') {
done=0;
@@ -179,8 +181,8 @@ int main(int argc, char *argv[])
/*
* lsbf() transforms a byte (least significant bit first).
*/
-quarterword lsbf(u)
-quarterword u;
+static quarterword
+lsbf(quarterword u)
{
int i; quarterword bit, result = 0;
@@ -195,9 +197,10 @@ quarterword u;
/*
* dots() print byte: `*' for a black and `.' for a white pixel
*/
-void dots(u, n)
-quarterword u; int n;
-{ unsigned int bit;
+static void
+dots(quarterword u, int n)
+{
+ unsigned int bit;
bit=1<<7;
for ( ;n>0 ;n--) {
@@ -207,8 +210,10 @@ quarterword u; int n;
}
}
-int atoo(char *oct)
-{ int octal = 0;
+static int
+atoo(char *oct)
+{
+ int octal = 0;
while (*oct != '\0') octal = 8*octal + (*oct++) - '0';
return octal & 0xff;
}