perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: minor type changes for debian amd64
Date Sun, 13 Jun 2004 05:40:18 GMT
Joe Schaefer wrote:
> Debian seems to have finally sorted out their 
> amd64 port (well, everything but the name :-).
> Rebuilding mp2 on that arch yields a few type
> mismatches (mainly because ints aren't the
> same size as pointers, I think).  Here's a
> patch that eliminates all such warnings for
> me (all tests still pass):
> 
> Index: src/modules/perl/modperl_global.c
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.c,v
> retrieving revision 1.8
> diff -u -r1.8 modperl_global.c
> --- src/modules/perl/modperl_global.c   4 Mar 2004 06:01:07 -0000       1.8
> +++ src/modules/perl/modperl_global.c   12 Jun 2004 21:59:00 -0000
> @@ -165,7 +165,7 @@
> 
>  MP_GLOBAL_IMPL(pconf, apr_pool_t *);
>  MP_GLOBAL_IMPL(server_rec, server_rec *);
> -MP_GLOBAL_IMPL(threaded_mpm, int);
> +MP_GLOBAL_IMPL(threaded_mpm, IV);
> 
>  #if MP_THREADED
>  static apr_status_t modperl_tls_cleanup(void *data)
> 
> Index: src/modules/perl/modperl_global.h
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.h,v
> retrieving revision 1.5
> diff -u -r1.5 modperl_global.h
> --- src/modules/perl/modperl_global.h   4 Mar 2004 06:01:07 -0000       1.5
> +++ src/modules/perl/modperl_global.h   12 Jun 2004 21:59:00 -0000
> @@ -59,7 +59,7 @@
> 
>  MP_GLOBAL_DECL(pconf, apr_pool_t *);
>  MP_GLOBAL_DECL(server_rec, server_rec *);
> -MP_GLOBAL_DECL(threaded_mpm, int);
> +MP_GLOBAL_DECL(threaded_mpm, IV);
> 
>  apr_status_t modperl_tls_create(apr_pool_t *p, modperl_tls_t **key);
>  apr_status_t modperl_tls_get(modperl_tls_t *key, void **data);

Yes, this part is because it has to be a pointer size. Thanks Joe, committed.

> Index: xs/APR/Bucket/APR__Bucket.h
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
> retrieving revision 1.10
> diff -u -r1.10 APR__Bucket.h
> --- xs/APR/Bucket/APR__Bucket.h 9 Jun 2004 14:46:22 -0000       1.10
> +++ xs/APR/Bucket/APR__Bucket.h 12 Jun 2004 21:59:01 -0000
> @@ -19,7 +19,7 @@
>                                          int offset, int len)
>  {
> 
> -    int full_len;
> +    STRLEN full_len;
>      (void)SvPV(sv, full_len);
> 
>      if (len) {

this one needs to have a complete adjustement of the arguments, to be 
apr_size_t and apr_off_t (which requires a change in several other APIs). The 
int type is almost never right, when read/write is involved.

Let me know if this patch works for you (committed already, so just try the cvs).

Index: src/modules/perl/modperl_bucket.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.c,v
retrieving revision 1.10
diff -u -r1.10 modperl_bucket.c
--- src/modules/perl/modperl_bucket.c	21 May 2004 18:33:05 -0000	1.10
+++ src/modules/perl/modperl_bucket.c	13 Jun 2004 04:53:42 -0000
@@ -77,7 +77,8 @@
  static apr_bucket *modperl_bucket_sv_make(pTHX_
                                            apr_bucket *bucket,
                                            SV *sv,
-                                          int offset, int len)
+                                          apr_off_t offset,
+                                          apr_size_t len)
  {
      modperl_bucket_sv_t *svbucket;

@@ -107,7 +108,8 @@
      return bucket;
  }

-apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, int offset, int len)
+apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, apr_off_t offset,
+                                     apr_size_t len)
  {
      apr_bucket *bucket;

Index: src/modules/perl/modperl_bucket.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.h,v
retrieving revision 1.2
diff -u -r1.2 modperl_bucket.h
--- src/modules/perl/modperl_bucket.h	4 Mar 2004 06:01:06 -0000	1.2
+++ src/modules/perl/modperl_bucket.h	13 Jun 2004 04:53:42 -0000
@@ -16,6 +16,7 @@
  #ifndef MODPERL_BUCKET_H
  #define MODPERL_BUCKET_H

-apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, int offset, int len);
+apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, apr_off_t offset,
+                                     apr_size_t len);

  #endif /* MODPERL_BUCKET_H */
Index: xs/APR/Bucket/APR__Bucket.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
retrieving revision 1.10
diff -u -r1.10 APR__Bucket.h
--- xs/APR/Bucket/APR__Bucket.h	9 Jun 2004 14:46:22 -0000	1.10
+++ xs/APR/Bucket/APR__Bucket.h	13 Jun 2004 04:53:43 -0000
@@ -16,10 +16,10 @@
  #include "modperl_bucket.h"

  static apr_bucket *mpxs_APR__Bucket_new(pTHX_ SV *classname, SV *sv,
-                                        int offset, int len)
+                                        apr_off_t offset, apr_size_t len)
  {

-    int full_len;
+    apr_size_t full_len;
      (void)SvPV(sv, full_len);

      if (len) {




-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message