[svn:parrot] r45223 - trunk/src/pmc

petdance at svn.parrot.org petdance at svn.parrot.org
Sun Mar 28 03:39:37 UTC 2010


Author: petdance
Date: Sun Mar 28 03:39:37 2010
New Revision: 45223
URL: https://trac.parrot.org/parrot/changeset/45223

Log:
Add more ARG* protectors, and removed a commented-out block that was choking the Pmc2c program

Modified:
   trunk/src/pmc/bigint.pmc
   trunk/src/pmc/bignum.pmc

Modified: trunk/src/pmc/bigint.pmc
==============================================================================
--- trunk/src/pmc/bigint.pmc	Sun Mar 28 02:48:35 2010	(r45222)
+++ trunk/src/pmc/bigint.pmc	Sun Mar 28 03:39:37 2010	(r45223)
@@ -133,6 +133,7 @@
         __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char * bigint_get_string(PARROT_INTERP, ARGIN(PMC *self), int base)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -159,10 +160,11 @@
 
 static void bigint_mul_bigint(PARROT_INTERP,
     ARGIN(PMC *self),
-    PMC *value,
+    ARGIN(PMC *value),
     ARGMOD(PMC *dest))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*dest);
 
@@ -190,35 +192,48 @@
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*dest);
 
-static void bigint_set(PARROT_INTERP, PMC *dest, PMC *src)
-        __attribute__nonnull__(1);
+static void bigint_set(PARROT_INTERP, ARGMOD(PMC *dest), ARGIN(PMC *src))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*dest);
 
-static void bigint_set_double(PARROT_INTERP, ARGIN(PMC *self), double value)
+static void bigint_set_double(PARROT_INTERP,
+    ARGMOD(PMC *self),
+    double value)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*self);
 
-static void bigint_set_long(PARROT_INTERP, ARGIN(PMC *self), long value)
+static void bigint_set_long(PARROT_INTERP, ARGMOD(PMC *self), long value)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*self);
 
-static void bigint_set_self(PARROT_INTERP, ARGIN(PMC *self), BIGINT *value)
+static void bigint_set_self(PARROT_INTERP,
+    ARGMOD(PMC *self),
+    ARGIN(BIGINT *value))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*self);
 
 static void bigint_set_str(PARROT_INTERP,
-    ARGIN(PMC *self),
+    ARGMOD(PMC *self),
     ARGIN(const char *value),
     int base)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*self);
 
 static void bigint_sub_bigint(PARROT_INTERP,
     ARGIN(PMC *self),
-    PMC *value,
+    ARGIN(PMC *value),
     ARGMOD(PMC *dest))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
         __attribute__nonnull__(4)
         FUNC_MODIFIES(*dest);
 
@@ -296,6 +311,7 @@
 #define ASSERT_ARGS_bigint_mul_bigint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
     , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bigint_mul_bigint_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
@@ -310,7 +326,9 @@
     , PARROT_ASSERT_ARG(self) \
     , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bigint_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_bigint_set_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self))
@@ -319,7 +337,8 @@
     , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bigint_set_self __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(self))
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_bigint_set_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self) \
@@ -327,6 +346,7 @@
 #define ASSERT_ARGS_bigint_sub_bigint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
     , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bigint_sub_bigint_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
@@ -352,7 +372,7 @@
 }
 
 static void
