Use intptr_t and uintptr_t

Thanks @krytarowski
This commit is contained in:
Lassi Kortela 2020-03-16 12:46:31 +02:00
parent 1006496256
commit 0bf4243ae0
4 changed files with 16 additions and 40 deletions

View File

@ -27,15 +27,10 @@
#include <stdlib.h>
#include <string.h>
#ifdef __LP64__
#define NUM_FORMAT "%" PRId64
typedef uint64_t value_t;
typedef int64_t number_t;
#else
#define NUM_FORMAT "%" PRId32
typedef uint32_t value_t;
typedef int32_t number_t;
#endif
#define NUM_FORMAT "%" PRIdPTR
typedef intptr_t number_t;
typedef uintptr_t value_t;
typedef struct {
value_t car;

View File

@ -27,15 +27,10 @@
#include <stdlib.h>
#include <string.h>
#ifdef __LP64__
#define NUM_FORMAT "%" PRId64
typedef uint64_t value_t;
typedef int64_t number_t;
#else
#define NUM_FORMAT "%" PRId32
typedef uint32_t value_t;
typedef int32_t number_t;
#endif
#define NUM_FORMAT "%" PRIdPTR
typedef intptr_t number_t;
typedef uintptr_t value_t;
typedef struct {
value_t car;

View File

@ -48,15 +48,10 @@
#include <stdlib.h>
#include <string.h>
#ifdef __LP64__
#define NUM_FORMAT "%" PRId64
typedef uint64_t value_t;
typedef int64_t number_t;
#else
#define NUM_FORMAT "%" PRId32
typedef uint32_t value_t;
typedef int32_t number_t;
#endif
#define NUM_FORMAT "%" PRIdPTR
typedef intptr_t number_t;
typedef uintptr_t value_t;
typedef struct {
value_t car;

View File

@ -33,25 +33,16 @@
#include <stdlib.h>
#include <string.h>
#ifdef __LP64__
typedef uint64_t value_t;
#else
typedef uint32_t value_t;
#endif
#ifdef FLOAT
#define NUM_FORMAT "%f"
typedef float number_t;
#else
#ifdef __LP64__
#define NUM_FORMAT "%" PRId64
typedef int64_t number_t;
#else
#define NUM_FORMAT "%" PRId32
typedef int32_t number_t;
#endif
#define NUM_FORMAT "%" PRIdPTR
typedef intptr_t number_t;
#endif
typedef uintptr_t value_t;
typedef struct {
value_t car;
value_t cdr;