From bf53d6c7d19f877c821901b3288d7f80955ffbb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Tue, 3 Dec 2019 14:47:38 +0900 Subject: other minior internal header tweaks These headers need no rewrite. Just add some minor tweaks, like addition of #include lines. Mainly cosmetic. TIMET_MAX_PLUS_ONE was deleted because the macro was used from only one place (directly write expression there). --- internal/rational.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/rational.h') diff --git a/internal/rational.h b/internal/rational.h index 993d056927..c783c5162b 100644 --- a/internal/rational.h +++ b/internal/rational.h @@ -9,6 +9,8 @@ * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. */ +#include "ruby/config.h" /* for HAVE_LIBGMP */ +#include "ruby/ruby.h" /* for struct RBasic */ struct RRational { struct RBasic basic; @@ -17,8 +19,8 @@ struct RRational { }; #define RRATIONAL(obj) (R_CAST(RRational)(obj)) -#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n)) -#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d)) +#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &RRATIONAL(rat)->num, (n)) +#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &RRATIONAL(rat)->den, (d)) /* rational.c */ VALUE rb_rational_canonicalize(VALUE x); -- cgit v1.2.3