Project

General

Profile

Feature #2437 » 0004-Use-NULL-instead-of-0-where-pointers-are-expected.patch

KiBi, 2012-08-15 21:39

View differences:

src/lemon.c
357 357

  
358 358
/* Allocate a new parser action */
359 359
struct action *Action_new(){
360
  static struct action *freelist = 0;
360
  static struct action *freelist = NULL;
361 361
  struct action *new;
362 362

  
363
  if( freelist==0 ){
363
  if( freelist==NULL ){
364 364
    int i;
365 365
    int amt = 100;
366 366
    freelist = (struct action *)malloc( sizeof(struct action)*amt );
src/lempar.c
158 158

  
159 159
#ifndef NDEBUG
160 160
#include <stdio.h>
161
static FILE *yyTraceFILE = 0;
162
static char *yyTracePrompt = 0;
161
static FILE *yyTraceFILE = NULL;
162
static char *yyTracePrompt = NULL;
163 163
#endif /* NDEBUG */
164 164

  
165 165
#ifndef NDEBUG
......
310 310
  void (*freeProc)(void*)     /* Function used to reclaim memory */
311 311
){
312 312
  yyParser *pParser = (yyParser*)p;
313
  if( pParser==0 ) return;
313
  if( pParser==NULL ) return;
314 314
  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
315 315
  (*freeProc)((void*)pParser);
316 316
}
src/mod_cgi.c
1099 1099

  
1100 1100
						c->file.mmap.length = c->file.length;
1101 1101

  
1102
						if (MAP_FAILED == (c->file.mmap.start = mmap(0,  c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
1102
						if (MAP_FAILED == (c->file.mmap.start = mmap(NULL,  c->file.mmap.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
1103 1103
							log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
1104 1104
									strerror(errno), c->file.name,  c->file.fd);
1105 1105

  
src/mod_compress.c
750 750
	if (sce->st.st_size < 128) return HANDLER_GO_ON;
751 751

  
752 752
	/* check if mimetype is in compress-config */
753
	content_type = 0;
753
	content_type = NULL;
754 754
	if (sce->content_type->ptr) {
755 755
		char *c;
756
		if ( (c = strchr(sce->content_type->ptr, ';')) != 0) {
756
		if ( (c = strchr(sce->content_type->ptr, ';')) != NULL) {
757 757
			content_type = srv->tmp_buf;
758 758
			buffer_copy_string_len(content_type, sce->content_type->ptr, c - sce->content_type->ptr);
759 759
		}
src/mod_extforward.c
328 328
			"could not resolve hostname ", host, " because ", gai_strerror(result), strerror(errno));
329 329

  
330 330
		return NULL;
331
	} else if (res0 == 0) {
331
	} else if (res0 == NULL) {
332 332
		log_error_write(srv, __FILE__, __LINE__, "SSS",
333 333
			"Problem in resolving hostname ", host, ": succeeded, but no information returned");
334 334
	}
src/mod_proxy.c
1211 1211
				if (s_len > ct_len + 1) {
1212 1212
					char *pi_offset;
1213 1213

  
1214
					if (0 != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
1214
					if (NULL != (pi_offset = strchr(fn->ptr + ct_len + 1, '/'))) {
1215 1215
						path_info_offset = pi_offset - fn->ptr;
1216 1216
					}
1217 1217
				}
src/mod_webdav.c
1721 1721
						return HANDLER_ERROR;
1722 1722
					}
1723 1723

  
1724
					if (MAP_FAILED == (c->file.mmap.start = mmap(0, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
1724
					if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, c->file.length, PROT_READ, MAP_SHARED, c->file.fd, 0))) {
1725 1725
						log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed: ",
1726 1726
								strerror(errno), c->file.name,  c->file.fd);
1727 1727
						close(c->file.fd);
src/network_writev.c
240 240
#endif
241 241
				}
242 242

  
243
				if (MAP_FAILED == (c->file.mmap.start = mmap(0, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
243
				if (MAP_FAILED == (c->file.mmap.start = mmap(NULL, to_mmap, PROT_READ, MAP_SHARED, c->file.fd, c->file.mmap.offset))) {
244 244
					/* close it here, otherwise we'd have to set FD_CLOEXEC */
245 245

  
246 246
					log_error_write(srv, __FILE__, __LINE__, "ssbd", "mmap failed:",
src/request.c
1022 1022
					i++;
1023 1023
					first = i+1;
1024 1024
					is_key = 1;
1025
					value = 0;
1025
					value = NULL;
1026 1026
#if 0
1027 1027
					/**
1028 1028
					 * for Bug 1230 keep the key_len a live
src/stream.c
34 34
		return -1;
35 35
	}
36 36

  
37
	f->start = mmap(0, f->size, PROT_READ, MAP_SHARED, fd, 0);
37
	f->start = mmap(NULL, f->size, PROT_READ, MAP_SHARED, fd, 0);
38 38

  
39 39
	close(fd);
40 40

  
(4-4/6)