1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-16 00:04:59 +00:00
Interlisp.maiko/src/typeof.c
Bruce Mitchener 1d9c9eaa3f
Cleanup typeof.c (#156)
* instanceof: Remove unused local var `type`.

* Remove unused N_OP_dtest.

This isn't used to actually implement the op. That is done via
the `DTEST` macro defined in `inc/inlineC.h` which duplicated
this code with minor differences in how it signals the error.
2021-01-03 10:33:31 -08:00

54 lines
1.7 KiB
C

/* $Id: typeof.c,v 1.3 1999/05/31 23:35:44 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/************************************************************************/
#include "version.h"
/****************************************************************/
/* LISTP(3Q),NTYPEX(4Q),TYPEP(5Q),DTEST(6Q) ,INSTANCEP(303Q) */
/****************************************************************/
/*
changed : Jan. 13 1987 take
changed : Feb. 05 1987 take
changed : Jul. 24 1987 take
*/
#include "lispemul.h"
#include "lsptypes.h"
#include "cell.h"
#include "lispmap.h"
#include "lspglob.h"
#include "typeofdefs.h"
/************************************************************************/
/* */
/* N _ O P _ i n s t a n c e p */
/* */
/* Returns T if tos has type named by atom_index, else NIL. */
/* */
/************************************************************************/
LispPTR N_OP_instancep(register LispPTR tos, register int atom_index) {
register struct dtd *dtd68k;
for (dtd68k = (struct dtd *)GetDTD(GetTypeNumber(tos));
#ifdef BIGVM
atom_index != dtd68k->dtd_name;
#else
atom_index != dtd68k->dtd_namelo + (dtd68k->dtd_namehi << 16);
#endif /* BIGVM */
dtd68k = (struct dtd *)GetDTD(dtd68k->dtd_supertype)) {
if (dtd68k->dtd_supertype == 0) { return (NIL_PTR); }
}
return (ATOM_T);
} /* N_OP_instancep END */