@matheusbsbs / matheus-bagliano / commits / 5142db6912
Fork 0

Fix sparse warnings about usage of 0 instead of NULL

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>

Rene Scharfe committed Apr 2, 2006 at 13:13 UTC 5142db69123b9dd5605ee3e290409787675dd748
2 files changed +21 -21
checkout-index.c
+1 -1
@@ -133,7 +133,7 @@ static int checkout_file(const char *name)
133 static int checkout_all(void)
134 {
135 int i, errs = 0;
136 - struct cache_entry* last_ce = 0;
136 + struct cache_entry* last_ce = NULL;
137
138 for (i = 0; i < active_nr ; i++) {
139 struct cache_entry *ce = active_cache[i];
imap-send.c
+20 -20
@@ -335,12 +335,12 @@ next_arg( char **s )
335 char *ret;
336
337 if (!s || !*s)
338 - return 0;
338 + return NULL;
339 while (isspace( (unsigned char) **s ))
340 (*s)++;
341 if (!**s) {
342 - *s = 0;
343 - return 0;
342 + *s = NULL;
343 + return NULL;
344 }
345 if (**s == '"') {
346 ++*s;
@@ -355,7 +355,7 @@ next_arg( char **s )
355 if (**s)
356 *(*s)++ = 0;
357 if (!**s)
358 - *s = 0;
358 + *s = NULL;
359 }
360 return ret;
361 }
@@ -475,7 +475,7 @@ v_issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb,
475 memset( &cmd->cb, 0, sizeof(cmd->cb) );
476
477 while (imap->literal_pending)
478 - get_cmd_result( ctx, 0 );
478 + get_cmd_result( ctx, NULL );
479
480 bufl = nfsnprintf( buf, sizeof(buf), cmd->cb.data ? CAP(LITERALPLUS) ?
481 "%d %s{%d+}\r\n" : "%d %s{%d}\r\n" : "%d %s\r\n",
@@ -506,12 +506,12 @@ v_issue_imap_cmd( imap_store_t *ctx, struct imap_cmd_cb *cb,
506 free( cmd );
507 return NULL;
508 }
509 - cmd->cb.data = 0;
509 + cmd->cb.data = NULL;
510 } else
511 imap->literal_pending = 1;
512 } else if (cmd->cb.cont)
513 imap->literal_pending = 1;
514 - cmd->next = 0;
514 + cmd->next = NULL;
515 *imap->in_progress_append = cmd;
516 imap->in_progress_append = &cmd->next;
517 imap->num_in_progress++;
@@ -607,7 +607,7 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
607 }
608 *curp = cur = xmalloc( sizeof(*cur) );
609 curp = &cur->next;
610 - cur->val = 0; /* for clean bail */
610 + cur->val = NULL; /* for clean bail */
611 if (*s == '(') {
612 /* sublist */
613 s++;
@@ -680,11 +680,11 @@ parse_imap_list_l( imap_t *imap, char **sp, list_t **curp, int level )
680 goto bail;
681 }
682 *sp = s;
683 - *curp = 0;
683 + *curp = NULL;
684 return 0;
685
686 bail:
687 - *curp = 0;
687 + *curp = NULL;
688 return -1;
689 }
690
@@ -702,7 +702,7 @@ parse_imap_list( imap_t *imap, char **sp )
702 static list_t *
703 parse_list( char **sp )
704 {
705 - return parse_imap_list( 0, sp );
705 + return parse_imap_list( NULL, sp );
706 }
707
708 static void
@@ -789,7 +789,7 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
789 imap->ns_shared = parse_list( &cmd );
790 } else if (!strcmp( "OK", arg ) || !strcmp( "BAD", arg ) ||
791 !strcmp( "NO", arg ) || !strcmp( "BYE", arg )) {
792 - if ((resp = parse_response_code( ctx, 0, cmd )) != RESP_OK)
792 + if ((resp = parse_response_code( ctx, NULL, cmd )) != RESP_OK)
793 return resp;
794 } else if (!strcmp( "CAPABILITY", arg ))
795 parse_capability( imap, cmd );
@@ -813,7 +813,7 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
813 if (cmdp->cb.data) {
814 n = socket_write( &imap->buf.sock, cmdp->cb.data, cmdp->cb.dlen );
815 free( cmdp->cb.data );
816 - cmdp->cb.data = 0;
816 + cmdp->cb.data = NULL;
817 if (n != (int)cmdp->cb.dlen)
818 return RESP_BAD;
819 } else if (cmdp->cb.cont) {
@@ -849,7 +849,7 @@ get_cmd_result( imap_store_t *ctx, struct imap_cmd *tcmd )
849 if (!strcmp( "NO", arg )) {
850 if (cmdp->cb.create && cmd && (cmdp->cb.trycreate || !memcmp( cmd, "[TRYCREATE]", 11 ))) { /* SELECT, APPEND or UID COPY */
851 p = strchr( cmdp->cmd, '"' );
852 - if (!issue_imap_cmd( ctx, 0, "CREATE \"%.*s\"", strchr( p + 1, '"' ) - p + 1, p )) {
852 + if (!issue_imap_cmd( ctx, NULL, "CREATE \"%.*s\"", strchr( p + 1, '"' ) - p + 1, p )) {
853 resp = RESP_BAD;
854 goto normal;
855 }
@@ -898,7 +898,7 @@ imap_close_server( imap_store_t *ictx )
898 imap_t *imap = ictx->imap;
899
900 if (imap->buf.sock.fd != -1) {
901 - imap_exec( ictx, 0, "LOGOUT" );
901 + imap_exec( ictx, NULL, "LOGOUT" );
902 close( imap->buf.sock.fd );
903 }
904 free_list( imap->ns_personal );
@@ -1001,8 +1001,8 @@ imap_open_store( imap_server_conf_t *srvc )
1001 fprintf( stderr, "IMAP error: unknown greeting response\n" );
1002 goto bail;
1003 }
1004 - parse_response_code( ctx, 0, rsp );
1005 - if (!imap->caps && imap_exec( ctx, 0, "CAPABILITY" ) != RESP_OK)
1004 + parse_response_code( ctx, NULL, rsp );
1005 + if (!imap->caps && imap_exec( ctx, NULL, "CAPABILITY" ) != RESP_OK)
1006 goto bail;
1007
1008 if (!preauth) {
@@ -1035,7 +1035,7 @@ imap_open_store( imap_server_conf_t *srvc )
1035 goto bail;
1036 }
1037 warn( "*** IMAP Warning *** Password is being sent in the clear\n" );
1038 - if (imap_exec( ctx, 0, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass ) != RESP_OK) {
1038 + if (imap_exec( ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass ) != RESP_OK) {
1039 fprintf( stderr, "IMAP error: LOGIN failed\n" );
1040 goto bail;
1041 }
@@ -1047,7 +1047,7 @@ imap_open_store( imap_server_conf_t *srvc )
1047
1048 bail:
1049 imap_close_store( &ctx->gen );
1050 - return 0;
1050 + return NULL;
1051 }
1052
1053 static int
@@ -1310,7 +1310,7 @@ int
1310 main(int argc, char **argv)
1311 {
1312 msg_data_t all_msgs, msg;
1313 - store_t *ctx = 0;
1313 + store_t *ctx = NULL;
1314 int uid = 0;
1315 int ofs = 0;
1316 int r;