summaryrefslogtreecommitdiff
path: root/include/ruby/internal/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/encoding')
-rw-r--r--include/ruby/internal/encoding/coderange.h2
-rw-r--r--include/ruby/internal/encoding/encoding.h20
-rw-r--r--include/ruby/internal/encoding/string.h8
3 files changed, 7 insertions, 23 deletions
diff --git a/include/ruby/internal/encoding/coderange.h b/include/ruby/internal/encoding/coderange.h
index 7a81208c9e..c89f871518 100644
--- a/include/ruby/internal/encoding/coderange.h
+++ b/include/ruby/internal/encoding/coderange.h
@@ -79,7 +79,7 @@ RBIMPL_ATTR_CONST()
static inline bool
RB_ENC_CODERANGE_CLEAN_P(enum ruby_coderange_type cr)
{
- return rb_enc_coderange_clean_p(cr);
+ return rb_enc_coderange_clean_p(RBIMPL_CAST((int)cr));
}
RBIMPL_ATTR_PURE_UNLESS_DEBUG()
diff --git a/include/ruby/internal/encoding/encoding.h b/include/ruby/internal/encoding/encoding.h
index 4748ca806b..a58f9f2b15 100644
--- a/include/ruby/internal/encoding/encoding.h
+++ b/include/ruby/internal/encoding/encoding.h
@@ -28,6 +28,7 @@
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/attr/returns_nonnull.h"
#include "ruby/internal/dllexport.h"
+#include "ruby/internal/encoding/coderange.h"
#include "ruby/internal/value.h"
#include "ruby/internal/core/rbasic.h"
#include "ruby/internal/fl_type.h"
@@ -79,7 +80,7 @@ enum ruby_encoding_consts {
static inline void
RB_ENCODING_SET_INLINED(VALUE obj, int encindex)
{
- VALUE f = /* upcast */ encindex;
+ VALUE f = /* upcast */ RBIMPL_CAST((VALUE)encindex);
f <<= RUBY_ENCODING_SHIFT;
RB_FL_UNSET_RAW(obj, RUBY_ENCODING_MASK);
@@ -139,23 +140,6 @@ RBIMPL_ATTR_NOALIAS()
int rb_char_to_option_kcode(int c, int *option, int *kcode);
/**
- * Creates a new encoding, using the passed one as a template.
- *
- * @param[in] name Name of the creating encoding.
- * @param[in] src Template.
- * @exception rb_eArgError Duplicated or malformed `name`.
- * @return Replicated new encoding's index.
- * @post Encoding named `name` is created as a copy of `src`, whose index
- * is the return value.
- *
- * @internal
- *
- * `name` can be `NULL`, but that just raises an exception. OTOH it seems no
- * sanity check is done against `src`...?
- */
-int rb_enc_replicate(const char *name, rb_encoding *src);
-
-/**
* Creates a new "dummy" encoding. Roughly speaking, an encoding is dummy when
* it is stateful. Notable example of dummy encoding are those defined in
* ISO/IEC 2022
diff --git a/include/ruby/internal/encoding/string.h b/include/ruby/internal/encoding/string.h
index 6ed7ca1c90..2cfa91c01e 100644
--- a/include/ruby/internal/encoding/string.h
+++ b/include/ruby/internal/encoding/string.h
@@ -30,7 +30,7 @@
RBIMPL_SYMBOL_EXPORT_BEGIN()
/**
- * Identical to rb_enc_str_new(), except it additionally takes an encoding.
+ * Identical to rb_str_new(), except it additionally takes an encoding.
*
* @param[in] ptr A memory region of `len` bytes length.
* @param[in] len Length of `ptr`, in bytes, not including the
@@ -307,13 +307,13 @@ RBIMPL_ATTR_NONNULL(())
/**
* Looks for the passed string in the passed buffer.
*
- * @param[in] x Buffer that potentially includes `y`.
+ * @param[in] x Query string.
* @param[in] m Number of bytes of `x`.
- * @param[in] y Query string.
+ * @param[in] y Buffer that potentially includes `x`.
* @param[in] n Number of bytes of `y`.
* @param[in] enc Encoding of both `x` and `y`.
* @retval -1 Not found.
- * @retval otherwise Found index in `x`.
+ * @retval otherwise Found index in `y`.
* @note This API can match at a non-character-boundary.
*/
long rb_memsearch(const void *x, long m, const void *y, long n, rb_encoding *enc);