summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 22:06:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-01 22:06:11 +0000
commit046831094b355d8d293d22a3ad5be5332307c96c (patch)
tree2a5edfdc8cc5963b6767d82ba8e3939a84865620 /file.c
parentb16245145bd386b5d4cf4e25e9917718a10347cd (diff)
constify rb_encoding and OnigEncoding
* include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/file.c b/file.c
index e6a225747d..e415288164 100644
--- a/file.c
+++ b/file.c
@@ -2953,7 +2953,7 @@ skiproot(const char *path, const char *end, rb_encoding *enc)
#define nextdirsep rb_enc_path_next
char *
-rb_enc_path_next(const char *s, const char *e, rb_encoding *enc)
+rb_enc_path_next(const char *s, const char *e, const rb_encoding *enc)
{
while (s < e && !isdirsep(*s)) {
Inc(s, e, enc);
@@ -2967,7 +2967,7 @@ rb_enc_path_next(const char *s, const char *e, rb_encoding *enc)
#define skipprefix(path, end, enc) (path)
#endif
char *
-rb_enc_path_skip_prefix(const char *path, const char *end, rb_encoding *enc)
+rb_enc_path_skip_prefix(const char *path, const char *end, const rb_encoding *enc)
{
#if defined(DOSISH_UNC) || defined(DOSISH_DRIVE_LETTER)
#ifdef DOSISH_UNC
@@ -3001,7 +3001,7 @@ skipprefixroot(const char *path, const char *end, rb_encoding *enc)
#define strrdirsep rb_enc_path_last_separator
char *
-rb_enc_path_last_separator(const char *path, const char *end, rb_encoding *enc)
+rb_enc_path_last_separator(const char *path, const char *end, const rb_encoding *enc)
{
char *last = NULL;
while (path < end) {
@@ -3019,7 +3019,7 @@ rb_enc_path_last_separator(const char *path, const char *end, rb_encoding *enc)
}
static char *
-chompdirsep(const char *path, const char *end, rb_encoding *enc)
+chompdirsep(const char *path, const char *end, const rb_encoding *enc)
{
while (path < end) {
if (isdirsep(*path)) {
@@ -3035,7 +3035,7 @@ chompdirsep(const char *path, const char *end, rb_encoding *enc)
}
char *
-rb_enc_path_end(const char *path, const char *end, rb_encoding *enc)
+rb_enc_path_end(const char *path, const char *end, const rb_encoding *enc)
{
if (path < end && isdirsep(*path)) path++;
return chompdirsep(path, end, enc);
@@ -3043,7 +3043,7 @@ rb_enc_path_end(const char *path, const char *end, rb_encoding *enc)
#if USE_NTFS
static char *
-ntfs_tail(const char *path, const char *end, rb_encoding *enc)
+ntfs_tail(const char *path, const char *end, const rb_encoding *enc)
{
while (path < end && *path == '.') path++;
while (path < end && *path != ':') {
@@ -3833,7 +3833,7 @@ rb_file_s_realdirpath(int argc, VALUE *argv, VALUE klass)
}
static size_t
-rmext(const char *p, long l0, long l1, const char *e, long l2, rb_encoding *enc)
+rmext(const char *p, long l0, long l1, const char *e, long l2, const rb_encoding *enc)
{
int len1, len2;
unsigned int c;
@@ -3869,7 +3869,7 @@ rmext(const char *p, long l0, long l1, const char *e, long l2, rb_encoding *enc)
}
const char *
-ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encoding *enc)
+ruby_enc_find_basename(const char *name, long *baselen, long *alllen, const rb_encoding *enc)
{
const char *p, *q, *e, *end;
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
@@ -4064,7 +4064,7 @@ rb_file_dirname(VALUE fname)
*
*/
const char *
-ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
+ruby_enc_find_extname(const char *name, long *len, const rb_encoding *enc)
{
const char *p, *e, *end = name + (len ? *len : (long)strlen(name));