summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-28 06:37:23 +0000
committerKaz Kylheku <kaz@kylheku.com>2020-04-28 06:37:23 +0000
commit362a3c56d0eef8d12bae8b8555baafc404c2f22f (patch)
treec984224943c71db252c2ffe99793d86f5d64ac48
parent6fdc35bbca1fd79d2c315ae67dcac1e1eb3d6aa8 (diff)
downloadtxr-362a3c56d0eef8d12bae8b8555baafc404c2f22f.tar.gz
txr-362a3c56d0eef8d12bae8b8555baafc404c2f22f.tar.bz2
txr-362a3c56d0eef8d12bae8b8555baafc404c2f22f.zip
ffi: big-endian: unused parameter warnings.
* ffi.c (ffi_i8_rput, ffi_i8_rget, ffi_u8_rput, ffi_u8_rget, ffi_i16_rput, ffi_i16_rget, ffi_u16_rput, ffi_u16_rget, ffi_i32_rput, ffi_i32_rget, ffi_u32_rput, ffi_u32_rget, ffi_char_rput, ffi_char_rget, ffi_uchar_rput, ffi_uchar_rget, ffi_bchar_rget, ffi_short_rput, ffi_short_rget, ffi_ushort_rput, ffi_ushort_rget, ffi_int_rput, ffi_int_rget, ffi_uint_rput, ffi_uint_rget, ffi_long_rput, ffi_long_rget, ffi_ulong_rput, ffi_ulong_rget, ffi_wchar_rput, ffi_wchar_rget, ffi_be_i16_rput): Add casts to suppress warnings about unused tft and self.
-rw-r--r--ffi.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 34f4ff61..59684b32 100644
--- a/ffi.c
+++ b/ffi.c
@@ -1544,22 +1544,29 @@ static val ffi_bool_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i8_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i8_t v = c_i8(n, self);
+ (void) tft;
*coerce(i8_t *, dst) = v;
}
static val ffi_i8_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast(*src);
}
static void ffi_u8_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u8_t v = c_u8(n, self);
+ (void) tft;
+ (void) self;
*coerce(u8_t *, dst) = v;
}
static val ffi_u8_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast(*coerce(u8_t *, src));
}
@@ -1567,24 +1574,32 @@ static val ffi_u8_rget(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i16_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i16_t v = c_i16(n, self);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_i16_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
i16_t n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
}
static void ffi_u16_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u16_t v = c_u16(n, self);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_u16_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
u16_t n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
}
#endif
@@ -1593,12 +1608,16 @@ static val ffi_u16_rget(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i32_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i32_t v = c_i32(n, self);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_i32_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
i32_t n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num(n);
}
#endif
@@ -1606,23 +1625,30 @@ static val ffi_i32_rget(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_u32_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u32_t v = c_u32(n, self);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_u32_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
u32_t n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return unum(n);
}
static void ffi_char_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
char v = c_char(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_char_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return chr((char) *coerce(ffi_arg *, src));
}
@@ -1630,16 +1656,21 @@ static void ffi_uchar_rput(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
unsigned char v = c_uchar(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_uchar_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast((unsigned char) *coerce(ffi_arg *, src));
}
static val ffi_bchar_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return chr((unsigned char) *coerce(ffi_arg *, src));
}
@@ -1647,12 +1678,15 @@ static void ffi_short_rput(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
short v = c_short(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_short_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
short n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
}
@@ -1660,60 +1694,76 @@ static void ffi_ushort_rput(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
unsigned short v = c_ushort(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_ushort_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned short n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
}
static void ffi_int_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
int v = c_int(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_int_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
int n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num(n);
}
static void ffi_uint_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
unsigned v = c_uint(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_uint_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return unum(n);
}
static void ffi_long_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
long v = c_long(n, self);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_long_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
long n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return num(n);
}
static void ffi_ulong_rput(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
unsigned long v = c_ulong(n, self);
+ (void) tft;
*coerce(ffi_arg *, dst) = v;
}
static val ffi_ulong_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned long n = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return unum(n);
}
@@ -1721,19 +1771,23 @@ static void ffi_wchar_rput(struct txr_ffi_type *tft, val ch, mem_t *dst,
val self)
{
wchar_t c = c_chr(ch);
+ (void) tft;
+ (void) self;
*coerce(ffi_arg *, dst) = c;
}
static val ffi_wchar_rget(struct txr_ffi_type *tft, mem_t *src, val self)
{
wchar_t c = *coerce(ffi_arg *, src);
+ (void) tft;
+ (void) self;
return chr(c);
}
static void ffi_be_i16_rput(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
- memset(dst, 0, 6);
+ (void) tft;
ffi_be_i16_put(tft, n, dst + 6, self);
}