Skip to content

Commit

Permalink
Remove Create_N_Set_Cell() which is unused since native code is not s…
Browse files Browse the repository at this point in the history
…upported.
  • Loading branch information
nbriggs committed Aug 24, 2021
1 parent 28ea238 commit 934a86f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion inc/mkcelldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
#include "lispemul.h" /* for LispPTR, DLword */
LispPTR N_OP_createcell(register LispPTR tos);
DLword *createcell68k(unsigned int type);
LispPTR Create_n_Set_Cell(unsigned int type, LispPTR value);
#endif
42 changes: 0 additions & 42 deletions src/mkcell.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,45 +158,3 @@ DLword *createcell68k(unsigned int type) {
}

} /* createcell68k end */

/**********************************************************/
/* Create a Cell of Specified Type & Set to given Value */
/* Works with 32 bit typed values only. */
/* (Initially used only by native code) */
/**********************************************************/

LispPTR Create_n_Set_Cell(unsigned int type, LispPTR value) {
register struct dtd *dtd68k;
register DLword *ptr, *lastptr;
register LispPTR newcell;

dtd68k = (struct dtd *)GetDTD(type);

if (dtd68k->dtd_size == 0) error("createcell : Attempt to create a cell not declared yet");

retry:
if ((newcell = (dtd68k->dtd_free & POINTERMASK)) != NIL) {
ptr = Addr68k_from_LADDR(newcell);

/* replace dtd_free with newcell's top DLword (it may keep next chain)*/

dtd68k->dtd_free = (*((LispPTR *)ptr)) & POINTERMASK;
dtd68k->dtd_oldcnt++;
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain.");

/* clear 0 */
for (lastptr = ptr + dtd68k->dtd_size; ptr != lastptr; ptr++) { GETWORD(ptr) = 0; }

/* IncAllocCnt(1); */
GCLOOKUP(newcell, DELREF);
(*((LispPTR *)Addr68k_from_LADDR(newcell))) = value;
return (newcell);

} else {
dtd68k->dtd_free = initmdspage(alloc_mdspage(dtd68k->dtd_typeentry), dtd68k->dtd_size, NIL);
if (dtd68k->dtd_free & 0x8000000) error("bad entry on free chain.");

goto retry;
}

} /* createcell68k end */

0 comments on commit 934a86f

Please sign in to comment.