Commit da3b76730e3666490854efc6147ee727bbc6b566

Authored by James Plank
2 parents c21f772f d4730bfd
Exists in master

Merged in dachary/jerasure/wip-compilation-warnings (pull request #2)

fix compilation warnings
Showing 3 changed files with 9 additions and 14 deletions   Show diff stats
src/galois.c
... ... @@ -250,6 +250,7 @@ int galois_single_multiply(int x, int y, int w)
250 250 return gfp_array[w]->multiply.w32(gfp_array[w], x, y);
251 251 } else {
252 252 fprintf(stderr, "ERROR -- Galois field not implemented for w=%d\n", w);
  253 + return 0;
253 254 }
254 255 }
255 256  
... ... @@ -266,6 +267,7 @@ int galois_single_divide(int x, int y, int w)
266 267 return gfp_array[w]->divide.w32(gfp_array[w], x, y);
267 268 } else {
268 269 fprintf(stderr, "ERROR -- Galois field not implemented for w=%d\n", w);
  270 + return 0;
269 271 }
270 272 }
271 273  
... ...
src/jerasure.c
... ... @@ -167,7 +167,7 @@ int jerasure_make_decoding_bitmatrix(int k, int m, int w, int *matrix, int *eras
167 167 int jerasure_matrix_decode(int k, int m, int w, int *matrix, int row_k_ones, int *erasures,
168 168 char **data_ptrs, char **coding_ptrs, int size)
169 169 {
170   - int i, j, edd, lastdrive;
  170 + int i, edd, lastdrive;
171 171 int *tmpids;
172 172 int *erased, *decoding_matrix, *dm_ids;
173 173  
... ... @@ -299,8 +299,7 @@ int *jerasure_matrix_to_bitmatrix(int k, int m, int w, int *matrix)
299 299 void jerasure_matrix_encode(int k, int m, int w, int *matrix,
300 300 char **data_ptrs, char **coding_ptrs, int size)
301 301 {
302   - int *init;
303   - int i, j;
  302 + int i;
304 303  
305 304 if (w != 8 && w != 16 && w != 32) {
306 305 fprintf(stderr, "ERROR: jerasure_matrix_encode() and w is not 8, 16 or 32\n");
... ... @@ -637,7 +636,7 @@ void jerasure_matrix_dotprod(int k, int w, int *matrix_row,
637 636 int jerasure_bitmatrix_decode(int k, int m, int w, int *bitmatrix, int row_k_ones, int *erasures,
638 637 char **data_ptrs, char **coding_ptrs, int size, int packetsize)
639 638 {
640   - int i, j;
  639 + int i;
641 640 int *erased;
642 641 int *decoding_matrix;
643 642 int *dm_ids;
... ... @@ -775,7 +774,6 @@ static int set_up_ids_for_scheduled_decoding(int k, int m, int *erasures, int *r
775 774 {
776 775 int ddf, cdf;
777 776 int *erased;
778   - char **ptrs;
779 777 int i, j, x;
780 778  
781 779 ddf = 0;
... ... @@ -1010,9 +1008,6 @@ int jerasure_schedule_decode_cache(int k, int m, int w, int ***scache, int *eras
1010 1008  
1011 1009 int ***jerasure_generate_schedule_cache(int k, int m, int w, int *bitmatrix, int smart)
1012 1010 {
1013   - int i, tdone;
1014   - char **ptrs;
1015   - int **schedule;
1016 1011 int ***scache;
1017 1012 int erasures[3];
1018 1013 int e1, e2;
... ... @@ -1139,7 +1134,7 @@ int jerasure_invertible_bitmatrix(int *mat, int rows)
1139 1134  
1140 1135 int *jerasure_matrix_multiply(int *m1, int *m2, int r1, int c1, int r2, int c2, int w)
1141 1136 {
1142   - int *product, i, j, k, l;
  1137 + int *product, i, j, k;
1143 1138  
1144 1139 product = (int *) malloc(sizeof(int)*r1*c2);
1145 1140 for (i = 0; i < r1*c2; i++) product[i] = 0;
... ... @@ -1193,7 +1188,7 @@ void jerasure_schedule_encode(int k, int m, int w, int **schedule,
1193 1188 char **data_ptrs, char **coding_ptrs, int size, int packetsize)
1194 1189 {
1195 1190 char **ptr_copy;
1196   - int i, j, tdone;
  1191 + int i, tdone;
1197 1192  
1198 1193 ptr_copy = talloc(char *, (k+m));
1199 1194 for (i = 0; i < k; i++) ptr_copy[i] = data_ptrs[i];
... ... @@ -1360,8 +1355,7 @@ int **jerasure_smart_bitmatrix_to_schedule(int k, int m, int w, int *bitmatrix)
1360 1355 void jerasure_bitmatrix_encode(int k, int m, int w, int *bitmatrix,
1361 1356 char **data_ptrs, char **coding_ptrs, int size, int packetsize)
1362 1357 {
1363   - int i, j, x, y, sptr, pstarted, index;
1364   - char *dptr, *pptr;
  1358 + int i;
1365 1359  
1366 1360 if (packetsize%sizeof(long) != 0) {
1367 1361 fprintf(stderr, "jerasure_bitmatrix_encode - packetsize(%d) %c sizeof(long) != 0\n", packetsize, '%');
... ...
src/reed_sol.c
... ... @@ -77,8 +77,7 @@ int *reed_sol_r6_coding_matrix(int k, int w)
77 77  
78 78 int *reed_sol_vandermonde_coding_matrix(int k, int m, int w)
79 79 {
80   - int tmp;
81   - int i, j, index;
  80 + int i, j;
82 81 int *vdm, *dist;
83 82  
84 83 vdm = reed_sol_big_vandermonde_distribution_matrix(k+m, k, w);
... ...