*: use NULL for null pointers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
44fbfa78ca
commit
4b1100edd8
@ -258,7 +258,7 @@ int blkid_probe_all(blkid_cache cache)
|
||||
{
|
||||
FILE *proc;
|
||||
char line[1024];
|
||||
char ptname0[128], ptname1[128], *ptname = 0;
|
||||
char ptname0[128], ptname1[128], *ptname = NULL;
|
||||
char *ptnames[2];
|
||||
dev_t devs[2];
|
||||
int ma, mi;
|
||||
|
@ -82,7 +82,7 @@ static void set_uuid(blkid_dev dev, uuid_t uuid)
|
||||
static void get_ext2_info(blkid_dev dev, unsigned char *buf)
|
||||
{
|
||||
struct ext2_super_block *es = (struct ext2_super_block *) buf;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n",
|
||||
blkid_le32(es->s_feature_compat),
|
||||
@ -168,7 +168,7 @@ static int probe_vfat(int fd __BLKID_ATTR((unused)),
|
||||
{
|
||||
struct vfat_super_block *vs;
|
||||
char serno[10];
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
int label_len = 0;
|
||||
|
||||
vs = (struct vfat_super_block *)buf;
|
||||
@ -201,7 +201,7 @@ static int probe_msdos(int fd __BLKID_ATTR((unused)),
|
||||
{
|
||||
struct msdos_super_block *ms = (struct msdos_super_block *) buf;
|
||||
char serno[10];
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
int label_len = 0;
|
||||
|
||||
if (strncmp(ms->ms_label, "NO NAME", 7)) {
|
||||
@ -232,7 +232,7 @@ static int probe_xfs(int fd __BLKID_ATTR((unused)),
|
||||
unsigned char *buf)
|
||||
{
|
||||
struct xfs_super_block *xs;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
xs = (struct xfs_super_block *)buf;
|
||||
|
||||
@ -250,7 +250,7 @@ static int probe_reiserfs(int fd __BLKID_ATTR((unused)),
|
||||
{
|
||||
struct reiserfs_super_block *rs = (struct reiserfs_super_block *) buf;
|
||||
unsigned int blocksize;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
blocksize = blkid_le16(rs->rs_blocksize);
|
||||
|
||||
@ -277,7 +277,7 @@ static int probe_jfs(int fd __BLKID_ATTR((unused)),
|
||||
unsigned char *buf)
|
||||
{
|
||||
struct jfs_super_block *js;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
js = (struct jfs_super_block *)buf;
|
||||
|
||||
@ -295,7 +295,7 @@ static int probe_romfs(int fd __BLKID_ATTR((unused)),
|
||||
unsigned char *buf)
|
||||
{
|
||||
struct romfs_super_block *ros;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
ros = (struct romfs_super_block *)buf;
|
||||
|
||||
@ -312,7 +312,7 @@ static int probe_cramfs(int fd __BLKID_ATTR((unused)),
|
||||
unsigned char *buf)
|
||||
{
|
||||
struct cramfs_super_block *csb;
|
||||
const char *label = 0;
|
||||
const char *label = NULL;
|
||||
|
||||
csb = (struct cramfs_super_block *)buf;
|
||||
|
||||
|
@ -65,7 +65,7 @@ char *blkid_get_devname(blkid_cache cache, const char *token,
|
||||
{
|
||||
blkid_dev dev;
|
||||
blkid_cache c = cache;
|
||||
char *t = 0, *v = 0;
|
||||
char *t = NULL, *v = NULL;
|
||||
char *ret = NULL;
|
||||
|
||||
if (!token)
|
||||
|
@ -112,7 +112,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
|
||||
const char *value, const int vlength)
|
||||
{
|
||||
blkid_tag t = 0, head = 0;
|
||||
char *val = 0;
|
||||
char *val = NULL;
|
||||
|
||||
if (!dev || !name)
|
||||
return -BLKID_ERR_PARAM;
|
||||
|
@ -1539,7 +1539,7 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
|
||||
struct buffer_head *bh;
|
||||
struct inode *j_inode = NULL;
|
||||
struct kdev_s *dev_fs = NULL, *dev_journal;
|
||||
const char *journal_name = 0;
|
||||
const char *journal_name = NULL;
|
||||
journal_t *journal = NULL;
|
||||
errcode_t retval = 0;
|
||||
io_manager io_ptr = 0;
|
||||
@ -6009,7 +6009,7 @@ static int check_dir_block(ext2_filsys fs,
|
||||
struct dir_info *subdir, *dir;
|
||||
struct dx_dir_info *dx_dir;
|
||||
#ifdef ENABLE_HTREE
|
||||
struct dx_dirblock_info *dx_db = 0;
|
||||
struct dx_dirblock_info *dx_db = NULL;
|
||||
#endif /* ENABLE_HTREE */
|
||||
struct ext2_dir_entry *dirent, *prev;
|
||||
ext2_dirhash_t hash;
|
||||
@ -7524,7 +7524,7 @@ static void e2fsck_pass4(e2fsck_t ctx)
|
||||
struct ext2_inode inode;
|
||||
struct problem_context pctx;
|
||||
__u16 link_count, link_counted;
|
||||
char *buf = 0;
|
||||
char *buf = NULL;
|
||||
int group, maxgroup;
|
||||
|
||||
/* Pass 4 */
|
||||
@ -9670,7 +9670,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
|
||||
{
|
||||
ext2_filsys fs = ctx->fs;
|
||||
const struct e2fsck_problem *ptr;
|
||||
struct latch_descr *ldesc = 0;
|
||||
struct latch_descr *ldesc = NULL;
|
||||
const char *message;
|
||||
int def_yn, answer, ans;
|
||||
int print_answer = 0;
|
||||
@ -10669,7 +10669,7 @@ static errcode_t calculate_tree(ext2_filsys fs,
|
||||
ext2_ino_t parent)
|
||||
{
|
||||
struct ext2_dx_root_info *root_info;
|
||||
struct ext2_dx_entry *root, *dx_ent = 0;
|
||||
struct ext2_dx_entry *root, *dx_ent = NULL;
|
||||
struct ext2_dx_countlimit *root_limit, *limit;
|
||||
errcode_t retval;
|
||||
char * block_start;
|
||||
@ -10821,7 +10821,7 @@ static errcode_t e2fsck_rehash_dir(e2fsck_t ctx, ext2_ino_t ino)
|
||||
ext2_filsys fs = ctx->fs;
|
||||
errcode_t retval;
|
||||
struct ext2_inode inode;
|
||||
char *dir_buf = 0;
|
||||
char *dir_buf = NULL;
|
||||
struct fill_dir_struct fd;
|
||||
struct out_dir outdir;
|
||||
|
||||
@ -11559,7 +11559,7 @@ static void check_resize_inode(e2fsck_t ctx)
|
||||
struct problem_context pctx;
|
||||
int i, j, gdt_off, ind_off;
|
||||
blk_t blk, pblk, expect;
|
||||
__u32 *dind_buf = 0, *ind_buf;
|
||||
__u32 *dind_buf = NULL, *ind_buf;
|
||||
errcode_t retval;
|
||||
|
||||
clear_problem_context(&pctx);
|
||||
@ -12975,7 +12975,7 @@ static errcode_t PRS(int argc, char **argv, e2fsck_t *ret_ctx)
|
||||
e2fsck_t ctx;
|
||||
errcode_t retval;
|
||||
struct sigaction sa;
|
||||
char *extended_opts = 0;
|
||||
char *extended_opts = NULL;
|
||||
|
||||
retval = e2fsck_allocate_context(&ctx);
|
||||
if (retval)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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) ||
|
||||
|
@ -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))
|
||||
|
@ -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...
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -1166,7 +1166,7 @@ static void signal_cancel(int sig FSCK_ATTR((unused)))
|
||||
static void PRS(int argc, char **argv)
|
||||
{
|
||||
int i, j;
|
||||
char *arg, *dev, *tmp = 0;
|
||||
char *arg, *dev, *tmp = NULL;
|
||||
char options[128];
|
||||
int opt = 0;
|
||||
int opts_for_fsck = 0;
|
||||
|
@ -799,8 +799,8 @@ static int PRS(int argc, char **argv)
|
||||
int show_version_only = 0;
|
||||
ext2_ino_t num_inodes = 0;
|
||||
errcode_t retval;
|
||||
char * extended_opts = 0;
|
||||
const char * fs_type = 0;
|
||||
char * extended_opts = NULL;
|
||||
const char * fs_type = NULL;
|
||||
blk_t dev_size;
|
||||
long sysval;
|
||||
|
||||
|
@ -2482,7 +2482,7 @@ static void hashcd(void);
|
||||
static int
|
||||
docd(const char *dest, int flags)
|
||||
{
|
||||
const char *dir = 0;
|
||||
const char *dir = NULL;
|
||||
int err;
|
||||
|
||||
TRACE(("docd(\"%s\", %d) called\n", dest, flags));
|
||||
|
Loading…
Reference in New Issue
Block a user