1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 15:36:34 +00:00

Merge branch 'freebsd'

This commit is contained in:
Nick Briggs 2017-06-08 11:23:40 -07:00
commit 8d42e7791f
30 changed files with 178 additions and 193 deletions

View File

@ -535,7 +535,7 @@ op_fn_common: \
LispPTR closure_env = (LispPTR) 0xffffffff; \
{register int NEXTBLOCK = NIL; \
defcell = fn_defcell; \
if( (defcell->ccodep == 0) ) \
if(defcell->ccodep == 0) { \
if(GetTypeNumber(defcell->defpointer)==TYPE_COMPILED_CLOSURE) \
{ /* setup closure */ \
closure=(CClosure *)Addr68k_from_LADDR(defcell->defpointer);\
@ -550,6 +550,7 @@ op_fn_common: \
defcell = (DefCell *)GetDEFCELL68k(ATOM_INTERPRETER); \
needpush = 1; \
} /*else end */ \
} \
LOCFNCELL = (struct fnhead *)Addr68k_from_LADDR(defcell->defpointer); \
BCE_CURRENTFX->pc = ((UNSIGNED)PCMAC \
- (UNSIGNED)FuncObj) + fn_opcode_size; \

15
inc/xscroll.h Normal file
View File

@ -0,0 +1,15 @@
/************************************************************************/
/* */
/* xscroll.h */
/* */
/* Scrolling functions implemented in xscroll.c */
/* */
/************************************************************************/
void Scroll(DspInterface dsp, int newX, int newY);
void JumpScrollVer(DspInterface dsp, int y);
void JumpScrollHor(DspInterface dsp, int x);
void ScrollLeft(DspInterface dsp);
void ScrollRight(DspInterface dsp);
void ScrollUp(DspInterface dsp);
void ScrollDown(DspInterface dsp);

View File

@ -123,15 +123,15 @@ void describedsp(DspInterface dsp) {
printf("width= %d\n", dsp->Display.width);
printf("height= %d\n", dsp->Display.height);
printf("bitsperpixel= %d\n", dsp->bitsperpixel);
printf("colors= %d\n", dsp->colors);
printf("graphicsmode= %d\n", dsp->graphicsmode);
printf("numberofbanks= %d\n", dsp->numberofbanks);
printf("colors= %lu\n", dsp->colors);
printf("graphicsmode= %lu\n", dsp->graphicsmode);
printf("numberofbanks= %lu\n", dsp->numberofbanks);
#ifdef DOS
printf("BytesPerLine= %d\n", dsp->BytesPerLine);
printf("DisplayStartAddr= %d\n", dsp->DisplayStartAddr);
#endif /* DOS */
printf("bitblt_to_screen= %d\n", dsp->bitblt_to_screen);
printf("cleardisplay= %d\n", dsp->cleardisplay);
printf("bitblt_to_screen= %p\n", dsp->bitblt_to_screen);
printf("cleardisplay= %p\n", dsp->cleardisplay);
#ifdef DOS
printf("mouse_vissible= %d\n", dsp->mouse_vissible);
printf("mouse_invissible= %d\n", dsp->mouse_invissible);

View File

@ -101,7 +101,7 @@ struct hashtable {
/************************************************************************/
LispPTR aref1(LispPTR array, int index) {
register LispPTR retval;
register LispPTR retval = 0;
register LispPTR base;
register short typenumber;
register struct arrayheader *actarray;
@ -110,8 +110,8 @@ LispPTR aref1(LispPTR array, int index) {
if (index >= actarray->totalsize) {
printf("Invalid index in GC's AREF1: 0x%x\n", index);
printf(" Array size limit: 0x%x\n", actarray->totalsize);
printf(" Array ptr: 0x%x\n", (UNSIGNED)array);
printf(" Array 68K ptr: 0x%x\n", (UNSIGNED)actarray);
printf(" Array ptr: 0x%lx\n", (UNSIGNED)array);
printf(" Array 68K ptr: %p\n", actarray);
printf("base: 0x%x\n", actarray->base);
printf("offset: 0x%x\n", actarray->offset);
printf("type #: 0x%x\n", actarray->typenumber);

View File

@ -276,7 +276,7 @@ int code_block_size(long unsigned int codeblock68k) {
sprintf(errtext,
"Unrecognized bytecode (0%o) at offset 0%o in code block x%x,x%x; continue to use "
"UFN length",
opnum, codeptr - (InstPtr)fnbase, (codeblock68k >> 16) & 0xFF, codeblock68k & 0xFFFF);
opnum, codeptr - (InstPtr)fnbase, (int)((codeblock68k >> 16) & 0xFF), (int)(codeblock68k & 0xFFFF));
error(errtext);
oplength[opnum] = len = (((UFN *)UFNTable) + (opnum))->byte_num;
}

View File

@ -536,13 +536,15 @@ void printarrayblock(LispPTR base) {
printf(" Length: %d cells.\n\n", bbase->arlen);
addr = ((LispPTR *)bbase) - 20;
for (; addr < (LispPTR *)bbase; addr++) printf("0x%x %8x\n", addr, *addr);
printf("0x%x %8x <- array header\n", addr, *addr++);
for (; addr < (LispPTR *)bbase + 20; addr++) printf("0x%x %8x\n", addr, *addr);
for (; addr < (LispPTR *)bbase; addr++) printf("%p %8x\n", addr, *addr);
printf("%p %8x <- array header\n", addr, *addr);
addr++;
for (; addr < (LispPTR *)bbase + 20; addr++) printf("%p %8x\n", addr, *addr);
printf(". . .\n");
addr = ((LispPTR *)btrailer) - 20;
for (; addr < (LispPTR *)btrailer; addr++) printf("0x%x %8x\n", addr, *addr);
printf("0x%x %8x <- array trailer\n", addr, *addr++);
for (; addr < (LispPTR *)btrailer + 20; addr++) printf("0x%x %8x\n", addr, *addr);
for (; addr < (LispPTR *)btrailer; addr++) printf("%p %8x\n", addr, *addr);
printf("%p %8x <- array trailer\n", addr, *addr);
addr++;
for (; addr < (LispPTR *)btrailer + 20; addr++) printf("%p %8x\n", addr, *addr);
}

View File

@ -417,6 +417,7 @@ nolink: /* no match */
GETGC((GCENTRY *)link + 1) = GETGC((GCENTRY *)entry) - 1;
GETGC((GCENTRY *)entry) = (link - HTcoll) + 1;
NewEntry(link, hiptr, casep, ptr);
/* NewEntry will return */
}
/************************************************************************/

View File

@ -401,11 +401,10 @@ LispPTR gcscanstack(void) {
scanend68K = (UNSIGNED)Addr68k_from_LADDR(scanend);
bascframe = (Bframe *)Addr68k_from_LADDR(scanptr);
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"at start of gcscanstack.",
"Frame ptr (%p) not to word bound at start of gcscanstack.",
bascframe);
error(debugStr);
}
@ -481,11 +480,11 @@ LispPTR gcscanstack(void) {
bascframe =
(Bframe *)ADD_OFFSET(bascframe, FRAMESIZE + PADDING + (((fnheader->pv) + 1) << 2));
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"in gcscanstack() STK_FX case; old frame = 0x%x.",
"Frame ptr (%p) not to word bound "
"in gcscanstack() STK_FX case; old frame = %p.",
bascframe, obascframe);
error(debugStr);
}
@ -502,11 +501,11 @@ LispPTR gcscanstack(void) {
if (ntend != 0) {
obascframe = bascframe;
bascframe = (Bframe *)Addr68k_from_StkOffset(ntend);
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"in gcscanstack() scantemps; old frame = 0x%x.",
"Frame ptr (%p) not to word bound "
"in gcscanstack() scantemps; old frame = %p.",
bascframe, obascframe);
error(debugStr);
}
@ -519,11 +518,11 @@ LispPTR gcscanstack(void) {
obascframe = bascframe;
bascframe = (Bframe *)next;
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"in gcscanstack(), end scantemps; old frame = 0x%x.",
"Frame ptr (%p) not to word bound "
"in gcscanstack(), end scantemps; old frame = %p.",
bascframe, obascframe);
error(debugStr);
}
@ -539,11 +538,11 @@ LispPTR gcscanstack(void) {
obascframe = bascframe;
bascframe = (Bframe *)((DLword *)bascframe + bascframe->ivar);
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"in gcscanstack() STK_GUARD; old frame = 0x%x.",
"Frame ptr (%p) not to word bound "
"in gcscanstack() STK_GUARD; old frame = %p.",
bascframe, obascframe);
error(debugStr);
}
@ -554,11 +553,11 @@ LispPTR gcscanstack(void) {
obascframe = bascframe;
bascframe = (Bframe *)((DLword *)bascframe + bascframe->ivar);
if (0 != 3 & (UNSIGNED)bascframe) {
if (0 != (3 & (UNSIGNED)bascframe)) {
char debugStr[100];
sprintf(debugStr,
"Frame ptr (0x%x) not to word bound "
"in gcscanstack() STK_FSB; old frame = 0x%x.",
"Frame ptr (%p) not to word bound "
"in gcscanstack() STK_FSB; old frame = %p.",
bascframe, obascframe);
error(debugStr);
}

View File

@ -49,13 +49,14 @@ static char *id = "$Id: gcoflow.c,v 1.3 1999/05/31 23:35:32 sybalsky Exp $ Copyr
#define Oddp(num) (((num % 2) != 0) ? 1 : 0)
#define Evenp(num, prim) (((num % prim) == 0) ? 1 : 0)
#define Increment_Allocation_Count(n) \
if (*Reclaim_cnt_word != NIL) \
if (*Reclaim_cnt_word != NIL) { \
if (*Reclaim_cnt_word > n) \
(*Reclaim_cnt_word) -= n; \
else { \
*Reclaim_cnt_word = NIL; \
doreclaim(); \
};
} \
}
DLword gc_handleoverflow(DLword arg) {
struct htoverflow *cell;

View File

@ -45,7 +45,7 @@ static char *id = "$Id: gcr.c,v 1.3 1999/05/31 23:35:32 sybalsky Exp $ Copyright
/* But currently this function is not used(may be used in Future.) */
/* This function may have a problem. It is to manipulate "clock" */
/* for keeping the GC's time period. */
/* disablegc1(noerror)
/* disablegc1(noerror) */
/* This function is the rescue function,when the HTcoll table is */
/* overflow and so on.After this function's process is over, the */
/* keyhandler will sense the interrupt table state and call the */

View File

@ -95,6 +95,7 @@ LispPTR nameConn, proto, length, bufaddr, maxlen;
{
#ifndef DOS
int sock, len, buflen, res;
unsigned ures;
char namestring[100];
char servstring[50];
struct sockaddr_in addr;
@ -149,8 +150,7 @@ LispPTR nameConn, proto, length, bufaddr, maxlen;
return (GetSmallp(result));
break;
case TCPconnect: /* args: hostname, socket# */
case TCPconnect: /* args: hostname or (fixp)address, socket# */
memset(&farend, 0, sizeof farend);
N_GETNUMBER(nameConn, res, string_host);
farend.sin_addr.s_addr = htons(res);
@ -326,9 +326,9 @@ LispPTR nameConn, proto, length, bufaddr, maxlen;
case INETpeername: /* socket#, buffer for name string */
sock = LispNumToCInt(nameConn);
buffer = (char *)Addr68k_from_LADDR(proto);
res = sizeof(addr);
getpeername(sock, (struct sockaddr *)&addr, &res);
host = gethostbyaddr((const char *)&addr, res, AF_INET);
ures = sizeof(addr);
getpeername(sock, (struct sockaddr *)&addr, &ures);
host = gethostbyaddr((const char *)&addr, ures, AF_INET);
strcpy(buffer, host->h_name);
return (GetSmallp(strlen(host->h_name)));
break;
@ -336,9 +336,9 @@ LispPTR nameConn, proto, length, bufaddr, maxlen;
case INETgetname: /* host addr, buffer for name string */
sock = LispNumToCInt(nameConn);
buffer = (char *)Addr68k_from_LADDR(proto);
res = sizeof(addr);
ures = sizeof(addr);
addr.sin_addr.s_addr = sock;
host = gethostbyaddr((const char *)&addr, res, 0);
host = gethostbyaddr((const char *)&addr, ures, 0);
if (!host) return (GetSmallp(0));
strcpy(buffer, host->h_name);
return (GetSmallp(strlen(host->h_name)));
@ -407,8 +407,8 @@ LispPTR nameConn, proto, length, bufaddr, maxlen;
sock = LispNumToCInt(nameConn);
buffer = (char *)Addr68k_from_LADDR(proto);
buflen = LispNumToCInt(length);
res = sizeof farend;
if ((result = recvfrom(sock, buffer, buflen, 0, (struct sockaddr *)&farend, &res)) < 0) {
ures = sizeof farend;
if ((result = recvfrom(sock, buffer, buflen, 0, (struct sockaddr *)&farend, &ures)) < 0) {
perror("UDP Recv");
return (NIL);
}

View File

@ -781,7 +781,7 @@ void keyboardtype(fd) int fd;
char errmsg[200];
sprintf(errmsg, "Unsupported keyboard type: %d", type);
printf("%s\n", errmsg);
printf("Configuring keyboard for type-3\n", errmsg);
printf("Configuring keyboard for type-3\n");
SUNLispKeyMap = SUNLispKeyMap_for3;
InterfacePage->devconfig |= KB_SUN3 - MIN_KEYTYPE;
break;

View File

@ -300,8 +300,7 @@ DLword ColorCursor_savebitmap[CURSORWIDTH / COLORPIXELS_IN_DLWORD * CURSORHEIGHT
/* */
/************************************************************************/
void getsignaldata(sig, code, scp) int sig, code;
struct sigcontext *scp;
void getsignaldata(int sig, int code, struct sigcontext *scp)
{
#ifndef DOS
#ifndef XWINDOW
@ -418,7 +417,7 @@ void kb_trans(u_short keycode, u_short upflg);
#if (!defined(XWINDOW) && !defined(DOS))
extern int for_makeinit;
int kb_event(event) register struct inputevent *event;
int kb_event(struct inputevent *event);
{
register u_int upflg;
int kn;
@ -542,8 +541,7 @@ int kb_event(event) register struct inputevent *event;
/* */
/************************************************************************/
void kb_trans(keycode, upflg) u_short keycode;
u_short upflg;
void kb_trans(u_short keycode, u_short upflg)
{
extern IFPAGE *InterfacePage;
if (keycode < 64) /* DLKBDAD0 ~ 3 */
@ -573,13 +571,6 @@ typedef struct {
LispPTR CUDATA;
} CURSOR;
#define DLWORD_PERLINE (displaywidth / 16)
#define HARD_CURSORWIDTH 16
#define HARD_CURSORHEIGHT 16
#define COLOR_BITSPER_PIXEL 8
/* For MonoOrColor */
#define MONO_SCREEN 0
#define COLOR_SCREEN 1
#define CursorClippingX(posx, width) \
{ \
if (displaywidth < (posx + HARD_CURSORWIDTH)) { \
@ -680,7 +671,7 @@ void taking_mouse_down() {
To avoid duplicate caluculation */
#ifndef COLOR
/* FOR MONO ONLY */
void copy_cursor(newx, newy) int newx, newy;
void copy_cursor(int newx, int newy)
{
register DLword *srcbase, *dstbase;
register int offsetx, offsety;
@ -705,7 +696,7 @@ void copy_cursor(newx, newy) int newx, newy;
}
/* store bitmap image inside rect. which specified by x,y */
void cursor_hidden_bitmap(x, y) int x, y;
void cursor_hidden_bitmap(int x, int y)
{
register DLword *srcbase, *dstbase;
static int sx, dx, w, h, srcbpl, dstbpl, backwardflg = 0;
@ -726,7 +717,7 @@ void cursor_hidden_bitmap(x, y) int x, y;
#else
/* For COLOR & MONO */
#define IMIN(x, y) (((x) > (y)) ? (y) : (x))
void copy_cursor(newx, newy) int newx, newy;
void copy_cursor(int newx, int newy)
{
register DLword *srcbase, *dstbase;
register int offsetx, offsety;
@ -767,7 +758,7 @@ void copy_cursor(newx, newy) int newx, newy;
}
/* I'll make it MACRO */
void taking_mouse_up(newx, newy) int newx, newy;
void taking_mouse_up(int newx, int newy)
{
#ifdef DOS
(currentdsp->mouse_vissible)(newx, newy);
@ -785,7 +776,7 @@ void taking_mouse_up(newx, newy) int newx, newy;
}
/* store bitmap image inside rect. which specified by x,y */
void cursor_hidden_bitmap(x, y) int x, y;
void cursor_hidden_bitmap(int x, int y)
{
register DLword *srcbase, *dstbase;
static int sx, dx, w, h, srcbpl, dstbpl, backwardflg = 0;

View File

@ -35,10 +35,10 @@ static char *id = "$Id: keylib.c,v 1.4 2001/12/24 01:09:03 sybalsky Exp $ Copyri
#define FAILURE2 -2
unsigned long make_verification(long unsigned int x, long unsigned int y);
unsigned long make_verification(unsigned long x, unsigned long y);
unsigned long date_integer16(const char *date);
unsigned long idate(const char *str);
unsigned long modify(long unsigned int hostid);
unsigned long modify(unsigned long hostid);
/* ===========================================================================
MAKE_VERIFICATION forms a new 32-bit integer by messaging the two input
@ -59,7 +59,7 @@ unsigned long make_verification(long unsigned int x, long unsigned int y) {
(((ULONG_MAX % y) + 1 ) % y) is equivalent to (expt 2 32) % y
=============================================================================*/
int imod64bit(long unsigned int x1, long unsigned int x0, long unsigned int y) {
int imod64bit(unsigned long x1, unsigned long x0, unsigned long y) {
/* JDS 990601 ansi return (((x0 % y) + ((x1 % y) * (((ULONG_MAX % y) + 1 ) % y) )) % y); */
return (((x0 % y) + ((x1 % y) * ((y + 1) % y))) % y);
}
@ -169,7 +169,7 @@ unsigned long idate(const char *str) {
in 32-bit hostid, depending on the value of (hostid % 16).
=============================================================*/
unsigned long modify(long unsigned int hostid) {
unsigned long modify(unsigned long hostid) {
unsigned long dividor;
#ifdef xBIGVM

View File

@ -1,6 +1,6 @@
/* $Id: keymaker.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
static char *id = "$Id: keymaker.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ Copyright (C) Venue";
static const char *id = "$Id: keymaker.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ Copyright (C) Venue";
/************************************************************************/
/* */
@ -35,7 +35,6 @@ static char *id = "$Id: keymaker.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ Copy
#define floadbyte(number, pos) ((number >> pos) & 0xFFFF)
#define hash_unhash(number, hashkey) \
(number ^ (GOLDEN_RATIO_HACK * (floadbyte(hashkey, 16) + floadbyte(hashkey, 0))))
#define KEYNUMBERS 3
/* meaning of symbolic constants used:
@ -47,10 +46,10 @@ static char *id = "$Id: keymaker.c,v 1.3 1999/05/31 23:35:35 sybalsky Exp $ Copy
#define FAILURE2 -2
#define FAILURE3 -3
unsigned long make_verification(long unsigned int x, long unsigned int y);
unsigned long make_verification(unsigned long x, unsigned long y);
unsigned long date_integer16(char *date);
unsigned long idate(char *str);
unsigned long modify(long unsigned int hostid);
unsigned long modify(unsigned long hostid);
/************************************************************************/
/* */
@ -60,9 +59,11 @@ unsigned long modify(long unsigned int hostid);
/* */
/************************************************************************/
void writeresults(FILE *fp, char *host, char *expdate, int key1, int key2, int key3, char *info) {
void writeresults(FILE *fp, char *host, char *expdate,
unsigned long key1, unsigned long key2, unsigned long key3,
char *info) {
fprintf(fp, "Host ID: %-14s Expiration: %-9s", host, expdate);
fprintf(fp, " Key: %8x %8x %8x", key1, key2, key3);
fprintf(fp, " Key: %8lx %8lx %8lx", key1, key2, key3);
fprintf(fp, " Doc: %s\n", info);
}
@ -78,15 +79,12 @@ int main(int argc, char **argv) {
int logfile = 0; /* set to 1 if logfile on command line */
FILE *fp; /* file pointer for the logfile */
unsigned long hostid;
long keyarray[KEYNUMBERS];
char *hexdigits = {"-0123456789abcdefABCDEF"};
char s[50], hstr[50], expdate[30], saveexpdate[30], cc;
unsigned long keys[3];
char s[50], expdate[30], saveexpdate[30];
char infostring[500];
char *sptr, *ptr, *digitstring;
char *hptr = {" "};
char **hhptr = &hptr;
int base = 10;
int i, j, c;
char *sptr;
char *eptr;
int i, c;
int commandlineargs;
commandlineargs = (argc > 2);
@ -107,66 +105,47 @@ int main(int argc, char **argv) {
if (commandlineargs) {
/* assume that the second argument is hex-hostid */
sptr = *++argv;
hostid = strtol(sptr, hhptr, 16);
hostid = strtoul(sptr, &eptr, 16);
} else {
printf("\n\nEnter Host ID (starts with 0x if the number is hexidecimal): ");
gets(s);
sptr = strtok(s, " ");
/* decide the base */
if (((ptr = strchr(sptr, '0')) != NULL) && (*(ptr + 1) == 'x' || *(ptr + 1) == 'X')) base = 16;
#ifdef INDIGO
hostid = strtoul(sptr, hhptr, base);
#elif defined(OS5)
hostid = strtoul(sptr, hhptr, base);
#else
hostid = strtol(sptr, hhptr, base);
#endif
printf("Enter Host ID (starts with 0x if the number is hexadecimal): ");
sptr = fgets(s, sizeof(s), stdin);
hostid = strtoul(s, &eptr, 0);
/* look for syntax error */
if (**hhptr != '\0') {
printf("\nInvalid Host ID \n");
if (*eptr != '\n') {
printf("\nInvalid Host ID\n");
exit(FAILURE1);
};
/* make sure Host ID is less than 32 bits */
if (base == 16) {
sprintf(hstr, "%x", hostid);
for (i = 0; (cc = *(sptr + i)) != '\0'; ++i)
if (isupper(cc)) *(sptr + i) = tolower(cc);
for (i = 0; (cc = *(hstr + i)) != '\0'; ++i)
if (isupper(cc)) *(hstr + i) = tolower(cc);
digitstring = "123456789abcdef";
} else {
sprintf(hstr, "%u", hostid);
digitstring = "123456789";
};
/* trim off the trailing newline */
*eptr = '\0';
}
ptr = strpbrk(sptr, digitstring);
if ((ptr == NULL && *sptr != '0' && *hstr != '0') || (ptr != NULL && strcmp(ptr, hstr) != 0)) {
printf("\nInvalid Host ID \n");
/* make sure Host ID is less than 32 bits */
/* XXX: why?, is 32-bits not OK -- compare to original code */
if ((hostid & 0x7FFFFFFF) != hostid) {
printf("\nInvalid Host ID\n");
exit(FAILURE1);
}
};
}
hostid = modify(hostid);
/* == prompt for the expiration date and validate it == */
if (!commandlineargs) {
/* assume that info is not needed when we use argc,argv */
printf("\n\nEnter information string (one line only, below)\n:");
gets(infostring);
printf("Enter information string (one line only, below)\n:");
fgets(infostring, sizeof(infostring), stdin);
infostring[strlen(infostring) - 1] = '\0';
}
/* == prompt for the expiration date and validate it == */
if (commandlineargs) {
strcpy(expdate, *++argv);
} else {
printf("Enter Software Expiration Date (dd-mmm-yy or never): ");
gets(expdate);
fgets(expdate, sizeof(expdate), stdin);
expdate[strlen(expdate) - 1] = '\0';
}
strcpy(saveexpdate, expdate);
/* check for 'never' entry */
@ -189,14 +168,14 @@ int main(int argc, char **argv) {
};
/* == generate 3 keys == */
keyarray[0] = hash_unhash(hostid, hostid);
keyarray[1] = hash_unhash(((date_integer16(expdate) << 16) | 0), hostid);
keyarray[2] = make_verification(keyarray[0], keyarray[1]);
keys[0] = hash_unhash(hostid, hostid);
keys[1] = hash_unhash(((date_integer16(expdate) << 16) | 0), hostid);
keys[2] = make_verification(keys[0], keys[1]);
/* == report the results == */
if (commandlineargs) {
printf("%8x %8x %8x\n", *keyarray, *(keyarray + 1), *(keyarray + 2));
printf("%8lx %8lx %8lx\n", keys[0], keys[1], keys[2]);
exit(1);
} else {
/* if logfile is open, append the results to the end of the file */
@ -205,12 +184,11 @@ int main(int argc, char **argv) {
fprintf(fp, "\n%s", *++argv);
printf("\n%s", *argv);
}
writeresults(fp, sptr, saveexpdate, *keyarray, *(keyarray + 1), *(keyarray + 2), infostring);
writeresults(fp, sptr, saveexpdate, keys[0], keys[1], keys[2], infostring);
fclose(fp);
};
writeresults(stdout, sptr, saveexpdate, *keyarray, *(keyarray + 1), *(keyarray + 2),
infostring);
/* display the results on the terminal */
writeresults(stdout, sptr, saveexpdate, keys[0], keys[1], keys[2], infostring);
};
exit(0);
}

View File

@ -56,10 +56,10 @@ static char *id = "$Id: keytst.c,v 1.3 1999/05/31 23:35:36 sybalsky Exp $ Copyri
#define FAILURE4 -4
#define FAILURE99 -99
unsigned long make_verification(long unsigned int x, long unsigned int y);
unsigned long make_verification(unsigned long x, unsigned long y);
unsigned long date_integer16(char *date);
unsigned long idate(char *str);
unsigned long modify(long unsigned int hostid);
unsigned long modify(unsigned long hostid);
/* =====================================================================
KEYTESTER checks the input key string.

View File

@ -247,8 +247,9 @@ int sys_size; /* sysout size in megabytes */
machinetype = ifpage.machinetype;
if ((stat_buf.st_size & 0x1ff) != 0)
printf("CAUTION::sysout & 0x1ff = 0x%x\n", stat_buf.st_size & BYTESPER_PAGE);
if ((stat_buf.st_size & (BYTESPER_PAGE - 1)) != 0)
printf("CAUTION::not an integral number of pages. sysout & 0x1ff = 0x%x\n",
(int)(stat_buf.st_size & (BYTESPER_PAGE - 1)));
if (ifpage.nactivepages != (sysout_size / 2)) {
printf("sysout_loader:IFPAGE says sysout size is %d\n", ifpage.nactivepages);
@ -335,7 +336,7 @@ int sys_size; /* sysout size in megabytes */
lispworld_offset = GETFPTOVP(fptovp, i) * BYTESPER_PAGE;
if (read(sysout, lispworld_scratch + lispworld_offset, BYTESPER_PAGE) == -1) {
printf("sysout_loader: can't read sysout file at %d\n", i);
printf(" offset was 0x%x (0x%x pages).\n", lispworld_offset,
printf(" offset was 0x%lx (0x%x pages).\n", lispworld_offset,
GETFPTOVP(fptovp, i));
perror("read() error was");
{

View File

@ -630,7 +630,7 @@ void stack_check(StackWord *start68k) {
if (scanptr68k != start68k) {
if (scanptr68k > endstack68k) {
WARN("scanptr exceeded end stack",
printf("scanptr68k=0x%x endstack68k=0x%x", scanptr68k, endstack68k));
printf("scanptr68k=%p endstack68k=%p", scanptr68k, endstack68k));
}
}
} /* while end */
@ -707,7 +707,7 @@ void walk_stack(StackWord *start68k) {
printf(" End of stack = 0x%x.\n\n", (DLword *)endstack68k - Stackspace);
if (STKWORD(endstack68k)->flags != STK_GUARD)
printf("?? endstack is not GUARD BLK\nendstack = 0x%x, flags = %d\n\n", endstack68k,
printf("?? endstack is not GUARD BLK\nendstack = %p, flags = %d\n\n", endstack68k,
STKWORD(endstack68k)->flags);
while (scanptr68k < endstack68k) {
@ -800,7 +800,7 @@ void walk_stack(StackWord *start68k) {
if (scanptr68k != start68k) {
if (scanptr68k > endstack68k) {
WARN("scanptr exceeded end stack",
printf("scanptr68k=0x%x endstack68k=0x%x", scanptr68k, endstack68k));
printf("scanptr68k=%p endstack68k=%p", scanptr68k, endstack68k));
}
}
} /* while end */
@ -927,7 +927,7 @@ void quick_stack_check(void) {
if (scanptr68k != start68k) {
if (scanptr68k > endstack68k) {
WARN("scanptr exceeded end stack",
printf("scanptr68k=0x%x endstack68k=0x%x", scanptr68k, endstack68k));
printf("scanptr68k=%p endstack68k=%p", scanptr68k, endstack68k));
}
}
} /* while end */

View File

@ -263,7 +263,7 @@ extern int maxpages;
extern int *Lisp_errno;
extern int Dummy_errno; /* If errno cell is not provided by Lisp, dummy_errno is used. */
char keystring[128];
char keystring[128] = {""};
#define FALSE 0
#define TRUE !FALSE
@ -287,7 +287,7 @@ extern void dispatch();
int dosdisplaymode = 0;
int twobuttonflag = FALSE;
int eurokbd = TRUE; /* Assume eurokbd by default. */
char *helpstring =
const char *helpstring =
"\n\
medley [sysout-name] [<options>] ...\n\
Where <options> are:\n\
@ -305,7 +305,7 @@ Where <options> are:\n\
-info Print general info about the system\n\
-help Print this message\n";
#elif XWINDOW
char *helpstring =
const char *helpstring =
"\n\
either setenv LDESRCESYSOUT or do:\n\
medley [<sysout-name>] [<options>]\n\
@ -317,7 +317,7 @@ char *helpstring =
-g[eometry] <geom>] The Medley screen geometry\n\
-sc[reen] <w>x<h>] The Medley screen geometry\n";
#else /* not DOS, not XWINDOW */
char *helpstring =
const char *helpstring =
"\n\
either setenv LDESRCESYSOUT or do:\n\
lde[ether] [sysout-name] [-k access-key] [<options>]\n\
@ -382,7 +382,7 @@ char **argv;
}
if (argv[i] && ((strcmp(argv[i], "-help") == 0) || (strcmp(argv[i], "-HELP") == 0))) {
fprintf(stderr, helpstring);
fprintf(stderr, "%s", helpstring);
exit(0);
}
@ -400,7 +400,7 @@ char **argv;
#endif /* DOS */
|| access(sysout_name, R_OK)) {
fprintf(stderr, "Couldn't find a sysout to run;\n");
fprintf(stderr, helpstring);
fprintf(stderr, "%s", helpstring);
exit(1);
}
/* OK, sysout name is now in sysout_name, and i is moved past a supplied name */
@ -514,8 +514,7 @@ char **argv;
}
#endif /* DOS */
if (keystring) /* key given, so safe to copy */
strcpy(keytyped, keystring);
strcpy(keytyped, keystring);
if (keytester(keystring)) { /* keytester destroys keystring */
fprintf(stderr, "Sorry, invalid or expired access key.\n");

View File

@ -32,6 +32,7 @@ static char *id = "$Id: return.c,v 1.4 2001/12/24 01:09:05 sybalsky Exp $ Copyri
*/
/***********************************************************/
#include <stdio.h>
#include "lispemul.h"
#include "address.h"

View File

@ -73,7 +73,8 @@ LispPTR rpc(args) LispPTR *args;
register int s, msec_until_timeout, msec_between_tries, out_length;
register int received, mask;
register int port;
int dontblock, dest, fromlen, read_descriptors;
int dontblock, dest, read_descriptors;
unsigned fromlen;
struct timeval pertry_timeout, total_timeout, time_waited;

View File

@ -45,7 +45,7 @@ struct cadr_cell cadr(LispPTR cell_adr)
struct cadr_cell cadr1; /* return value */
short offset;
if (Listp(cell_adr) == NIL)
if (Listp(cell_adr) == NIL) {
if (cell_adr == NIL) {
cadr1.car_cell = 0;
cadr1.cdr_cell = 0;
@ -55,7 +55,7 @@ struct cadr_cell cadr(LispPTR cell_adr)
cadr1.cdr_cell = cdr(cell_adr);
return (cadr1);
}
}
pcons = (ConsCell *)Addr68k_from_LADDR(cell_adr);
while (pcons->cdr_code == CDR_INDIRECT) {
/* CDR indirect */

View File

@ -586,7 +586,7 @@ void lisp_finish() {
/* following 5 lines don't work well. */
d[0] = 'E';
d[3] = 1;
/* These only happen if the fork really succeeded:
/* These only happen if the fork really succeeded: */
/* if (UnixPipeOut >= 0) write(UnixPipeOut, d, 4); */
/* if (UnixPipeIn >= 0 read(UnixPipeIn, d, 4);*/ /* Make sure it's finished */
/* if (UnixPID >= 0) kill(UnixPID, SIGKILL);*/ /* Then kill fork_Unix itself */

View File

@ -37,8 +37,7 @@ extern DspInterface currentdsp;
/* dummy is the placeholder for the bitmap to be blitted */
/* */
/************************************************************************/
unsigned long clipping_Xbitblt(dsp, dummy, x, y, w, h) DspInterface dsp;
int dummy, x, y, w, h;
unsigned long clipping_Xbitblt(DspInterface dsp, int dummy, int x, int y, int w, int h)
{
int temp_x, temp_y, LowerRightX, LowerRightY;

View File

@ -248,10 +248,10 @@ Cursor *return_cursor;
XLOCK;
screen = ScreenOfDisplay(dsp->display_id, DefaultScreen(dsp->display_id));
Cursor_src = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, image, 16, 16, 1, 0,
1); /* Has to have a depth of 1! */
Cursor_msk = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, image, 16, 16, 1, 0,
1); /* Has to have a depth of 1! */
Cursor_src = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, (char *)image,
16, 16, 1, 0, 1); /* Has to have a depth of 1! */
Cursor_msk = XCreatePixmapFromBitmapData(dsp->display_id, dsp->DisplayWindow, (char *)image,
16, 16, 1, 0, 1); /* Has to have a depth of 1! */
*return_cursor = XCreatePixmapCursor(dsp->display_id, Cursor_src, Cursor_msk, &cursor_fore_xcsd,
&cursor_back_xcsd, hotspot_x, hotspot_y);

View File

@ -72,11 +72,11 @@ int Byte_Order, Bitmap_Bit_Order, Bitmap_Pad, Default_Depth, Display_Height, Dis
int LispWindowRequestedX = 0;
int LispWindowRequestedY = 0;
int LispWindowRequestedWidth = DEF_WIN_WIDTH;
int LispWindowRequestedHeight = DEF_WIN_HEIGHT;
unsigned LispWindowRequestedWidth = DEF_WIN_WIDTH;
unsigned LispWindowRequestedHeight = DEF_WIN_HEIGHT;
int LispDisplayRequestedX, LispDisplayRequestedY, LispDisplayRequestedWidth,
LispDisplayRequestedHeight;
int LispDisplayRequestedX, LispDisplayRequestedY;
unsigned LispDisplayRequestedWidth, LispDisplayRequestedHeight;
Colormap Colors;

View File

@ -60,8 +60,8 @@ XEvent report;
Cursor WaitCursor, DefaultCursor, VertScrollCursor, VertThumbCursor, ScrollUpCursor,
ScrollDownCursor, HorizScrollCursor, HorizThumbCursor, ScrollLeftCursor, ScrollRightCursor;
extern int LispWindowRequestedX, LispWindowRequestedY, LispWindowRequestedWidht,
LispWindowRequestedHeight;
extern int LispWindowRequestedX, LispWindowRequestedY;
extern unsigned LispWindowRequestedWidth, LispWindowRequestedHeight;
/************************************************************************/
/* */
@ -73,15 +73,15 @@ extern int LispWindowRequestedX, LispWindowRequestedY, LispWindowRequestedWidht,
void Create_LispWindow(dsp) DspInterface dsp;
{
XSizeHints szhint;
XWMHints Lisp_WMhints;
XClassHint xclasshint;
XTextProperty IconText, WindowNameText;
XSetWindowAttributes Lisp_SetWinAttributes;
XSizeHints szhint = {0};
XWMHints Lisp_WMhints = {0};
XClassHint xclasshint = {0};
XTextProperty IconText = {0}, WindowNameText = {0};
XSetWindowAttributes Lisp_SetWinAttributes = {0};
Screen *screen;
Window lspwinRoot;
Window lspwinRoot = {0};
int lspwinX, lspwinY, Col2, Row2, Col3, Row3, GravSize;
unsigned int lspwinHeight, lspwinWidth, lspwinBorder, lspwinDepth;
char *WT, *IT;
@ -130,7 +130,7 @@ void Create_LispWindow(dsp) DspInterface dsp;
szhint.min_width = OUTER_SB_WIDTH(dsp);
szhint.min_height = OUTER_SB_WIDTH(dsp);
szhint.win_gravity = dsp->BitGravity;
szhint.flags = PMaxSize | PWinGravity | PSize | PPosition;
szhint.flags = PMaxSize | PWinGravity | PSize;
Lisp_WMhints.icon_pixmap = make_Xicon(dsp);
Lisp_WMhints.input = True;

View File

@ -42,11 +42,11 @@ static char *id = "$Id: xrdopt.c,v 1.6 2001/12/26 22:17:07 sybalsky Exp $ Copyri
XrmDatabase commandlineDB, applicationDB, serverDB, homeDB, rDB;
int opTableEntries = 33;
extern int LispWindowRequestedX, LispWindowRequestedY, LispWindowRequestedWidth,
LispWindowRequestedHeight;
extern int LispWindowRequestedX, LispWindowRequestedY;
extern unsigned LispWindowRequestedWidth, LispWindowRequestedHeight;
extern int LispDisplayRequestedX, LispDisplayRequestedY, LispDisplayRequestedWidth,
LispDisplayRequestedHeight;
extern int LispDisplayRequestedX, LispDisplayRequestedY;
extern unsigned LispDisplayRequestedWidth, LispDisplayRequestedHeight;
extern int xsync;

View File

@ -29,10 +29,9 @@ static char *id = "$Id: xscroll.c,v 1.2 1999/01/03 02:07:48 sybalsky Exp $ Copyr
int ScrollPitch = SCROLL_PITCH;
/* Move the DisplayWindow and the ScrollButtons to a new */
/* position. newX, newY refers to the uppre left corner */
/* position. newX, newY refers to the upper left corner */
/* of the LispDisplay */
void Scroll(dsp, newX, newY) DspInterface dsp;
int newX, newY;
void Scroll(DspInterface dsp, int newX, int newY)
{
/* Limit the newX and newY values. */
dsp->Vissible.x = bound(0, newX, dsp->Display.width - dsp->Vissible.width);
@ -48,20 +47,20 @@ int newX, newY;
dsp->Vissible.height);
} /* end Scroll */
void JumpScrollVer(dsp, y) DspInterface dsp;
void JumpScrollVer(DspInterface dsp, int y)
{ Scroll(dsp, dsp->Vissible.x, (int)((dsp->Display.width * y) / dsp->Vissible.height)); }
void JumpScrollHor(dsp, x) DspInterface dsp;
void JumpScrollHor(DspInterface dsp, int x)
{ Scroll(dsp, (int)((dsp->Display.width * x) / dsp->Vissible.width), dsp->Vissible.y); }
void ScrollLeft(dsp) DspInterface dsp;
void ScrollLeft(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x - ScrollPitch, dsp->Vissible.y); }
void ScrollRight(dsp) DspInterface dsp;
void ScrollRight(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x + ScrollPitch, dsp->Vissible.y); }
void ScrollUp(dsp) DspInterface dsp;
void ScrollUp(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x, dsp->Vissible.y - ScrollPitch); }
void ScrollDown(dsp) DspInterface dsp;
void ScrollDown(DspInterface dsp)
{ Scroll(dsp, dsp->Vissible.x, dsp->Vissible.y + ScrollPitch); }

View File

@ -29,6 +29,7 @@ static char *id = "$Id: xwinman.c,v 1.3 2001/12/26 22:17:07 sybalsky Exp $ Copyr
#include "lispemul.h"
#include "devif.h"
#include "xdefs.h"
#include "xscroll.h"
int Mouse_Included = FALSE;
@ -60,10 +61,7 @@ int bound(a, b, c) int a, b, c;
return (b);
}
void Set_BitGravity(event, dsp, window, grav) XButtonEvent *event;
DspInterface dsp;
Window window;
int grav;
void Set_BitGravity(XButtonEvent *event, DspInterface dsp, Window window, int grav)
{
XSetWindowAttributes Lisp_SetWinAttributes;
Window OldWindow;
@ -87,8 +85,7 @@ int grav;
XUNLOCK;
} /* end Set_BitGravity */
void lisp_Xconfigure(dsp, x, y, lspWinWidth, lspWinHeight) DspInterface dsp;
int x, y, lspWinWidth, lspWinHeight;
void lisp_Xconfigure(DspInterface dsp, int x, int y, int lspWinWidth, int lspWinHeight)
{
int GravSize, Col2, Row2, Col3, Row3;
@ -142,7 +139,7 @@ int x, y, lspWinWidth, lspWinHeight;
XUNLOCK;
} /* end lisp_Xconfigure */
void enable_Xkeyboard(dsp) DspInterface dsp;
void enable_Xkeyboard(DspInterface dsp)
{
XLOCK;
XSelectInput(dsp->display_id, dsp->DisplayWindow, dsp->EnableEventMask);
@ -150,7 +147,7 @@ void enable_Xkeyboard(dsp) DspInterface dsp;
XUNLOCK;
}
void disable_Xkeyboard(dsp) DspInterface dsp;
void disable_Xkeyboard(DspInterface dsp)
{
XLOCK;
XSelectInput(dsp->display_id, dsp->DisplayWindow, dsp->DisableEventMask);
@ -158,7 +155,7 @@ void disable_Xkeyboard(dsp) DspInterface dsp;
XUNLOCK;
}
void beep_Xkeyboard(dsp) DspInterface dsp;
void beep_Xkeyboard(DspInterface dsp)
{
#ifdef TRACE
printf("TRACE: beep_Xkeyboard()\n");
@ -181,7 +178,7 @@ void beep_Xkeyboard(dsp) DspInterface dsp;
extern int Current_Hot_X, Current_Hot_Y; /* Cursor hotspot */
void getXsignaldata(dsp) DspInterface dsp;
void getXsignaldata(DspInterface dsp)
{
XEvent report;
@ -261,14 +258,14 @@ void getXsignaldata(dsp) DspInterface dsp;
switch (report.xbutton.button) {
case Button1:
DefineCursor(dsp->display_id, dsp->HorScrollBar, &ScrollLeftCursor);
ScrollLeft(dsp, report);
ScrollLeft(dsp);
break;
case Button2:
DefineCursor(dsp->display_id, dsp->HorScrollBar, &HorizThumbCursor);
break;
case Button3:
DefineCursor(dsp->display_id, dsp->HorScrollBar, &ScrollRightCursor);
ScrollRight(dsp, report);
ScrollRight(dsp);
break;
default: break;
} /* end switch */