dgaudet 97/07/23 21:38:17
Modified: src CHANGES alloc.c http_config.c http_core.c mod_alias.c mod_autoindex.c mod_browser.c mod_rewrite.c Log: Various tweaks to eliminate pointer-int casting warnings on 64-bit cpus like the alpha. Apache still stores ints in pointers, but that's the relatively safe direction. Reviewed by: Brian Behlendorf, Jim Jagielski PR: 344 Revision Changes Path 1.364 +4 -0 apache/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.363 retrieving revision 1.364 diff -u -r1.363 -r1.364 --- CHANGES 1997/07/24 04:35:43 1.363 +++ CHANGES 1997/07/24 04:38:07 1.364 @@ -1,4 +1,8 @@ Changes with Apache 1.3a2 + + *) PORT: Various tweaks to eliminate pointer-int casting warnings on 64-bit + cpus like the alpha. Apache still stores ints in pointers, but that's + the relatively safe direction. [Dean Gaudet] PR#344 *) PORT: QNX mmap() support for faster/more reliable scoreboard handling. [Igor N Kovalenko <[EMAIL PROTECTED]>] PR#683 1.44 +8 -8 apache/src/alloc.c Index: alloc.c =================================================================== RCS file: /export/home/cvs/apache/src/alloc.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- alloc.c 1997/07/24 04:23:56 1.43 +++ alloc.c 1997/07/24 04:38:07 1.44 @@ -818,15 +818,15 @@ * generic cleanup interface. */ -static void fd_cleanup (void *fdv) { close ((int)fdv); } +static void fd_cleanup (void *fdv) { close ((int)(long)fdv); } API_EXPORT(void) note_cleanups_for_fd (pool *p, int fd) { - register_cleanup (p, (void *)fd, fd_cleanup, fd_cleanup); + register_cleanup (p, (void *)(long)fd, fd_cleanup, fd_cleanup); } API_EXPORT(void) kill_cleanups_for_fd(pool *p,int fd) { - kill_cleanup(p,(void *)fd,fd_cleanup); + kill_cleanup(p,(void *)(long)fd,fd_cleanup); } API_EXPORT(int) popenf(pool *a, const char *name, int flg, int mode) @@ -854,7 +854,7 @@ block_alarms(); res = close(fd); save_errno = errno; - kill_cleanup(a, (void *)fd, fd_cleanup); + kill_cleanup(a, (void *)(long)fd, fd_cleanup); unblock_alarms(); errno = save_errno; return res; @@ -973,16 +973,16 @@ { int rv; - rv = closesocket((int)fdv); + rv = closesocket((int)(long)fdv); } API_EXPORT(void) note_cleanups_for_socket (pool *p, int fd) { - register_cleanup (p, (void *)fd, socket_cleanup, socket_cleanup); + register_cleanup (p, (void *)(long)fd, socket_cleanup, socket_cleanup); } API_EXPORT(void) kill_cleanups_for_socket(pool *p,int sock) { - kill_cleanup(p,(void *)sock,socket_cleanup); + kill_cleanup(p,(void *)(long)sock,socket_cleanup); } API_EXPORT(int) pclosesocket(pool *a, int sock) @@ -996,7 +996,7 @@ errno = WSAGetLastError() - WSABASEERR; #endif /* WIN32 */ save_errno = errno; - kill_cleanup(a, (void *)sock, socket_cleanup); + kill_cleanup(a, (void *)(long)sock, socket_cleanup); unblock_alarms(); errno = save_errno; return res; 1.65 +2 -2 apache/src/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache/src/http_config.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- http_config.c 1997/07/23 00:00:04 1.64 +++ http_config.c 1997/07/24 04:38:08 1.65 @@ -786,7 +786,7 @@ { /* This one's pretty generic... */ - int offset = (int)cmd->info; + int offset = (int)(long)cmd->info; *(char **)(struct_ptr + offset) = pstrdup (cmd->pool, arg); return NULL; } @@ -796,7 +796,7 @@ { /* This one's pretty generic too... */ - int offset = (int)cmd->info; + int offset = (int)(long)cmd->info; *(int *)(struct_ptr + offset) = arg ? 1 : 0; return NULL; } 1.100 +1 -1 apache/src/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache/src/http_core.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- http_core.c 1997/07/21 05:53:42 1.99 +++ http_core.c 1997/07/24 04:38:09 1.100 @@ -853,7 +853,7 @@ { /* This one's pretty generic... */ - int offset = (int)cmd->info; + int offset = (int)(long)cmd->info; char *struct_ptr = (char *)cmd->server; *(char **)(struct_ptr + offset) = pstrdup (cmd->pool, arg); 1.20 +1 -1 apache/src/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_alias.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- mod_alias.c 1997/07/17 22:27:31 1.19 +++ mod_alias.c 1997/07/24 04:38:09 1.20 @@ -156,7 +156,7 @@ server_rec *s = cmd->server; alias_server_conf *serverconf = (alias_server_conf *)get_module_config(s->module_config,&alias_module); - int status = (int)cmd->info; + int status = (int)(long)cmd->info; regex_t *r = NULL; char *f = arg2; char *url = arg3; 1.41 +2 -2 apache/src/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_autoindex.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- mod_autoindex.c 1997/07/21 05:53:49 1.40 +++ mod_autoindex.c 1997/07/24 04:38:10 1.41 @@ -224,7 +224,7 @@ static const char *add_opts_int(cmd_parms *cmd, void *d, int opts) { - push_item(((autoindex_config_rec *)d)->opts_list, (char*)opts, NULL, + push_item(((autoindex_config_rec *)d)->opts_list, (char*)(long)opts, NULL, cmd->path, NULL); return NULL; } @@ -468,7 +468,7 @@ struct item *p = &items[i]; if (!strcmp_match(path, p->apply_path)) - return (int)p->type; + return (int)(long)p->type; } return 0; } 1.14 +1 -1 apache/src/mod_browser.c Index: mod_browser.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_browser.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_browser.c 1997/07/21 00:34:05 1.13 +++ mod_browser.c 1997/07/24 04:38:10 1.14 @@ -98,7 +98,7 @@ get_module_config (cmd->server->module_config, &browser_module); browser_entry *new, *entries = (browser_entry *)sconf->browsers->elts; char *var; - int i, cflags = (int)cmd->info; + int i, cflags = (int)(long)cmd->info; /* First, try to merge into an existing entry */ 1.37 +5 -1 apache/src/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- mod_rewrite.c 1997/07/21 17:26:50 1.36 +++ mod_rewrite.c 1997/07/24 04:38:11 1.37 @@ -2400,7 +2400,11 @@ else ap_snprintf(redir, sizeof(redir), "/redir#%d", i); - ap_snprintf(str3, sizeof(str3), "%s %s [%s/sid#%x][rid#%x/%s%s] (%d) %s\n", str1, current_logtime(r), r->server->server_hostname, (unsigned int)(r->server), (unsigned int)r, type, redir, level, str2); + ap_snprintf(str3, sizeof(str3), + "%s %s [%s/sid#%lx][rid#%lx/%s%s] (%d) %s\n", str1, + current_logtime(r), r->server->server_hostname, + (unsigned long)(r->server), (unsigned long)r, + type, redir, level, str2); fd_lock(conf->rewritelogfp); write(conf->rewritelogfp, str3, strlen(str3));