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

Switch s_char uses to signed char. Remove s_char alias. (#208)

This commit is contained in:
Bruce Mitchener 2021-01-12 10:00:33 +07:00 committed by GitHub
parent 5a8f20c0ca
commit ec04803b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 29 deletions

View File

@ -38,12 +38,12 @@
/* For getting a signed byte */
#ifndef BYTESWAP
/* in the unswapped case, the type of the argument carries through to the result */
#define Get_SBYTE_PCMAC0 GETBYTE((s_char *)PCMAC)
#define Get_SBYTE_PCMAC1 GETBYTE((s_char *)PCMAC+1)
#define Get_SBYTE_PCMAC0 GETBYTE((int8_t *)PCMAC)
#define Get_SBYTE_PCMAC1 GETBYTE((int8_t *)PCMAC+1)
#else
/* cf. GETBYTE in lsptypes.h */
#define Get_SBYTE_PCMAC0 (* (s_char *) (3^(UNSIGNED)(PCMAC)))
#define Get_SBYTE_PCMAC1 (* (s_char *) (3^(UNSIGNED)(PCMAC+1)))
#define Get_SBYTE_PCMAC0 (* (int8_t *) (3^(UNSIGNED)(PCMAC)))
#define Get_SBYTE_PCMAC1 (* (int8_t *) (3^(UNSIGNED)(PCMAC+1)))
#endif
/* for getting an atom number, e.g., for FNx or DTEST */

View File

@ -217,16 +217,6 @@ error Must specify RELEASE to build Medley.
/********************************************************/
/* */
/********************************************************/
#ifdef sun
typedef signed char s_char;
#endif /* sun */
/********************************************************/
/* */
/********************************************************/
@ -255,23 +245,12 @@ typedef signed char s_char;
/********************************************************/
#ifdef LINUX
/* LINUX, the free POSIX-compliant Unix */
typedef signed char s_char;
#undef UNALIGNED_FETCH_OK
#endif /* LINUX */
/********************************************************/
/* */
/********************************************************/
#if defined(MACOSX) || defined(FREEBSD) || defined(OPENBSD)
/* MacOS X, FreeBSD - mostly POSIX-compliant Unix */
typedef signed char s_char;
#endif /* MACOSX || FREEBSD */
/********************************************************/
/* */
/********************************************************/
@ -286,7 +265,6 @@ typedef signed char s_char;
#ifdef DOS
typedef unsigned char u_char;
typedef unsigned long u_int;
typedef signed char s_char;
typedef unsigned short u_short;
#undef UNALIGNED_FETCH_OK
#undef HAS_GETHOSTID

View File

@ -41,6 +41,7 @@
*/
#include <stdint.h>
#include <stdio.h>
#include <setjmp.h>
@ -774,12 +775,12 @@ int print_opcode(int pc, DLbyte *addr, struct fnhead *fnobj) {
case 0263: /* TJUMPX */
case 0264: /* NFJUMPX */
case 0265: /* NTJUMPX */
printf(" 0%o (0x%x)\n", pc + (s_char)GETBYTE(addr + 1), pc + (s_char)GETBYTE(addr + 1));
printf(" 0%o (0x%x)\n", pc + (int8_t)GETBYTE(addr + 1), pc + (int8_t)GETBYTE(addr + 1));
break;
case 0261: /* JUMPXX */
printf(" 0%o (0x%x)\n",
pc + ((s_char)GETBYTE(addr + 1) << 8) + (unsigned char)GETBYTE(addr + 2),
pc + ((s_char)GETBYTE(addr + 1) << 8) + (unsigned char)GETBYTE(addr + 2));
pc + ((int8_t)GETBYTE(addr + 1) << 8) + (uint8_t)GETBYTE(addr + 2),
pc + ((int8_t)GETBYTE(addr + 1) << 8) + (uint8_t)GETBYTE(addr + 2));
break;
case 0120: /* FVAR opcodes */
case 0121:

View File

@ -20,6 +20,7 @@
/* */
/************************************************************************/
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>