summaryrefslogtreecommitdiff
path: root/ext/sdbm/_sdbm.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-25 06:46:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-25 06:46:57 +0000
commit6b1cf264a80f2efe6a4b42553b8bf2e16f51690a (patch)
treede2cec1bac93bf9b8a5807f7da3a21c04756f19c /ext/sdbm/_sdbm.c
parente3c3733a30091958cb00bc1a2e4f0882fe6d59d6 (diff)
* ext/sdbm/_sdbm.c (sdbm_open): use size_t.
* ext/syck/bytecode.c: ditto. * ext/sdbm/_sdbm.c (delpair): use ptrdiff_t. * ext/sdbm/init.c: use RSTRING_LENINT. * ext/dl/handle.c: suppress warning: shorten-64-to-32. * ext/strscan/strscan.c: ditto. * ext/syck/emitter.c: ditto. * ext/syck/implicit.c: ditto. * ext/syck/syck.c: ditto. * ext/syck/token.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/sdbm/_sdbm.c')
-rw-r--r--ext/sdbm/_sdbm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 5e2b8cc9f36..28e5b03b313 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -155,7 +155,7 @@ sdbm_open(register char *file, register int flags, register int mode)
register DBM *db;
register char *dirname;
register char *pagname;
- register int n;
+ register size_t n;
if (file == NULL || !*file)
return errno = EINVAL, (DBM *) NULL;
@@ -164,7 +164,7 @@ sdbm_open(register char *file, register int flags, register int mode)
*/
n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2;
- if ((dirname = malloc((unsigned) n)) == NULL)
+ if ((dirname = malloc(n)) == NULL)
return errno = ENOMEM, (DBM *) NULL;
/*
* build the file names
@@ -755,9 +755,9 @@ delpair(char *pag, datum key)
register int m;
register char *dst = pag + (i == 1 ? PBLKSIZ : GET_SHORT(ino,i - 1));
register char *src = pag + GET_SHORT(ino,i + 1);
- register int zoo = dst - src;
+ register ptrdiff_t zoo = dst - src;
- debug(("free-up %d ", zoo));
+ debug(("free-up %"PRIdPTRDIFF" ", zoo));
/*
* shift data/keys down
*/