summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-27 10:08:39 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-27 10:08:39 +0000
commit0e6521aa5d13c12c33db0aa2010d738306f6552a (patch)
tree43c69e9c3534f67bc812da63df8231f803035181 /ext
parent60c3c901fe536de977368580f36576f2948e7b60 (diff)
downloadruby-0e6521aa5d13c12c33db0aa2010d738306f6552a.tar.gz
* ext/bigdecimal/bigdecimal.c (BigDecimal_load): Silence warnings
regarding char * vs. unsigned char * mismatch; submitted by Lyle Johnson <lyle.johnson@gmail.com> in [ruby-core:10416]. * ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto. * ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto. * ext/digest/digest.c (rb_digest_base_finish, rb_digest_base_update): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
-rw-r--r--ext/digest/digest.c4
-rw-r--r--ext/digest/rmd160/rmd160ossl.c2
-rw-r--r--ext/digest/sha1/sha1ossl.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 5a26ea79d9..efbf29f92d 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -332,7 +332,7 @@ BigDecimal_load(VALUE self, VALUE str)
unsigned long m=0;
SafeStringValue(str);
- pch = RSTRING_PTR(str);
+ pch = (unsigned char *)RSTRING_PTR(str);
/* First get max prec */
while((*pch)!=(unsigned char)'\0' && (ch=*pch++)!=(unsigned char)':') {
if(!ISDIGIT(ch)) {
@@ -341,7 +341,7 @@ BigDecimal_load(VALUE self, VALUE str)
m = m*10 + (unsigned long)(ch-'0');
}
if(m>VpBaseFig()) m -= VpBaseFig();
- GUARD_OBJ(pv,VpNewRbClass(m,pch,self));
+ GUARD_OBJ(pv,VpNewRbClass(m,(char *)pch,self));
m /= VpBaseFig();
if(m && pv->MaxPrec>m) pv->MaxPrec = m+1;
return ToValue(pv);
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index c4a58cf3f6..07484f897f 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -519,7 +519,7 @@ rb_digest_base_update(VALUE self, VALUE str)
Data_Get_Struct(self, void, pctx);
StringValue(str);
- algo->update_func(pctx, RSTRING_PTR(str), RSTRING_LEN(str));
+ algo->update_func(pctx, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
return self;
}
@@ -537,7 +537,7 @@ rb_digest_base_finish(VALUE self)
Data_Get_Struct(self, void, pctx);
str = rb_str_new(0, algo->digest_len);
- algo->finish_func(pctx, RSTRING_PTR(str));
+ algo->finish_func(pctx, (unsigned char *)RSTRING_PTR(str));
/* avoid potential coredump caused by use of a finished context */
algo->init_func(pctx);
diff --git a/ext/digest/rmd160/rmd160ossl.c b/ext/digest/rmd160/rmd160ossl.c
index 5d8c5ba470..f24e63e3d8 100644
--- a/ext/digest/rmd160/rmd160ossl.c
+++ b/ext/digest/rmd160/rmd160ossl.c
@@ -4,5 +4,5 @@
#include "rmd160ossl.h"
void RMD160_Finish(RMD160_CTX *ctx, char *buf) {
- RIPEMD160_Final(buf, ctx);
+ RIPEMD160_Final((unsigned char *)buf, ctx);
}
diff --git a/ext/digest/sha1/sha1ossl.c b/ext/digest/sha1/sha1ossl.c
index adf5cf267c..452cf35084 100644
--- a/ext/digest/sha1/sha1ossl.c
+++ b/ext/digest/sha1/sha1ossl.c
@@ -6,5 +6,5 @@
void
SHA1_Finish(SHA1_CTX *ctx, char *buf)
{
- SHA1_Final(buf, ctx);
+ SHA1_Final((unsigned char *)buf, ctx);
}