*: use NULL for null pointers

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-03-05 14:10:54 +01:00
parent 44fbfa78ca
commit 4b1100edd8
19 changed files with 36 additions and 36 deletions

View File

@@ -109,7 +109,7 @@ errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal,
{
errcode_t retval;
blk_t block;
char *buf = 0;
char *buf = NULL;
if (!block_buf) {
retval = ext2fs_get_mem(fs->blocksize, &buf);

View File

@@ -136,7 +136,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
struct ext2_inode inode_buf;
blk_t addr_per_block;
blk_t b;
char *buf = 0;
char *buf = NULL;
errcode_t retval = 0;
int blocks_alloc = 0, inode_dirty = 0;

View File

@@ -206,8 +206,8 @@ errcode_t ext2fs_flush(ext2_filsys fs)
blk_t group_block;
errcode_t retval;
unsigned long fs_state;
struct ext2_super_block *super_shadow = 0;
struct ext2_group_desc *group_shadow = 0;
struct ext2_super_block *super_shadow = NULL;
struct ext2_group_desc *group_shadow = NULL;
char *group_ptr;
int old_desc_blocks;
#if BB_BIG_ENDIAN

View File

@@ -80,7 +80,7 @@ errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block,
int do_swap = 0;
errcode_t retval;
char *p, *end;
char *buf = 0;
char *buf = NULL;
struct ext2_dir_entry *dirent;
if ((fs->flags & EXT2_FLAG_SWAP_BYTES) ||

View File

@@ -68,7 +68,7 @@ errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk,
{
errcode_t retval;
struct ext2_ext_attr_header *header;
char *buf = 0;
char *buf = NULL;
if ((blk >= fs->super->s_blocks_count) ||
(blk < fs->super->s_first_data_block))

View File

@@ -115,9 +115,9 @@ success:
*/
char *ext2fs_find_block_device(dev_t device)
{
struct dir_list *list = 0, *new_list = 0;
struct dir_list *list = NULL, *new_list = NULL;
struct dir_list *current;
char *ret_path = 0;
char *ret_path = NULL;
/*
* Add the starting directories to search...

View File

@@ -333,7 +333,7 @@ errout:
*/
errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags)
{
char *ptr, *buf = 0;
char *ptr, *buf = NULL;
int size;
ssize_t actual;
errcode_t retval;

View File

@@ -39,7 +39,7 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum,
ext2_ino_t ino = inum;
ext2_ino_t scratch_ino;
blk_t blk;
char *block = 0;
char *block = NULL;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);

View File

@@ -95,7 +95,7 @@ static errcode_t write_journal_file(ext2_filsys fs, char *filename,
blk_t size, int flags)
{
errcode_t retval;
char *buf = 0;
char *buf = NULL;
int fd, ret_size;
blk_t i;

View File

@@ -30,7 +30,7 @@ static errcode_t follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t dir,
char *buf, ext2_ino_t *res_inode)
{
char *pathname;
char *buffer = 0;
char *buffer = NULL;
errcode_t retval;
struct ext2_inode ei;

View File

@@ -149,7 +149,7 @@ errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
{
dgrp_t i;
char *block_bitmap = 0, *inode_bitmap = 0;
char *block_bitmap = NULL, *inode_bitmap = NULL;
char *buf;
errcode_t retval;
int block_nbytes = (int) EXT2_BLOCKS_PER_GROUP(fs->super) / 8;