ruby-changes:11328
From: nobu <ko1@a...>
Date: Sat, 14 Mar 2009 10:57:59 +0900 (JST)
Subject: [ruby-changes:11328] Ruby:r22943 (trunk): * dln.c (init_funcname_len, dln_find_exe_r, dln_find_file_r): use
nobu 2009-03-14 10:56:15 +0900 (Sat, 14 Mar 2009) New Revision: 22943 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22943 Log: * dln.c (init_funcname_len, dln_find_exe_r, dln_find_file_r): use size_t. * file.c (rb_stat_inspect, file_expand_path): ditto. * util.c (ruby_qsort): ditto. Modified files: trunk/ChangeLog trunk/dln.c trunk/dln.h trunk/file.c trunk/util.c Index: ChangeLog =================================================================== --- ChangeLog (revision 22942) +++ ChangeLog (revision 22943) @@ -1,3 +1,12 @@ +Sat Mar 14 10:56:13 2009 Nobuyoshi Nakada <nobu@r...> + + * dln.c (init_funcname_len, dln_find_exe_r, dln_find_file_r): use + size_t. + + * file.c (rb_stat_inspect, file_expand_path): ditto. + + * util.c (ruby_qsort): ditto. + Sat Mar 14 10:39:13 2009 Nobuyoshi Nakada <nobu@r...> * lib/mkmf.rb (CXX_EXT): checks for case-sensitive filesystem with Index: dln.c =================================================================== --- dln.c (revision 22942) +++ dln.c (revision 22943) @@ -98,12 +98,12 @@ # endif #endif -static int +static size_t init_funcname_len(char **buf, const char *file) { char *p; const char *slash; - int len; + size_t len; /* Load the file as an object one */ for (slash = file-1; *file; file++) /* Find position of last '/' */ @@ -121,7 +121,7 @@ } #define init_funcname(buf, file) do {\ - int len = init_funcname_len(buf, file);\ + size_t len = init_funcname_len(buf, file);\ char *tmp = ALLOCA_N(char, len+1);\ if (!tmp) {\ free(*buf);\ @@ -1478,7 +1478,7 @@ static char *dln_find_1(const char *fname, const char *path, char *buf, size_t size, int exe_flag); char * -dln_find_exe_r(const char *fname, const char *path, char *buf, int size) +dln_find_exe_r(const char *fname, const char *path, char *buf, size_t size) { if (!path) { path = getenv(PATH_ENV); @@ -1495,7 +1495,7 @@ } char * -dln_find_file_r(const char *fname, const char *path, char *buf, int size) +dln_find_file_r(const char *fname, const char *path, char *buf, size_t size) { if (!path) path = "."; return dln_find_1(fname, path, buf, size, 0); @@ -1586,7 +1586,7 @@ #undef RETURN_IF for (dp = path;; dp = ++ep) { - register int l; + register size_t l; /* extract a component */ ep = strchr(dp, PATH_SEP[0]); @@ -1659,7 +1659,7 @@ /* end of __EMX__ or _WIN32 */ #endif }; - int j; + size_t j; needs_extension: for (j = 0; j < sizeof(extension) / sizeof(extension[0]); j++) { Index: util.c =================================================================== --- util.c (revision 22942) +++ util.c (revision 22943) @@ -437,11 +437,11 @@ ((*cmp)(b,c,d)>0 ? b : ((*cmp)(a,c,d)<0 ? a : c))) void -ruby_qsort(void* base, const int nel, const int size, +ruby_qsort(void* base, const size_t nel, const size_t size, int (*cmp)(const void*, const void*, void*), void *d) { register char *l, *r, *m; /* l,r:left,right group m:median point */ - register int t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */ + register size_t t, eq_l, eq_r; /* eq_l: all items in left group are equal to S */ char *L = base; /* left end of curren region */ char *R = (char*)base + size*(nel-1); /* right end of current region */ int chklim = 63; /* threshold of ordering element check */ Index: dln.h =================================================================== --- dln.h (revision 22942) +++ dln.h (revision 22943) @@ -30,8 +30,8 @@ DEPRECATED(char *dln_find_exe(const char*,const char*)); DEPRECATED(char *dln_find_file(const char*,const char*)); -char *dln_find_exe_r(const char*,const char*,char*,int); -char *dln_find_file_r(const char*,const char*,char*,int); +char *dln_find_exe_r(const char*,const char*,char*,size_t); +char *dln_find_file_r(const char*,const char*,char*,size_t); #ifdef USE_DLN_A_OUT extern char *dln_argv0; Index: file.c =================================================================== --- file.c (revision 22942) +++ file.c (revision 22943) @@ -654,7 +654,7 @@ rb_stat_inspect(VALUE self) { VALUE str; - int i; + size_t i; static const struct { const char *name; VALUE (*func)(VALUE); @@ -2664,7 +2664,7 @@ { const char *s, *b; char *buf, *p, *pend, *root; - long buflen, dirlen; + size_t buflen, dirlen; int tainted; rb_encoding *extenc = 0; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/