mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 21:00:16 -05:00
Removes some clang warnings.
This commit is contained in:
parent
f21d86e999
commit
5dc4365394
3 changed files with 10 additions and 6 deletions
|
|
@ -175,7 +175,9 @@ void state_dry(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
||||||
block_off_t blockmax;
|
block_off_t blockmax;
|
||||||
int ret;
|
int ret;
|
||||||
struct snapraid_parity parity[LEV_MAX];
|
struct snapraid_parity parity[LEV_MAX];
|
||||||
struct snapraid_parity* parity_ptr[LEV_MAX];
|
/* the following initialization is to avoid clang warnings about */
|
||||||
|
/* potential state->level change, that never happens */
|
||||||
|
struct snapraid_parity* parity_ptr[LEV_MAX] = { 0 };
|
||||||
unsigned error;
|
unsigned error;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1021,15 +1021,15 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
||||||
data_off_t out_size;
|
data_off_t out_size;
|
||||||
int ret;
|
int ret;
|
||||||
struct snapraid_parity parity[LEV_MAX];
|
struct snapraid_parity parity[LEV_MAX];
|
||||||
struct snapraid_parity* parity_ptr[LEV_MAX];
|
/* the following initialization is to avoid clang warnings about */
|
||||||
|
/* potential state->level change, that never happens */
|
||||||
|
struct snapraid_parity* parity_ptr[LEV_MAX] = { 0 };
|
||||||
unsigned unrecoverable_error;
|
unsigned unrecoverable_error;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
unsigned level;
|
|
||||||
int skip_sync = 0;
|
int skip_sync = 0;
|
||||||
|
|
||||||
printf("Initializing...\n");
|
printf("Initializing...\n");
|
||||||
|
|
||||||
level = state->level;
|
|
||||||
blockmax = parity_size(state);
|
blockmax = parity_size(state);
|
||||||
size = blockmax * (data_off_t)state->block_size;
|
size = blockmax * (data_off_t)state->block_size;
|
||||||
loaded_size = state->loaded_paritymax * (data_off_t)state->block_size;
|
loaded_size = state->loaded_paritymax * (data_off_t)state->block_size;
|
||||||
|
|
@ -1046,7 +1046,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
||||||
blockmax = blockstart + blockcount;
|
blockmax = blockstart + blockcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(l=0;l<level;++l) {
|
for(l=0;l<state->level;++l) {
|
||||||
/* create the file and open for writing */
|
/* create the file and open for writing */
|
||||||
parity_ptr[l] = &parity[l];
|
parity_ptr[l] = &parity[l];
|
||||||
ret = parity_create(parity_ptr[l], state->parity_path[l], &out_size, state->file_mode);
|
ret = parity_create(parity_ptr[l], state->parity_path[l], &out_size, state->file_mode);
|
||||||
|
|
@ -1112,7 +1112,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(l=0;l<level;++l) {
|
for(l=0;l<state->level;++l) {
|
||||||
ret = parity_sync(parity_ptr[l]);
|
ret = parity_sync(parity_ptr[l]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ void **raid_malloc_vector(int nd, int n, size_t size, void **freeptr)
|
||||||
unsigned char *va;
|
unsigned char *va;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
BUG_ON(n <= 0 || nd < 0);
|
||||||
|
|
||||||
v = malloc(n * sizeof(void *));
|
v = malloc(n * sizeof(void *));
|
||||||
if (!v)
|
if (!v)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue