On Sun, 22 Sep 2002, Randy Kobes wrote:
[ ... ]
> Also attached is a diff for some files in src/modules/perl/ to
> get rid of some warnings on Win32 - these are some type
> mismatches and unused variables. For one a DWTYPE is defined to
> be 'unsigned char' for Win32 and I32 otherwise - this is related
> to the type of dowarn. The only warning left on Win32 is in
> ModuleConfig.xs, in vector_from_sv - not all control paths return
> a value - and I wasn't sure what would be appropriate here.
I didn't read far enough down to see that the unused variables
are only unused on Win32 - the attached diff fixes that. Also, I
checked on Linux that variables set to 'dowarn' can be declared
to be of type 'unsigned char', rather than I32, so this diff
changes this declaration for all.
--
best regards,
randy
Index: 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
--- mod_perl.c 23 May 2002 04:35:16 -0000 1.145
+++ mod_perl.c 23 Sep 2002 14:46:35 -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: 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
--- perl_config.c 24 Mar 2002 22:51:04 -0000 1.114
+++ perl_config.c 23 Sep 2002 14:46:36 -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: perl_util.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/perl_util.c,v
retrieving revision 1.49
diff -u -r1.49 perl_util.c
--- perl_util.c 15 May 2002 02:08:16 -0000 1.49
+++ perl_util.c 23 Sep 2002 14:46:36 -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);
Index: 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
--- mod_perl.h 23 May 2002 04:35:16 -0000 1.116
+++ mod_perl.h 23 Sep 2002 14:46:38 -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);
@@ -1318,3 +1318,4 @@
#undef stderr
#define stderr PerlIO_stderr()
#endif
+
Index: Apache.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.125
diff -u -r1.125 Apache.xs
--- Apache.xs 6 Jul 2001 20:33:35 -0000 1.125
+++ Apache.xs 23 Sep 2002 14:46:39 -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: Constants.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Constants.xs,v
retrieving revision 1.20
diff -u -r1.20 Constants.xs
--- Constants.xs 30 Mar 2000 00:44:40 -0000 1.20
+++ Constants.xs 23 Sep 2002 14:46:42 -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()
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]