-Wall fixes.

This commit is contained in:
Bill Fumerola 1999-12-15 04:28:10 +00:00
parent dd6d33e86e
commit 669d8a6fad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54622

View File

@ -55,6 +55,7 @@ static const char rcsid[] =
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef SPEAKER
#include <machine/speaker.h>
@ -66,130 +67,130 @@ struct morsetab {
char *morse;
};
static struct morsetab mtab[] = {
static const struct morsetab mtab[] = {
/* letters */
'a', ".-",
'b', "-...",
'c', "-.-.",
'd', "-..",
'e', ".",
'f', "..-.",
'g', "--.",
'h', "....",
'i', "..",
'j', ".---",
'k', "-.-",
'l', ".-..",
'm', "--",
'n', "-.",
'o', "---",
'p', ".--.",
'q', "--.-",
'r', ".-.",
's', "...",
't', "-",
'u', "..-",
'v', "...-",
'w', ".--",
'x', "-..-",
'y', "-.--",
'z', "--..",
{'a', ".-"},
{'b', "-..."},
{'c', "-.-."},
{'d', "-.."},
{'e', "."},
{'f', "..-."},
{'g', "--."},
{'h', "...."},
{'i', ".."},
{'j', ".---"},
{'k', "-.-"},
{'l', ".-.."},
{'m', "--"},
{'n', "-."},
{'o', "---"},
{'p', ".--."},
{'q', "--.-"},
{'r', ".-."},
{'s', "..."},
{'t', "-"},
{'u', "..-"},
{'v', "...-"},
{'w', ".--"},
{'x', "-..-"},
{'y', "-.--"},
{'z', "--.."},
/* digits */
'0', "-----",
'1', ".----",
'2', "..---",
'3', "...--",
'4', "....-",
'5', ".....",
'6', "-....",
'7', "--...",
'8', "---..",
'9', "----.",
{'0', "-----"},
{'1', ".----"},
{'2', "..---"},
{'3', "...--"},
{'4', "....-"},
{'5', "....."},
{'6', "-...."},
{'7', "--..."},
{'8', "---.."},
{'9', "----."},
/* punctuation */
',', "--..--",
'.', ".-.-.-",
'?', "..--..",
'/', "-..-.",
'-', "-....-",
'=', "-...-", /* BT */
':', "---...",
';', "-.-.-.",
'(', "-.--.", /* KN */
')', "-.--.-",
'$', "...-..-",
'+', ".-.-.", /* AR */
{',', "--..--"},
{'.', ".-.-.-"},
{'?', "..--.."},
{'/', "-..-."},
{'-', "-....-"},
{'=', "-...-"}, /* BT */
{':', "---..."},
{';', "-.-.-."},
{'(', "-.--."}, /* KN */
{')', "-.--.-"},
{'$', "...-..-"},
{'+', ".-.-."}, /* AR */
/* prosigns without already assigned values */
'#', ".-...", /* AS */
'@', "...-.-", /* SK */
'*', "...-.", /* VE */
'%', "-...-.-", /* BK */
{'#', ".-..."}, /* AS */
{'@', "...-.-"}, /* SK */
{'*', "...-."}, /* VE */
{'%', "-...-.-"}, /* BK */
'\0', ""
{'\0', ""}
};
static struct morsetab iso8859tab[] = {
'á', ".--.-",
'à', ".--.-",
'â', ".--.-",
'ä', ".-.-",
'ç', "-.-..",
'é', "..-..",
'è', "..-..",
'ê', "-..-.",
'ö', "---.",
'ü', "..--",
static const struct morsetab iso8859tab[] = {
{'á', ".--.-"},
{'à', ".--.-"},
{'â', ".--.-"},
{'ä', ".-.-"},
{'ç', "-.-.."},
{'é', "..-.."},
{'è', "..-.."},
{'ê', "-..-."},
{'ö', "---."},
{'ü', "..--"},
'\0', ""
{'\0', ""}
};
static struct morsetab koi8rtab[] = {
static const struct morsetab koi8rtab[] = {
/*
* the cyrillic alphabet; you'll need a KOI8R font in order
* to see the actual characters
*/
'Á', ".-", /* a */
'Â', "-...", /* be */
'×', ".--", /* ve */
'Ç', "--.", /* ge */
'Ä', "-..", /* de */
'Å', ".", /* ye */
'£', ".", /* yo, the same as ye */
'Ö', "...-", /* she */
'Ú', "--..", /* ze */
'É', "..", /* i */
'Ê', ".---", /* i kratkoye */
'Ë', "-.-", /* ka */
'Ì', ".-..", /* el */
'Í', "--", /* em */
'Î', "-.", /* en */
'Ï', "---", /* o */
'Ð', ".--.", /* pe */
'Ò', ".-.", /* er */
'Ó', "...", /* es */
'Ô', "-", /* te */
'Õ', "..-", /* u */
'Æ', "..-.", /* ef */
'È', "....", /* kha */
'Ã', "-.-.", /* ce */
'Þ', "---.", /* che */
'Û', "----", /* sha */
'Ý', "--.-", /* shcha */
'Ù', "-.--", /* yi */
'Ø', "-..-", /* myakhkij znak */
'Ü', "..-..", /* ae */
'À', "..--", /* yu */
'Ñ', ".-.-", /* ya */
{'Á', ".-"}, /* a */
{'Â', "-..."}, /* be */
{'×', ".--"}, /* ve */
{'Ç', "--."}, /* ge */
{'Ä', "-.."}, /* de */
{'Å', "."}, /* ye */
{'£', "."}, /* yo, the same as ye */
{'Ö', "...-"}, /* she */
{'Ú', "--.."}, /* ze */
{'É', ".."}, /* i */
{'Ê', ".---"}, /* i kratkoye */
{'Ë', "-.-"}, /* ka */
{'Ì', ".-.."}, /* el */
{'Í', "--"}, /* em */
{'Î', "-."}, /* en */
{'Ï', "---"}, /* o */
{'Ð', ".--."}, /* pe */
{'Ò', ".-."}, /* er */
{'Ó', "..."}, /* es */
{'Ô', "-"}, /* te */
{'Õ', "..-"}, /* u */
{'Æ', "..-."}, /* ef */
{'È', "...."}, /* kha */
{'Ã', "-.-."}, /* ce */
{'Þ', "---."}, /* che */
{'Û', "----"}, /* sha */
{'Ý', "--.-"}, /* shcha */
{'Ù', "-.--"}, /* yi */
{'Ø', "-..-"}, /* myakhkij znak */
{'Ü', "..-.."}, /* ae */
{'À', "..--"}, /* yu */
{'Ñ', ".-.-"}, /* ya */
'\0', ""
{'\0', ""}
};
void show(const char *), play(const char *), morse(char);
@ -208,13 +209,11 @@ int spkr;
tone_t sound;
#endif
static struct morsetab *hightab = iso8859tab;
static const struct morsetab *hightab = iso8859tab;
int
main(int argc, char **argv)
{
extern char *optarg;
extern int optind;
int ch;
char *p;
@ -290,7 +289,7 @@ main(int argc, char **argv)
void
morse(char c)
{
struct morsetab *m;
const struct morsetab *m;
if (isalpha((unsigned char)c))
c = tolower((unsigned char)c);