Just for completeness, attached is a diff against the
src/modules/perl mod_perl 1.0 cvs directory which gets rid of
(all but one) warning on Win32. There's a few typecast
insertions, plus some avoiding declaring variables that won't be
used for Win32. One thing that I wasn't quite sure about the
portability - "old_warn", in, eg, perl_util.c, was defined as
I32, but Windows preferred it to be unsigned char.

-- 
best regards,
randy
Index: src/modules/perl/Apache.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.125
diff -u -r1.125 Apache.xs
--- src/modules/perl/Apache.xs  6 Jul 2001 20:33:35 -0000       1.125
+++ src/modules/perl/Apache.xs  23 Jan 2003 05:18:52 -0000
@@ -1002,7 +1002,7 @@
 
     if (should_client_block(r)) {
         (void)SvUPGRADE(buffer, SVt_PV);
-        SvGROW(buffer, bufsiz+1);
+        SvGROW(buffer, (STRLEN) bufsiz+1);
         nrd = get_client_block(r, SvPVX(buffer), bufsiz);
     }
     r->read_length += old_read_length;
@@ -1041,7 +1041,7 @@
 
     PPCODE:
     (void)SvUPGRADE(buffer, SVt_PV);
-    SvGROW(buffer, bufsiz+1);
+    SvGROW(buffer, (STRLEN) bufsiz+1);
     nrd = get_client_block(r, SvPVX(buffer), bufsiz);
     if ( nrd > 0 ) {
         XPUSHs(sv_2mortal(newSViv((long)nrd)));
Index: src/modules/perl/Constants.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Constants.xs,v
retrieving revision 1.20
diff -u -r1.20 Constants.xs
--- src/modules/perl/Constants.xs       30 Mar 2000 00:44:40 -0000      1.20
+++ src/modules/perl/Constants.xs       23 Jan 2003 05:18:52 -0000
@@ -906,7 +906,7 @@
 #endif
        char *name = EXP_NAME;
        double val = constant(name);
-       my_newCONSTSUB(stash, name, newSViv(val));
+       my_newCONSTSUB(stash, name, newSViv((I32) val));
     }
 }
 
@@ -955,7 +955,7 @@
     if(errno != 0) 
        croak("Your vendor has not defined Apache::Constants macro `%s'", name);
     else 
-        my_newCONSTSUB(stash, name, newSViv(val));
+        my_newCONSTSUB(stash, name, newSViv((I32) val));
 
 const char *
 SERVER_VERSION()
Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.145
diff -u -r1.145 mod_perl.c
--- src/modules/perl/mod_perl.c 23 May 2002 04:35:16 -0000      1.145
+++ src/modules/perl/mod_perl.c 23 Jan 2003 05:18:53 -0000
@@ -1099,8 +1099,11 @@
 static void per_request_cleanup(request_rec *r)
 {
     dPPREQ;
+
+#ifndef WIN32
     perl_request_sigsave **sigs;
     int i;
+#endif
 
     if(!cfg) {
        return;
Index: src/modules/perl/mod_perl.h
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/mod_perl.h,v
retrieving revision 1.116
diff -u -r1.116 mod_perl.h
--- src/modules/perl/mod_perl.h 23 May 2002 04:35:16 -0000      1.116
+++ src/modules/perl/mod_perl.h 23 Jan 2003 05:18:54 -0000
@@ -1174,7 +1174,7 @@
 I32 perl_module_is_loaded(char *name);
 SV *perl_module2file(char *name);
 int perl_require_module(char *module, server_rec *s);
-int perl_load_startup_script(server_rec *s, pool *p, char *script, I32 my_warn);
+int perl_load_startup_script(server_rec *s, pool *p, char *script, unsigned char 
+my_warn);
 array_header *perl_cgi_env_init(request_rec *r);
 void perl_clear_env(void);
 void mp_magic_setenv(char *key, char *val, int is_tainted);
Index: src/modules/perl/perl_config.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/perl_config.c,v
retrieving revision 1.114
diff -u -r1.114 perl_config.c
--- src/modules/perl/perl_config.c      24 Mar 2002 22:51:04 -0000      1.114
+++ src/modules/perl/perl_config.c      23 Jan 2003 05:18:56 -0000
@@ -392,7 +392,11 @@
 
 perl_request_config *perl_create_request_config(pool *p, server_rec *s)
 {
+
+#ifndef WIN32
     int i;
+#endif
+
     perl_request_config *cfg = 
        (perl_request_config *)pcalloc(p, sizeof(perl_request_config));
     cfg->pnotes = Nullhv;
@@ -1528,7 +1532,7 @@
 {
     I32 alen = AvFILL(av);
     I32 i, j;
-    I32 oldwarn = dowarn; /*XXX, hmm*/
+    unsigned char oldwarn = dowarn; /*XXX, hmm*/
     dowarn = FALSE;
 
     if(!n) n = alen+1;
Index: src/modules/perl/perl_util.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/perl_util.c,v
retrieving revision 1.50
diff -u -r1.50 perl_util.c
--- src/modules/perl/perl_util.c        25 Dec 2002 01:46:09 -0000      1.50
+++ src/modules/perl/perl_util.c        23 Jan 2003 05:18:56 -0000
@@ -470,7 +470,7 @@
     dPSRV(s);
     HV *hash = GvHV(incgv);
     HE *entry;
-    I32 old_warn = dowarn;
+    unsigned char old_warn = dowarn;
     pool *p = ap_make_sub_pool(sp);
     table *reload = ap_make_table(p, HvKEYS(hash));
     char **entries;
@@ -573,10 +573,10 @@
     /*(void)hv_delete(GvHV(incgv), pv, strlen(pv), G_DISCARD);*/
 }      
 
-int perl_load_startup_script(server_rec *s, pool *p, char *script, I32 my_warn)
+int perl_load_startup_script(server_rec *s, pool *p, char *script, unsigned char 
+my_warn)
 {
     dTHR;
-    I32 old_warn = dowarn;
+    unsigned char old_warn = dowarn;
 
     if(!script) {
        MP_TRACE_d(fprintf(stderr, "no Perl script to load\n"));
@@ -719,7 +719,7 @@
     errpv = SvPVX(errsv);
 
     for(i=0;i<=2;i++) {
-       if(i >= SvCUR(errsv)) 
+       if(i >= (int) SvCUR(errsv)) 
            break;
        if(isDIGIT(SvPVX(errsv)[i])) 
            http_code++;
@@ -738,7 +738,7 @@
     }
 
     /* nothin but 3 digits */
-    if(SvCUR(errsv) == http_code)
+    if((int) SvCUR(errsv) == http_code)
        return TRUE;
 
     ap_cpystrn((char *)cpcode, errpv, 4);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to