Skip to content

Commit

Permalink
Make it compile under 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
danabr committed Oct 22, 2011
1 parent b676d0a commit 264487a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ task :clean do
end

require 'rake/rdoctask'
require 'yaml'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION.yml')
config = YAML.load(File.read('VERSION.yml'))
config = YAML::load(File.read('VERSION.yml'))
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
else
version = ""
Expand All @@ -72,4 +73,4 @@ Rake::RDocTask.new do |rdoc|
rdoc.title = "RubyFuse #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
end
20 changes: 11 additions & 9 deletions ext/rubyfuse_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ typedef unsigned long int (*rbfunc)();
*/
#ifdef DEBUG
static void
debug(char *msg,...) {
debug(const char *msg,...) {
va_list ap;
va_start(ap,msg);
vfprintf(stderr,msg,ap);
Expand Down Expand Up @@ -497,7 +497,7 @@ rf_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
if (TYPE(cur_entry) != T_STRING)
continue;

filler(buf,STR2CSTR(cur_entry),NULL,0);
filler(buf,StringValueCStr(cur_entry),NULL,0);
}
return 0;
}
Expand Down Expand Up @@ -706,7 +706,8 @@ rf_open(const char *path, struct fuse_file_info *fi) {
/* We have the body, now save it the entire contents to our
* opened_file lists. */
newfile = ALLOC(opened_file);
value = rb_str2cstr(body,&newfile->size);
value = StringValueCStr(body);
newfile->size = strlen(value);
newfile->value = ALLOC_N(char,(newfile->size)+1);
memcpy(newfile->value,value,newfile->size);
newfile->value[newfile->size] = '\0';
Expand Down Expand Up @@ -761,7 +762,8 @@ rf_open(const char *path, struct fuse_file_info *fi) {
/* We have the body, now save it the entire contents to our
* opened_file lists. */
newfile = ALLOC(opened_file);
value = rb_str2cstr(body,&newfile->size);
value = StringValueCStr(body);
newfile->size = strlen(value);
newfile->value = ALLOC_N(char,(newfile->size)+1);
memcpy(newfile->value,value,newfile->size);
newfile->writesize = newfile->size+1;
Expand Down Expand Up @@ -1318,8 +1320,8 @@ rf_read(const char *path, char *buf, size_t size, off_t offset,
return 0;
if (TYPE(ret) != T_STRING)
return 0;
memcpy(buf, RSTRING(ret)->ptr, RSTRING(ret)->len);
return RSTRING(ret)->len;
memcpy(buf, RSTRING_PTR(ret), RSTRING_LEN(ret));
return RSTRING_LEN(ret);
}

/* Is there anything left to read? */
Expand Down Expand Up @@ -1459,17 +1461,17 @@ rf_mount_to(int argc, VALUE *argv, VALUE self) {

for (i = 1;i < argc; i++) {
Check_Type(argv[i], T_STRING);
cur = STR2CSTR(argv[i]);
cur = StringValuePtr(argv[i]);
if (!rf_valid_option(cur)) {
rb_raise(rb_eArgError,"mount_under: \"%s\" - invalid argument.", cur);
return Qnil;
}
snprintf(opts2,1024,"%s,%s",opts,STR2CSTR(argv[i]));
snprintf(opts2,1024,"%s,%s",opts,StringValuePtr(argv[i]));
strcpy(opts,opts2);
}

rb_iv_set(cRubyFuse,"@mountpoint",mountpoint);
rubyfuse_setup(STR2CSTR(mountpoint), &rf_oper, opts);
rubyfuse_setup(StringValuePtr(mountpoint), &rf_oper, opts);
return Qtrue;
}

Expand Down

0 comments on commit 264487a

Please sign in to comment.