-bigint_set(PARROT_INTERP, PMC *dest, PMC *src) {
+bigint_set(PARROT_INTERP, ARGMOD(PMC *dest), ARGIN(PMC *src)) {
     BIGINT *bi_dest, *bi_src;
     GETATTR_BigInt_bi(interp, dest, bi_dest);
     GETATTR_BigInt_bi(interp, src,  bi_src);
@@ -362,21 +382,21 @@
 }
 
 static void
-bigint_set_long(PARROT_INTERP, ARGIN(PMC *self), long value) {
+bigint_set_long(PARROT_INTERP, ARGMOD(PMC *self), long value) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_set_si(bi->b, value);
 }
 
 static void
-bigint_set_double(PARROT_INTERP, ARGIN(PMC *self), double value) {
+bigint_set_double(PARROT_INTERP, ARGMOD(PMC *self), double value) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_set_d(bi->b, value);
 }
 
 static void
-bigint_set_str(PARROT_INTERP, ARGIN(PMC *self), ARGIN(const char *value), int base) {
+bigint_set_str(PARROT_INTERP, ARGMOD(PMC *self), ARGIN(const char *value), int base) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_set_str(bi->b, value, base);
@@ -392,7 +412,7 @@
 }
 
 static void
-bigint_set_self(PARROT_INTERP, ARGIN(PMC *self), BIGINT *value) {
+bigint_set_self(PARROT_INTERP, ARGMOD(PMC *self), ARGIN(BIGINT *value)) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_set(bi->b, (mpz_srcptr)((BIGINT*)value)->b);
@@ -421,6 +441,7 @@
 }
 
 PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char *
 bigint_get_string(PARROT_INTERP, ARGIN(PMC *self), int base) {
     BIGINT *bi;
@@ -462,7 +483,7 @@
 }
 
 static void
-bigint_sub_bigint(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
+bigint_sub_bigint(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGINT *bi_self, *bi_value, *bi_dest;
     GETATTR_BigInt_bi(interp, self, bi_self);
     GETATTR_BigInt_bi(interp, value, bi_value);
@@ -482,7 +503,7 @@
 }
 
 static void
-bigint_mul_bigint(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
+bigint_mul_bigint(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGINT *bi_self, *bi_value, *bi_dest;
     GETATTR_BigInt_bi(interp, self, bi_self);
     GETATTR_BigInt_bi(interp, value, bi_value);

Modified: trunk/src/pmc/bignum.pmc
==============================================================================
--- trunk/src/pmc/bignum.pmc	Sun Mar 28 02:48:35 2010	(r45222)
+++ trunk/src/pmc/bignum.pmc	Sun Mar 28 03:39:37 2010	(r45223)
@@ -56,8 +56,8 @@
 
 =item C<static void bignum_set_double(PARROT_INTERP, PMC *self, double value)>
 
-=item C<static void bignum_set_str(PARROT_INTERP, PMC *self, char *value, int
-base)>
+=item C<static void bignum_set_str(PARROT_INTERP, PMC *self, const char *value,
+int base)>
 
 =item C<static void bignum_set_bigint(PARROT_INTERP, PMC *self, struct BIGINT
 *value)>
@@ -70,7 +70,7 @@
 
 =item C<static unsigned long bignum_get_ui(PARROT_INTERP, PMC *self)>
 
-=item C<static INTVAL bignum_get_bool(PARROT_INTERP, PMC *self)>
+=item C<static INTVAL bignum_get_bool(PARROT_INTERP, ARGIN(PMC *self))>
 
 =item C<static char * bignum_get_string(PARROT_INTERP, PMC *self, int base)>
 
@@ -81,7 +81,7 @@
 
 =item C<static FLOATVAL bignum_get_float(PARROT_INTERP, PMC *self)>
 
-=item C<static BIGINT bignum_get_bigint(Interp*, PMC *self)>
+=item C<static BIGINT bignum_get_bigint(Interp*, ARGIN(PMC *self))>
 
 =item C<static void bignum_add_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC
 *dest)>
@@ -169,151 +169,232 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-static void bignum_abs(PARROT_INTERP, PMC *self, PMC *dest)
-        __attribute__nonnull__(1);
+static void bignum_abs(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_add_bignum(PARROT_INTERP,
-    PMC *self,
-    PMC *value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(PMC *value),
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_add_bignum_float(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     FLOATVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_add_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
-static void bignum_clear(PARROT_INTERP, PMC *self)
-        __attribute__nonnull__(1);
+static void bignum_clear(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static INTVAL bignum_cmp(PARROT_INTERP, PMC *self, PMC *value)
-        __attribute__nonnull__(1);
+static INTVAL bignum_cmp(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static INTVAL bignum_cmp_double(PARROT_INTERP, PMC *self, double value)
-        __attribute__nonnull__(1);
+static INTVAL bignum_cmp_double(PARROT_INTERP,
+    ARGIN(PMC *self),
+    double value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static INTVAL bignum_cmp_int(PARROT_INTERP, PMC *self, INTVAL value)
-        __attribute__nonnull__(1);
+static INTVAL bignum_cmp_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static INTVAL bignum_cmp_ulong(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     unsigned long value)
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void bignum_div_bignum(PARROT_INTERP,
-    PMC *self,
-    PMC *value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(PMC *value),
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_div_bignum_float(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     FLOATVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_div_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_fdiv_bignum(PARROT_INTERP,
-    PMC *self,
-    PMC *value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(PMC *value),
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_fdiv_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
-static INTVAL bignum_get_default_prec(PARROT_INTERP, PMC *self)
-        __attribute__nonnull__(1);
+static INTVAL bignum_get_default_prec(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static double bignum_get_double(PARROT_INTERP, PMC *self)
-        __attribute__nonnull__(1);
+PARROT_WARN_UNUSED_RESULT
+static double bignum_get_double(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static FLOATVAL bignum_get_float(PARROT_INTERP, PMC *self)
-        __attribute__nonnull__(1);
+PARROT_WARN_UNUSED_RESULT
+static FLOATVAL bignum_get_float(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static BIGNUM* bignum_get_self(PARROT_INTERP, ARGIN(PMC *self))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
 static long bignum_get_si(PARROT_INTERP, ARGIN(PMC *self))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char * bignum_get_string(PARROT_INTERP, ARGIN(PMC *self), int base)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char * bignum_get_string_size(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     int base,
     int digits)
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
+PARROT_WARN_UNUSED_RESULT
 static unsigned long bignum_get_ui(PARROT_INTERP, ARGIN(PMC *self))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void bignum_init(PARROT_INTERP, PMC *self)
-        __attribute__nonnull__(1);
+static void bignum_init(PARROT_INTERP, ARGIN(PMC *self))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void bignum_mul_bignum(PARROT_INTERP,
-    PMC *self,
-    PMC *value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(PMC *value),
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_mul_bignum_float(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     FLOATVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_mul_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
-static void bignum_neg(PARROT_INTERP, PMC *self, PMC *dest)
-        __attribute__nonnull__(1);
+static void bignum_neg(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_pow_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
-static void bignum_set(PARROT_INTERP, PMC *dest, PMC *src)
-        __attribute__nonnull__(1);
+static void bignum_set(PARROT_INTERP, ARGMOD(PMC *dest), ARGIN(PMC *src))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_set_bigint(PARROT_INTERP,
-    PMC *self,
-    struct BIGINT *value)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(struct BIGINT *value))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static void bignum_set_default_prec(PARROT_INTERP, PMC *self, INTVAL prec)
-        __attribute__nonnull__(1);
+static void bignum_set_default_prec(PARROT_INTERP,
+    ARGIN(PMC *self),
+    INTVAL prec)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void bignum_set_double(PARROT_INTERP, PMC *self, double value)
-        __attribute__nonnull__(1);
+static void bignum_set_double(PARROT_INTERP, ARGIN(PMC *self), double value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void bignum_set_float(PARROT_INTERP, PMC *self, FLOATVAL value)
-        __attribute__nonnull__(1);
+static void bignum_set_float(PARROT_INTERP,
+    ARGIN(PMC *self),
+    FLOATVAL value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void bignum_set_self(PARROT_INTERP,
     ARGIN(PMC *self),
@@ -322,67 +403,116 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-static void bignum_set_si(PARROT_INTERP, PMC *self, long value)
-        __attribute__nonnull__(1);
+static void bignum_set_si(PARROT_INTERP, ARGIN(PMC *self), long value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void bignum_set_str(PARROT_INTERP, PMC *self, char *value, int base)
-        __attribute__nonnull__(1);
+static void bignum_set_str(PARROT_INTERP,
+    ARGIN(PMC *self),
+    ARGIN(const char *value),
+    int base)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static void bignum_set_ui(PARROT_INTERP, PMC *self, unsigned long value)
-        __attribute__nonnull__(1);
+static void bignum_set_ui(PARROT_INTERP,
+    ARGIN(PMC *self),
+    unsigned long value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void bignum_sub_bignum(PARROT_INTERP,
-    PMC *self,
-    PMC *value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGIN(PMC *self),
+    ARGIN(PMC *value),
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_sub_bignum_float(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     FLOATVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 static void bignum_sub_bignum_int(PARROT_INTERP,
-    PMC *self,
+    ARGIN(PMC *self),
     INTVAL value,
-    PMC *dest)
-        __attribute__nonnull__(1);
+    ARGMOD(PMC *dest))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*dest);
 
 #define ASSERT_ARGS_bignum_abs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_add_bignum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_add_bignum_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_add_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_cmp __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_bignum_cmp_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_cmp_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_cmp_ulong __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_div_bignum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_div_bignum_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_div_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_fdiv_bignum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_fdiv_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_get_default_prec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_get_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_get_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_get_self __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self))
@@ -393,48 +523,79 @@
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_get_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_get_ui __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_mul_bignum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_mul_bignum_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_mul_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_neg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_pow_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_set __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(dest) \
+    , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_bignum_set_bigint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_bignum_set_default_prec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_set_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_set_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_set_self __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(self) \
     , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_bignum_set_si __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_set_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value))
 #define ASSERT_ARGS_bignum_set_ui __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self))
 #define ASSERT_ARGS_bignum_sub_bignum __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(value) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_sub_bignum_float __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 #define ASSERT_ARGS_bignum_sub_bignum_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp))
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(self) \
+    , PARROT_ASSERT_ARG(dest))
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
@@ -447,7 +608,7 @@
 #undef PARROT_BIGNUM_CAN_BIGINT
 
 static void
-bignum_init(PARROT_INTERP, PMC *self) {
+bignum_init(PARROT_INTERP, ARGIN(PMC *self)) {
 #ifdef PARROT_HAS_GMP
     BIGNUM * const bn = mem_gc_allocate_zeroed_typed(interp, BIGNUM);
     SETATTR_BigNum_bn(interp, self, bn);
@@ -460,7 +621,7 @@
 
 
 static void
-bignum_clear(PARROT_INTERP, PMC *self) {
+bignum_clear(PARROT_INTERP, ARGIN(PMC *self)) {
 #ifdef PARROT_HAS_GMP
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
@@ -473,7 +634,7 @@
 #ifdef PARROT_HAS_GMP
 
 static void
-bignum_set(PARROT_INTERP, PMC *dest, PMC *src) {
+bignum_set(PARROT_INTERP, ARGMOD(PMC *dest), ARGIN(PMC *src)) {
     BIGNUM *bn_dest, *bn_src;
     GETATTR_BigNum_bn(interp, dest, bn_dest);
     GETATTR_BigNum_bn(interp, src,  bn_src);
@@ -481,35 +642,35 @@
 }
 
 static void
-bignum_set_si(PARROT_INTERP, PMC *self, long value) {
+bignum_set_si(PARROT_INTERP, ARGIN(PMC *self), long value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set_si(bn->b, value);
 }
 
 static void
-bignum_set_ui(PARROT_INTERP, PMC *self, unsigned long value) {
+bignum_set_ui(PARROT_INTERP, ARGIN(PMC *self), unsigned long value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set_ui(bn->b, value);
 }
 
 static void
-bignum_set_float(PARROT_INTERP, PMC *self, FLOATVAL value) {
+bignum_set_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set_d(bn->b, (double)value);
 }
 
 static void
-bignum_set_double(PARROT_INTERP, PMC *self, double value) {
+bignum_set_double(PARROT_INTERP, ARGIN(PMC *self), double value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set_d(bn->b, value);
 }
 
 static void
-bignum_set_str(PARROT_INTERP, PMC *self, char *value, int base) {
+bignum_set_str(PARROT_INTERP, ARGIN(PMC *self), ARGIN(const char *value), int base) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set_str(bn->b, value, base);
@@ -517,13 +678,15 @@
 
 #  ifdef PARROT_BIGNUM_CAN_BIGINT
 static void
-bignum_set_bigint(PARROT_INTERP, PMC *self, struct BIGINT *value) {
+bignum_set_bigint(PARROT_INTERP, ARGIN(PMC *self), ARGIN(struct BIGINT *value)) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     mpf_set(bn->b, (mpf_srcptr)value->b);
 }
 #  endif
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static BIGNUM*
 bignum_get_self(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
@@ -538,6 +701,7 @@
     mpf_set(bn->b, (mpf_srcptr)(value)->b);
 }
 
+PARROT_WARN_UNUSED_RESULT
 static long
 bignum_get_si(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
@@ -548,6 +712,7 @@
     Parrot_ex_throw_from_c_args(interp, NULL, 1, "bignum_get_si: number too big");
 }
 
+PARROT_WARN_UNUSED_RESULT
 static unsigned long
 bignum_get_ui(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
@@ -558,6 +723,7 @@
     Parrot_ex_throw_from_c_args(interp, NULL, 1, "bignum_get_ui: number too big");
 }
 
+PARROT_WARN_UNUSED_RESULT
 static INTVAL
 bignum_get_bool(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
@@ -568,6 +734,8 @@
         return 0;
 }
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char *
 bignum_get_string(PARROT_INTERP, ARGIN(PMC *self), int base) {
     BIGNUM *bn;
@@ -581,8 +749,10 @@
     return mpf_get_str(s, &exponent, base, 0, bn->b);
 }
 
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
 static char *
-bignum_get_string_size(PARROT_INTERP, PMC *self, int base, int digits) {
+bignum_get_string_size(PARROT_INTERP, ARGIN(PMC *self), int base, int digits) {
     BIGNUM *bn;
     size_t  n;
     char   *s;
@@ -593,29 +763,32 @@
     return mpf_get_str(s, &exponent, base, digits, bn->b);
 }
 
+PARROT_WARN_UNUSED_RESULT
 static double
-bignum_get_double(PARROT_INTERP, PMC *self) {
+bignum_get_double(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     return mpf_get_d(bn->b);
 }
 
+PARROT_WARN_UNUSED_RESULT
 static FLOATVAL
-bignum_get_float(PARROT_INTERP, PMC *self) {
+bignum_get_float(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     return mpf_get_d(bn->b);
 }
 
 #  ifdef PARROT_BIGNUM_CAN_BIGINT
+PARROT_WARN_UNUSED_RESULT
 static struct BIGINT
-bignum_get_bigint(PARROT_INTERP, PMC *self) {
+bignum_get_bigint(PARROT_INTERP, ARGIN(PMC *self)) {
     BIGNUM *bn;
     struct BIGINT *bi_dest;
     GETATTR_BigNum_bn(interp, self, bn);
     mpz_clear(bi_dest->b);
     mpz_init(bi_dest->b);
-    if (mpf_fits_slong_p(bn->b)) {
+    if ( mpf_fits_slong_p(bn->b)) {
         bi_dest->b = mpf_get_ui(bn->b);
     }
     else {
@@ -627,7 +800,7 @@
 #  endif
 
 static void
-bignum_add_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_add_bignum(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_value, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, value, bn_value);
@@ -636,7 +809,7 @@
 }
 
 static void
-bignum_add_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_add_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -647,7 +820,7 @@
 }
 
 static void
-bignum_add_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_add_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_value, *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_value);
     GETATTR_BigNum_bn(interp, self, bn_self);
@@ -657,7 +830,7 @@
 }
 
 static void
-bignum_sub_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_sub_bignum(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_value, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, value, bn_value);
@@ -666,7 +839,7 @@
 }
 
 static void
-bignum_sub_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_sub_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -677,7 +850,7 @@
 }
 
 static void
-bignum_sub_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_sub_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_tmp, *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_tmp);
     GETATTR_BigNum_bn(interp, self, bn_self);
@@ -687,7 +860,7 @@
 }
 
 static void
-bignum_mul_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_mul_bignum(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_value, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, value, bn_value);
@@ -696,7 +869,7 @@
 }
 
 static void
-bignum_mul_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_mul_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -704,7 +877,7 @@
 }
 
 static void
-bignum_mul_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_mul_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_tmp, *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_tmp);
     GETATTR_BigNum_bn(interp, self, bn_self);
@@ -714,7 +887,7 @@
 }
 
 static void
-bignum_pow_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_pow_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -729,7 +902,7 @@
 }
 
 static void
-bignum_check_divide_zero(PARROT_INTERP, PMC *value) {
+bignum_check_divide_zero(PARROT_INTERP, ARGIN(PMC *value)) {
     /* Throw an exception if we are dividing by zero. */
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, value, bn);
@@ -739,7 +912,7 @@
 }
 
 static void
-bignum_div_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_div_bignum(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_value, *bn_dest;
     bignum_check_divide_zero(interp, value);
     GETATTR_BigNum_bn(interp, self, bn_self);
@@ -749,7 +922,7 @@
 }
 
 static void
-bignum_div_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_div_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -765,7 +938,7 @@
 }
 
 static void
-bignum_div_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_div_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     BIGNUM bn, *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -786,7 +959,7 @@
 
 /* There's no such mpf_fdiv, only mpz_fdiv and mpf_div */
 static void
-bignum_fdiv_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_fdiv_bignum(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_value, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, value, bn_value);
@@ -796,7 +969,7 @@
 }
 
 static void
-bignum_fdiv_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_fdiv_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -811,7 +984,7 @@
 }
 
 static INTVAL
-bignum_cmp(PARROT_INTERP, PMC *self, PMC *value) {
+bignum_cmp(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *value)) {
     BIGNUM *bn_self, *bn_value;
     GETATTR_BigNum_bn(interp, self,  bn_self);
     GETATTR_BigNum_bn(interp, value, bn_value);
@@ -819,28 +992,28 @@
 }
 
 static INTVAL
-bignum_cmp_double(PARROT_INTERP, PMC *self, double value) {
+bignum_cmp_double(PARROT_INTERP, ARGIN(PMC *self), double value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     return mpf_cmp_d(bn->b, value);
 }
 
 static INTVAL
-bignum_cmp_int(PARROT_INTERP, PMC *self, INTVAL value) {
+bignum_cmp_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     return mpf_cmp_si(bn->b, value);
 }
 
 static INTVAL
-bignum_cmp_ulong(PARROT_INTERP, PMC *self, unsigned long value) {
+bignum_cmp_ulong(PARROT_INTERP, ARGIN(PMC *self), unsigned long value) {
     BIGNUM *bn;
     GETATTR_BigNum_bn(interp, self, bn);
     return mpf_cmp_ui(bn->b, value);
 }
 
 static void
-bignum_abs(PARROT_INTERP, PMC *self, PMC *dest) {
+bignum_abs(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -848,7 +1021,7 @@
 }
 
 static void
-bignum_neg(PARROT_INTERP, PMC *self, PMC *dest) {
+bignum_neg(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest)) {
     BIGNUM *bn_self, *bn_dest;
     GETATTR_BigNum_bn(interp, self, bn_self);
     GETATTR_BigNum_bn(interp, dest, bn_dest);
@@ -856,12 +1029,12 @@
 }
 
 static INTVAL
-bignum_get_default_prec(PARROT_INTERP, PMC *self) {
+bignum_get_default_prec(PARROT_INTERP, ARGIN(PMC *self)) {
     return mpf_get_default_prec();
 }
 
 static void
-bignum_set_default_prec(PARROT_INTERP, PMC *self, INTVAL prec) {
+bignum_set_default_prec(PARROT_INTERP, ARGIN(PMC *self), INTVAL prec) {
     mpf_set_default_prec(prec);
 }
 
@@ -876,195 +1049,183 @@
 #  define THROW_NYI Parrot_ex_throw_from_c_args(interp, NULL, \
                         EXCEPTION_LIBRARY_ERROR, "no bignum lib loaded")
 
-#  if 0
 static void
-bignum_init(PARROT_INTERP, PMC *self) {
+bignum_set(PARROT_INTERP, ARGMOD(PMC *dest), PMC *src) {
     THROW_NYI;
 }
 
 static void
-bignum_clear(PARROT_INTERP, PMC *self) {
+bignum_set_si(PARROT_INTERP, ARGIN(PMC *self), long value) {
     THROW_NYI;
 }
-#  endif
 
 static void
-bignum_set(PARROT_INTERP, PMC *dest, PMC *src) {
+bignum_set_double(PARROT_INTERP, ARGIN(PMC *self), double value) {
     THROW_NYI;
 }
 
 static void
-bignum_set_si(PARROT_INTERP, PMC *self, long value) {
+bignum_set_str(PARROT_INTERP, ARGIN(PMC *self), char *value, int base) {
     THROW_NYI;
 }
 
 static void
-bignum_set_double(PARROT_INTERP, PMC *self, double value) {
-    THROW_NYI;
-}
-
-static void
-bignum_set_str(PARROT_INTERP, PMC *self, char *value, int base) {
-    THROW_NYI;
-}
-
-static void
-bignum_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
+bignum_set_self(PARROT_INTERP, ARGIN(PMC *self), BIGNUM *value) {
     THROW_NYI;
 }
 
 static BIGNUM*
-bignum_get_self(PARROT_INTERP, PMC *self) {
+bignum_get_self(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static char *
-bignum_get_string(PARROT_INTERP, PMC *self, int base) {
+bignum_get_string(PARROT_INTERP, ARGIN(PMC *self), int base) {
     THROW_NYI;
 }
 
 static char *
-bignum_get_string_size(PARROT_INTERP, PMC *self, int base, int digits) {
+bignum_get_string_size(PARROT_INTERP, ARGIN(PMC *self), int base, int digits) {
     THROW_NYI;
 }
 
 static unsigned long
-bignum_get_ui(PARROT_INTERP, PMC *self) {
+bignum_get_ui(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static long
-bignum_get_si(PARROT_INTERP, PMC *self) {
+bignum_get_si(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static INTVAL
-bignum_get_bool(PARROT_INTERP, PMC *self) {
+bignum_get_bool(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static double
-bignum_get_double(PARROT_INTERP, PMC *self) {
+bignum_get_double(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static void
-bignum_add_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_add_bignum(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_add_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_add_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_add_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_add_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_sub_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_sub_bignum(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_sub_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_sub_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_sub_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_sub_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_mul_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_mul_bignum(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_mul_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_mul_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_mul_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_mul_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_pow_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_pow_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_pow_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_pow_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_div_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_div_bignum(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_div_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_div_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_div_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_div_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_fdiv_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+bignum_fdiv_bignum(PARROT_INTERP, ARGIN(PMC *self), PMC *value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_fdiv_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+bignum_fdiv_bignum_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_fdiv_bignum_float(PARROT_INTERP, PMC *self, FLOATVAL value, PMC *dest) {
+bignum_fdiv_bignum_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value, ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static INTVAL
-bignum_cmp(PARROT_INTERP, PMC *self, PMC *value) {
+bignum_cmp(PARROT_INTERP, ARGIN(PMC *self), PMC *value) {
     THROW_NYI;
 }
 
 static INTVAL
-bignum_cmp_int(PARROT_INTERP, PMC *self, INTVAL value) {
+bignum_cmp_int(PARROT_INTERP, ARGIN(PMC *self), INTVAL value) {
     THROW_NYI;
 }
 
 static INTVAL
-bignum_cmp_float(PARROT_INTERP, PMC *self, FLOATVAL value) {
+bignum_cmp_float(PARROT_INTERP, ARGIN(PMC *self), FLOATVAL value) {
     THROW_NYI;
 }
 
 static void
-bignum_abs(PARROT_INTERP, PMC *self, PMC *dest) {
+bignum_abs(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static void
-bignum_neg(PARROT_INTERP, PMC *self, PMC *dest) {
+bignum_neg(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest)) {
     THROW_NYI;
 }
 
 static INTVAL
-bignum_get_default_prec(PARROT_INTERP, PMC *self) {
+bignum_get_default_prec(PARROT_INTERP, ARGIN(PMC *self)) {
     THROW_NYI;
 }
 
 static void
-bignum_set_default_prec(PARROT_INTERP, PMC *self, INTVAL prec) {
+bignum_set_default_prec(PARROT_INTERP, ARGIN(PMC *self), INTVAL prec) {
     THROW_NYI;
 }
 
@@ -1107,7 +1268,7 @@
     }
 
     VTABLE PMC *clone() {
-        PMC *res = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
+        PMC * const res = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
         bignum_set(INTERP, res, SELF);
         return res;
     }
@@ -1559,15 +1720,6 @@
         dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
 
         bignum_div_bignum(INTERP, SELF, value, dest);
-#if 0
-        /* to downgrade or not that's the question */
-        GETATTR_BigNum_bn(interp, dest, bn);
-        if (mpf_fits_slong_p(bn->b)) {
-            long iresult = mpf_get_si(bn->b);
-            VTABLE_morph(interp, dest, enum_class_Integer);
-            VTABLE_set_integer_native(interp, dest, iresult);
-        }
-#endif
         return dest;
     }
 


More information about the parrot-commits mailing list