More VM cleanups
parent
69cb3dee5e
commit
9ef162e2ef
|
@ -90,7 +90,7 @@ inline static cell tag_for(cell type)
|
||||||
return type < HEADER_TYPE ? type : OBJECT_TYPE;
|
return type < HEADER_TYPE ? type : OBJECT_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
class object;
|
struct object;
|
||||||
|
|
||||||
struct header {
|
struct header {
|
||||||
cell value;
|
cell value;
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
/* C++ headers */
|
/* C++ headers */
|
||||||
#if __GNUC__ == 4
|
#if __GNUC__ == 4
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/param.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -24,13 +26,13 @@ typedef char symbol_char;
|
||||||
#define FSEEK fseeko
|
#define FSEEK fseeko
|
||||||
|
|
||||||
#define FIXNUM_FORMAT "%ld"
|
#define FIXNUM_FORMAT "%ld"
|
||||||
#define cell_FORMAT "%lu"
|
#define CELL_FORMAT "%lu"
|
||||||
#define cell_HEX_FORMAT "%lx"
|
#define CELL_HEX_FORMAT "%lx"
|
||||||
|
|
||||||
#ifdef FACTOR_64
|
#ifdef FACTOR_64
|
||||||
#define cell_HEX_PAD_FORMAT "%016lx"
|
#define CELL_HEX_PAD_FORMAT "%016lx"
|
||||||
#else
|
#else
|
||||||
#define cell_HEX_PAD_FORMAT "%08lx"
|
#define CELL_HEX_PAD_FORMAT "%08lx"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIXNUM_FORMAT "%ld"
|
#define FIXNUM_FORMAT "%ld"
|
||||||
|
|
|
@ -22,14 +22,14 @@ typedef wchar_t vm_char;
|
||||||
#define FSEEK fseek
|
#define FSEEK fseek
|
||||||
|
|
||||||
#ifdef WIN64
|
#ifdef WIN64
|
||||||
#define cell_FORMAT "%Iu"
|
#define CELL_FORMAT "%Iu"
|
||||||
#define cell_HEX_FORMAT "%Ix"
|
#define CELL_HEX_FORMAT "%Ix"
|
||||||
#define cell_HEX_PAD_FORMAT "%016Ix"
|
#define CELL_HEX_PAD_FORMAT "%016Ix"
|
||||||
#define FIXNUM_FORMAT "%Id"
|
#define FIXNUM_FORMAT "%Id"
|
||||||
#else
|
#else
|
||||||
#define cell_FORMAT "%lu"
|
#define CELL_FORMAT "%lu"
|
||||||
#define cell_HEX_FORMAT "%lx"
|
#define CELL_HEX_FORMAT "%lx"
|
||||||
#define cell_HEX_PAD_FORMAT "%08lx"
|
#define CELL_HEX_PAD_FORMAT "%08lx"
|
||||||
#define FIXNUM_FORMAT "%ld"
|
#define FIXNUM_FORMAT "%ld"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,17 +32,17 @@ void print_string(const char *str)
|
||||||
|
|
||||||
void print_cell(cell x)
|
void print_cell(cell x)
|
||||||
{
|
{
|
||||||
printf(cell_FORMAT,x);
|
printf(CELL_FORMAT,x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_cell_hex(cell x)
|
void print_cell_hex(cell x)
|
||||||
{
|
{
|
||||||
printf(cell_HEX_FORMAT,x);
|
printf(CELL_HEX_FORMAT,x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_cell_hex_pad(cell x)
|
void print_cell_hex_pad(cell x)
|
||||||
{
|
{
|
||||||
printf(cell_HEX_PAD_FORMAT,x);
|
printf(CELL_HEX_PAD_FORMAT,x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_fixnum(fixnum x)
|
void print_fixnum(fixnum x)
|
||||||
|
@ -53,7 +53,7 @@ void print_fixnum(fixnum x)
|
||||||
cell read_cell_hex()
|
cell read_cell_hex()
|
||||||
{
|
{
|
||||||
cell cell;
|
cell cell;
|
||||||
if(scanf(cell_HEX_FORMAT,&cell) < 0) exit(1);
|
if(scanf(CELL_HEX_FORMAT,&cell) < 0) exit(1);
|
||||||
return cell;
|
return cell;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue