]> de.git.xonotic.org Git - xonotic/d0_blind_id.git/blobdiff - d0_bignum-tommath.c
mark things that need to be made threadsafe
[xonotic/d0_blind_id.git] / d0_bignum-tommath.c
index d28a56fc0cb31765b08678de60755cb869828645..b3230fd6d4e422b7b47908ef4cb73523b010467f 100644 (file)
@@ -50,7 +50,7 @@ struct d0_bignum_s
        mp_int z;
 };
 
-static d0_bignum_t temp;
+static d0_bignum_t temp; // FIXME make threadsafe
 
 #include <stdio.h>
 
@@ -123,7 +123,7 @@ void d0_bignum_SHUTDOWN(void)
 
 D0_BOOL d0_iobuf_write_bignum(d0_iobuf_t *buf, const d0_bignum_t *bignum)
 {
-       static unsigned char numbuf[65536];
+       static unsigned char numbuf[65536]; // FIXME make threadsafe
        size_t count = 0;
        numbuf[0] = (mp_iszero(&bignum->z) ? 0 : (bignum->z.sign == MP_ZPOS) ? 1 : 3);
        if((numbuf[0] & 3) != 0) // nonzero
@@ -138,7 +138,7 @@ D0_BOOL d0_iobuf_write_bignum(d0_iobuf_t *buf, const d0_bignum_t *bignum)
 
 d0_bignum_t *d0_iobuf_read_bignum(d0_iobuf_t *buf, d0_bignum_t *bignum)
 {
-       static unsigned char numbuf[65536];
+       static unsigned char numbuf[65536]; // FIXME make threadsafe
        size_t count = sizeof(numbuf);
        if(!d0_iobuf_read_packet(buf, numbuf, &count))
                return NULL;
@@ -425,7 +425,7 @@ d0_bignum_t *d0_bignum_gcd(d0_bignum_t *r, d0_bignum_t *s, d0_bignum_t *t, const
 
 char *d0_bignum_tostring(const d0_bignum_t *x, unsigned int base)
 {
-       static char str[65536];
+       static char str[65536]; // FIXME make threadsafe
        mp_toradix_n((mp_int *) &x->z, str, base, sizeof(str));
        return str;
 }