mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-03 06:49:22 +00:00
Correct parameter type declaration error for N_OP_ubfloat1
Ensure pointers have appropriate alignment for data being referenced
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#ifndef UBF1DEFS_H
|
#ifndef UBF1DEFS_H
|
||||||
#define UBF1DEFS_H 1
|
#define UBF1DEFS_H 1
|
||||||
#include "lispemul.h" /* for LispPTR */
|
#include "lispemul.h" /* for LispPTR */
|
||||||
LispPTR N_OP_ubfloat1(int arg, int alpha);
|
LispPTR N_OP_ubfloat1(LispPTR arg, int alpha);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
10
src/ubf1.c
10
src/ubf1.c
@@ -27,21 +27,21 @@
|
|||||||
355/4 UFIX
|
355/4 UFIX
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
LispPTR N_OP_ubfloat1(int arg, int alpha) {
|
LispPTR N_OP_ubfloat1(LispPTR arg, int alpha) {
|
||||||
switch (alpha) {
|
switch (alpha) {
|
||||||
case 0: /* box */
|
case 0: /* box */
|
||||||
{
|
{
|
||||||
DLword *wordp;
|
LispPTR *wordp;
|
||||||
wordp = createcell68k(TYPE_FLOATP);
|
wordp = createcell68k(TYPE_FLOATP);
|
||||||
*((int *)wordp) = arg;
|
*wordp = arg;
|
||||||
return (LAddrFromNative(wordp));
|
return (LAddrFromNative(wordp));
|
||||||
}
|
}
|
||||||
case 1: /* unbox */
|
case 1: /* unbox */
|
||||||
{
|
{
|
||||||
float dest;
|
float dest;
|
||||||
int ret;
|
LispPTR ret;
|
||||||
N_MakeFloat(arg, dest, arg);
|
N_MakeFloat(arg, dest, arg);
|
||||||
ret = *(int *)&dest;
|
ret = *(LispPTR *)&dest;
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
case 2: /* abs */ return (0x7FFFFFFF & arg);
|
case 2: /* abs */ return (0x7FFFFFFF & arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user