Skip to content

Commit

Permalink
include/ruby/internal/arithmetic/intptr_t.h: add doxygen
Browse files Browse the repository at this point in the history
Must not be a bad idea to improve documents. [ci skip]
  • Loading branch information
shyouhei committed Sep 10, 2021
1 parent 6706d02 commit 8fa82cd
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions include/ruby/internal/arithmetic/intptr_t.h
Expand Up @@ -29,13 +29,45 @@
#include "ruby/internal/value.h"
#include "ruby/internal/dllexport.h"

#define rb_int_new rb_int2inum
#define rb_uint_new rb_uint2inum
#define rb_int_new rb_int2inum /**< @alias{rb_int2inum} */
#define rb_uint_new rb_uint2inum /**< @alias{rb_uint2inum} */

RBIMPL_SYMBOL_EXPORT_BEGIN()

/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
* @note This function always allocates Bignums, even if the given number
* is small enough to fit into a Fixnum.
*/
VALUE rb_int2big(intptr_t i);

/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_int2inum(intptr_t i);

/**
* Converts a C's `intptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `intptr_t` value.
* @return An instance of ::rb_cInteger.
* @note This function always allocates Bignums, even if the given number
* is small enough to fit into a Fixnum.
*/
VALUE rb_uint2big(uintptr_t i);

/**
* Converts a C's `uintptr_t` into an instance of ::rb_cInteger.
*
* @param[in] i Arbitrary `uintptr_t` value.
* @return An instance of ::rb_cInteger.
*/
VALUE rb_uint2inum(uintptr_t i);
RBIMPL_SYMBOL_EXPORT_END()

Expand Down

0 comments on commit 8fa82cd

Please sign in to comment.