summaryrefslogtreecommitdiff
path: root/libsparse/sparse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsparse/sparse.cpp')
-rw-r--r--libsparse/sparse.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libsparse/sparse.cpp b/libsparse/sparse.cpp
index 6ff97b6ab..cb288c555 100644
--- a/libsparse/sparse.cpp
+++ b/libsparse/sparse.cpp
@@ -30,13 +30,13 @@
struct sparse_file* sparse_file_new(unsigned int block_size, int64_t len) {
struct sparse_file* s = reinterpret_cast<sparse_file*>(calloc(sizeof(struct sparse_file), 1));
if (!s) {
- return NULL;
+ return nullptr;
}
s->backed_block_list = backed_block_list_new(block_size);
if (!s->backed_block_list) {
free(s);
- return NULL;
+ return nullptr;
}
s->block_size = block_size;
@@ -252,7 +252,7 @@ static struct backed_block* move_chunks_up_to_len(struct sparse_file* from, stru
unsigned int len) {
int64_t count = 0;
struct output_file* out_counter;
- struct backed_block* last_bb = NULL;
+ struct backed_block* last_bb = nullptr;
struct backed_block* bb;
struct backed_block* start;
unsigned int last_block = 0;
@@ -270,7 +270,7 @@ static struct backed_block* move_chunks_up_to_len(struct sparse_file* from, stru
out_counter = output_file_open_callback(out_counter_write, &count, to->block_size, to->len, false,
true, 0, false);
if (!out_counter) {
- return NULL;
+ return nullptr;
}
for (bb = start; bb; bb = backed_block_iter_next(bb)) {
@@ -281,7 +281,7 @@ static struct backed_block* move_chunks_up_to_len(struct sparse_file* from, stru
/* will call out_counter_write to update count */
ret = sparse_file_write_block(out_counter, bb);
if (ret) {
- bb = NULL;
+ bb = nullptr;
goto out;
}
if (file_len + count > len) {
@@ -330,13 +330,13 @@ int sparse_file_resparse(struct sparse_file* in_s, unsigned int max_len, struct
if (c < out_s_count) {
out_s[c] = s;
} else {
- backed_block_list_move(s->backed_block_list, tmp->backed_block_list, NULL, NULL);
+ backed_block_list_move(s->backed_block_list, tmp->backed_block_list, nullptr, nullptr);
sparse_file_destroy(s);
}
c++;
} while (bb);
- backed_block_list_move(tmp->backed_block_list, in_s->backed_block_list, NULL, NULL);
+ backed_block_list_move(tmp->backed_block_list, in_s->backed_block_list, nullptr, nullptr);
sparse_file_destroy(tmp);