1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-28 04:38:00 +00:00

Merge hacks.c into foreign.c. (#212)

This code was not really valid ANSI C in the way that it was
used, and it was only used by foreign.c, which is #ifdef'd out.
This commit is contained in:
Bruce Mitchener
2021-01-12 13:45:49 +07:00
committed by GitHub
parent fac400f918
commit 5cb18c0710
12 changed files with 26 additions and 67 deletions

View File

@@ -345,6 +345,18 @@ LispPTR call_c_fn(LispPTR *args) {
}
}
/* These functions are created so that you can split a float into */
/* four integers. The general idea behind these functions is to */
/* act as a caster between different entities on the stack */
/* These used to live in hacks.c, but were only used here. The code */
/* involved here is not valid ANSI C and will have to be fixed before */
/* this code can be used again. */
static int pickapart1(int i1, int i2, int i3, int i4) { return (i1); }
static int pickapart2(int i1, int i2, int i3, int i4) { return (i2); }
static int pickapart3(int i1, int i2, int i3, int i4) { return (i3); }
static int pickapart4(int i1, int i2, int i3, int i4) { return (i4); }
/************************************************************************/
/* */
/* S M A S H I N G _ C _ F N */
@@ -371,7 +383,6 @@ LispPTR call_c_fn(LispPTR *args) {
LispPTR smashing_c_fn(LispPTR *args) {
int intarg[Max_Arg], result, i, j;
int fnaddr, resulttype, *errorflag, arglistlength, *descriptorblock;
PFI pickapart1, pickapart2, pickapart3, pickapart4;
float fresult;
int *valueplace;

View File

@@ -1,24 +0,0 @@
/* $Id: hacks.c,v 1.3 1999/05/31 23:35:33 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"
#include "hacksdefs.h"
/* These functions are created so that you can split a float into */
/* four integers. The general idea behind these functions is to */
/* act as a caster between different entitys on the stack */
int pickapart1(int i1, int i2, int i3, int i4) { return (i1); }
int pickapart2(int i1, int i2, int i3, int i4) { return (i2); }
int pickapart3(int i1, int i2, int i3, int i4) { return (i3); }
int pickapart4(int i1, int i2, int i3, int i4) { return (i4); }