Browse Source

Use NULL instead of 0 where pointers are expected.

There are 6 remaining occurrences after this commit, in mod_compress,
due to zlib's Z_NULL being defined as 0 instead of NULL.

Signed-off-by: Cyril Brulebois <kibi@debian.org>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2845 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.32
Cyril Brulebois 9 years ago
committed by Stefan Bühler
parent
commit
9c43331382
  1. 4
      src/lemon.c
  2. 6
      src/lempar.c
  3. 2
      src/mod_cgi.c
  4. 4
      src/mod_compress.c
  5. 2
      src/mod_extforward.c
  6. 2
      src/mod_proxy.c
  7. 2
      src/mod_webdav.c
  8. 2
      src/network_writev.c
  9. 2
      src/request.c
  10. 2
      src/stream.c

4
src/lemon.c

@ -357,10 +357,10 @@ void Configtable_clear(/* int(*)(struct config *) */);
/* Allocate a new parser action */
struct action *Action_new(){
static struct action *freelist = 0;
static struct action *freelist = NULL;
struct action *new;
if( freelist==0 ){
if( freelist==NULL ){
int i;
int amt = 100;
freelist = (struct action *)malloc( sizeof(struct action)*amt );

6
src/lempar.c

@ -158,8 +158,8 @@ typedef struct yyParser yyParser;
#ifndef NDEBUG
#include <stdio.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
static FILE *yyTraceFILE = NULL;
static char *yyTracePrompt = NULL;
#endif /* NDEBUG */
#ifndef NDEBUG
@ -310,7 +310,7 @@ void ParseFree(
void (*freeProc)(void*) /* Function used to reclaim memory */
){
yyParser *pParser = (yyParser*)p;
if( pParser==0 ) return;
if( pParser==NULL ) return;
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
(*freeProc)((void*)pParser);
}

2
src/mod_cgi.c

@ -1099,7 +1099,7 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
c->file.mmap.length = c->file.length;
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
strerror(errno), c->file.name, c->file.fd);

4
src/mod_compress.c

@ -750,10 +750,10 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
if (sce->st.st_size < 128) return HANDLER_GO_ON;
/* check if mimetype is in compress-config */
content_type = 0;
content_type = NULL;
if (sce->content_type->ptr) {
char *c;
if ( (c = strchr(sce->content_type->ptr, ';')) != 0) {
if ( (c = strchr(sce->content_type->ptr, ';')) != NULL) {
content_type = srv->tmp_buf;
buffer_copy_string_len(content_type, sce->content_type->ptr, c - sce->content_type->ptr);
}

2
src/mod_extforward.c

@ -328,7 +328,7 @@ static struct addrinfo *ipstr_to_sockaddr(server *srv, const char *host) {
"could not resolve hostname ", host, " because ", gai_strerror(result), strerror(errno));
return NULL;
} else if (res0 == 0) {
} else if (res0 == NULL) {
log_error_write(srv, __FILE__, __LINE__, "SSS",
"Problem in resolving hostname ", host, ": succeeded, but no information returned");
}

2
src/mod_proxy.c

@ -1161,7 +1161,7 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
if (s_len > ct_len + 1) {
char *pi_offset;
if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
if (NULL != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
path_info_offset = pi_offset - fn->ptr;
}
}

2
src/mod_webdav.c

@ -1721,7 +1721,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
return HANDLER_ERROR;
}
if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
strerror(errno), c->file.name, c->file.fd);
close(c->file.fd);

2
src/network_writev.c

@ -240,7 +240,7 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
#endif
}
if (MAP_FAILED == (c->file.mmap.start = mmap(0, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
/* close it here, otherwise we'd have to set FD_CLOEXEC */
log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed:",

2
src/request.c

@ -1022,7 +1022,7 @@ int http_request_parse(server *srv, connection *con) {
i++;
first = i+1;
is_key = 1;
value = 0;
value = NULL;
#if 0
/**
* for Bug 1230 keep the key_len a live

2
src/stream.c

@ -34,7 +34,7 @@ int stream_open(stream *f, buffer *fn) {
return -1;
}
f->start = mmap(0, f->size, PROT_READ, MAP_SHARED, fd, 0);
f->start = mmap(NULL, f->size, PROT_READ, MAP_SHARED, fd, 0);
close(fd);

Loading…
Cancel
Save