w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

boxing_nan.h File Reference

Go to the source code of this file.

Classes

struct  mrb_value
 
union  mrb_value_
 

Macros

#define MRB_FIXNUM_SHIFT   0
 
#define MRB_SYMBOL_SHIFT   0
 
#define MRB_FIXNUM_MIN   INT32_MIN
 
#define MRB_FIXNUM_MAX   INT32_MAX
 
#define BOXNAN_IMMEDIATE_VALUE   union { uint32_t i; void *p; }
 
#define mrb_tt(o)   ((enum mrb_vtype)((mrb_val_union(o).ttt & 0xfc000)>>14)-1)
 
#define mrb_type(o)   (enum mrb_vtype)((uint32_t)0xfff00000 < mrb_val_union(o).ttt ? mrb_tt(o) : MRB_TT_FLOAT)
 
#define mrb_float(o)   mrb_val_union(o).f
 
#define mrb_fixnum(o)   ((mrb_int)mrb_val_union(o).i)
 
#define mrb_integer(o)   mrb_fixnum(o)
 
#define mrb_symbol(o)   ((mrb_sym)mrb_val_union(o).i)
 
#define mrb_ptr(o)   ((void*)mrb_val_union(o).i)
 
#define mrb_cptr(o)   mrb_ptr(o)
 
#define BOXNAN_SHIFT_LONG_POINTER(v)   0
 
#define BOXNAN_SET_VALUE(o, tt, attr, v)
 
#define BOXNAN_SET_OBJ_VALUE(o, tt, v)   BOXNAN_SET_VALUE(o, tt, i, (uint32_t)v)
 
#define SET_FLOAT_VALUE(mrb, r, v)
 
#define SET_NIL_VALUE(r)   BOXNAN_SET_VALUE(r, MRB_TT_FALSE, i, 0)
 
#define SET_FALSE_VALUE(r)   BOXNAN_SET_VALUE(r, MRB_TT_FALSE, i, 1)
 
#define SET_TRUE_VALUE(r)   BOXNAN_SET_VALUE(r, MRB_TT_TRUE, i, 1)
 
#define SET_BOOL_VALUE(r, b)   BOXNAN_SET_VALUE(r, b ? MRB_TT_TRUE : MRB_TT_FALSE, i, 1)
 
#define SET_INT_VALUE(mrb, r, n)   BOXNAN_SET_VALUE(r, MRB_TT_INTEGER, i, (uint32_t)(n))
 
#define SET_FIXNUM_VALUE(r, n)   BOXNAN_SET_VALUE(r, MRB_TT_INTEGER, i, (uint32_t)(n))
 
#define SET_SYM_VALUE(r, v)   BOXNAN_SET_VALUE(r, MRB_TT_SYMBOL, i, (uint32_t)(v))
 
#define SET_OBJ_VALUE(r, v)   BOXNAN_SET_OBJ_VALUE(r, (((struct RObject*)(v))->tt), (v))
 
#define SET_CPTR_VALUE(mrb, r, v)   BOXNAN_SET_VALUE(r, MRB_TT_CPTR, p, v)
 
#define SET_UNDEF_VALUE(r)   BOXNAN_SET_VALUE(r, MRB_TT_UNDEF, i, 0)
 

Typedefs

typedef struct mrb_value mrb_value
 

Functions

 mrb_static_assert1 (sizeof(mrb_value)==sizeof(union mrb_value_))
 
static union mrb_value_ mrb_val_union (mrb_value v)
 

Detailed Description

See Copyright Notice in mruby.h

Definition in file boxing_nan.h.

Macro Definition Documentation

◆ BOXNAN_IMMEDIATE_VALUE

#define BOXNAN_IMMEDIATE_VALUE   union { uint32_t i; void *p; }

Definition at line 46 of file boxing_nan.h.

◆ BOXNAN_SET_OBJ_VALUE

#define BOXNAN_SET_OBJ_VALUE (   o,
  tt,
  v 
)    BOXNAN_SET_VALUE(o, tt, i, (uint32_t)v)

Definition at line 99 of file boxing_nan.h.

◆ BOXNAN_SET_VALUE

#define BOXNAN_SET_VALUE (   o,
  tt,
  attr,
  v 
)
Value:
do { \
union mrb_value_ mrb_value_union_variable; \
mrb_value_union_variable.attr = (v);\
mrb_value_union_variable.ttt = 0xfff00000 | (((tt)+1)<<14);\
o = mrb_value_union_variable.value;\
} while (0)
int v
Definition: dviconv.c:10
mrb_value value
Definition: boxing_nan.h:54

Definition at line 84 of file boxing_nan.h.

◆ BOXNAN_SHIFT_LONG_POINTER

#define BOXNAN_SHIFT_LONG_POINTER (   v)    0

Definition at line 81 of file boxing_nan.h.

◆ mrb_cptr

#define mrb_cptr (   o)    mrb_ptr(o)

Definition at line 80 of file boxing_nan.h.

◆ mrb_fixnum

#define mrb_fixnum (   o)    ((mrb_int)mrb_val_union(o).i)

Definition at line 70 of file boxing_nan.h.

