summaryrefslogtreecommitdiff
path: root/japanese/ruby-ming/files/patch-ext-ming-ming-swffont.c
blob: 7446c12954839d36490c6f6bf0164f7a007ce708 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- ext/ming/ming/swffont.c.orig	2003-09-28 12:51:28.000000000 +0900
+++ ext/ming/ming/swffont.c	2014-01-29 17:11:21.000000000 +0900
@@ -44,16 +44,16 @@
 	 VALUE self, n;
 {
   struct RSWFFont *f = ALLOC(struct RSWFFont);
-  char *name = STR2CSTR(n), *ext;
+  char *name = StringValuePtr(n), *ext;
   size_t len;
   FILE *fp;
   VALUE obj;
 
   VALUE path = rb_cv_get(rb_cSWFFont, "@@font_path");
-  len = RSTRING(n)->len;
+  len = RSTRING_LEN(n);
 
   if(len > 4) {
-    ext = &name[RSTRING(n)->len - 4];
+    ext = &name[RSTRING_LEN(n) - 4];
 
     if (strncmp_ignore_case(ext, ".fdb", 4) == 0) {
       fp = search_file(path, name, "rb");
@@ -92,7 +92,7 @@
 
   Data_Get_Struct(self, struct RSWFFont, f);
 
-  return rb_float_new(SWFFont_getStringWidth(f->this, STR2CSTR(s)));
+  return rb_float_new(SWFFont_getStringWidth(f->this, StringValuePtr(s)));
 }
 
 static VALUE