◆ MRB_FIXNUM_MAX

#define MRB_FIXNUM_MAX   INT32_MAX

Definition at line 25 of file boxing_nan.h.

◆ MRB_FIXNUM_MIN

#define MRB_FIXNUM_MIN   INT32_MIN

Definition at line 24 of file boxing_nan.h.

◆ MRB_FIXNUM_SHIFT

#define MRB_FIXNUM_SHIFT   0

Definition at line 22 of file boxing_nan.h.

◆ mrb_float

#define mrb_float (   o)    mrb_val_union(o).f

Definition at line 69 of file boxing_nan.h.

◆ mrb_integer

#define mrb_integer (   o)    mrb_fixnum(o)

Definition at line 71 of file boxing_nan.h.

◆ mrb_ptr

#define mrb_ptr (   o)    ((void*)mrb_val_union(o).i)

Definition at line 79 of file boxing_nan.h.

◆ mrb_symbol

#define mrb_symbol (   o)    ((mrb_sym)mrb_val_union(o).i)

Definition at line 72 of file boxing_nan.h.

◆ MRB_SYMBOL_SHIFT

#define MRB_SYMBOL_SHIFT   0

Definition at line 23 of file boxing_nan.h.

◆ mrb_tt

#define mrb_tt (   o)    ((enum mrb_vtype)((mrb_val_union(o).ttt & 0xfc000)>>14)-1)

Definition at line 67 of file boxing_nan.h.

◆ mrb_type

#define mrb_type (   o)    (enum mrb_vtype)((uint32_t)0xfff00000 < mrb_val_union(o).ttt ? mrb_tt(o) : MRB_TT_FLOAT)

Definition at line 68 of file boxing_nan.h.

◆ SET_BOOL_VALUE

#define SET_BOOL_VALUE (   r,
  b 
)    BOXNAN_SET_VALUE(r, b ? MRB_TT_TRUE : MRB_TT_FALSE, i, 1)

Definition at line 117 of file boxing_nan.h.

◆ SET_CPTR_VALUE

#define SET_CPTR_VALUE (   mrb,
  r,
  v 
)    BOXNAN_SET_VALUE(r, MRB_TT_CPTR, p, v)

Definition at line 126 of file boxing_nan.h.

◆ SET_FALSE_VALUE

#define SET_FALSE_VALUE (   r)    BOXNAN_SET_VALUE(r, MRB_TT_FALSE, i, 1)

Definition at line 115 of file boxing_nan.h.

◆ SET_FIXNUM_VALUE

#define SET_FIXNUM_VALUE (   r,
  n 
)    BOXNAN_SET_VALUE(r, MRB_TT_INTEGER, i, (uint32_t)(n))

Definition at line 119 of file boxing_nan.h.

◆ SET_FLOAT_VALUE

#define SET_FLOAT_VALUE (   mrb,
  r,
  v 
)
Value:
do { \
union mrb_value_ mrb_value_union_variable; \
if ((v) != (v)) { /* NaN */ \
mrb_value_union_variable.ttt = 0x7ff80000; \
mrb_value_union_variable.i = 0; \
} \
else { \
mrb_value_union_variable.f = (v); \
} \
r = mrb_value_union_variable.value; \
} while(0)
mrb_float f
Definition: boxing_nan.h:40

Definition at line 102 of file boxing_nan.h.

◆ SET_INT_VALUE

#define SET_INT_VALUE (   mrb,
  r,
  n 
)    BOXNAN_SET_VALUE(r, MRB_TT_INTEGER, i, (uint32_t)(n))

Definition at line 118 of file boxing_nan.h.

◆ SET_NIL_VALUE

#define SET_NIL_VALUE (   r)    BOXNAN_SET_VALUE(r, MRB_TT_FALSE, i, 0)

Definition at line 114 of file boxing_nan.h.

◆ SET_OBJ_VALUE

#define SET_OBJ_VALUE (   r,
  v 
)    BOXNAN_SET_OBJ_VALUE(r, (((struct RObject*)(v))->tt), (v))

Definition at line 121 of file boxing_nan.h.

◆ SET_SYM_VALUE

#define SET_SYM_VALUE (   r,
  v 
)    BOXNAN_SET_VALUE(r, MRB_TT_SYMBOL, i, (uint32_t)(v))

Definition at line 120 of file boxing_nan.h.

◆ SET_TRUE_VALUE

#define SET_TRUE_VALUE (   r)    BOXNAN_SET_VALUE(r, MRB_TT_TRUE, i, 1)

Definition at line 116 of file boxing_nan.h.

◆ SET_UNDEF_VALUE

#define SET_UNDEF_VALUE (   r)    BOXNAN_SET_VALUE(r, MRB_TT_UNDEF, i, 0)

Definition at line 128 of file boxing_nan.h.

Typedef Documentation

◆ mrb_value

typedef struct mrb_value mrb_value

Function Documentation

◆ mrb_static_assert1()

mrb_static_assert1 ( sizeof(mrb_value = =sizeof(union mrb_value_))

◆ mrb_val_union()

static union mrb_value_ mrb_val_union ( mrb_value  v)
static

Definition at line 57 of file boxing_nan.h.