Minor typos and stuff. More later.

master
Jim Plank 2014-01-01 15:02:19 -05:00
parent 16838859dc
commit c9f420fdcd
4 changed files with 18 additions and 15 deletions

View File

@ -37,12 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
revised by S. Simmerman
2/25/08
*/
/* Part of this code was revised by Scott Simmerman 2/25/08 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -56,8 +53,8 @@ usage(char *s)
fprintf(stderr, "usage: reed_sol_01 k m w - Does a simple Reed-Solomon coding example in GF(2^w).\n");
fprintf(stderr, " \n");
fprintf(stderr, " w must be 8, 16 or 32. k+m must be <= 2^w. It sets up a classic\n");
fprintf(stderr, " Vandermonde-based distribution matrix and encodes k devices of\n");
fprintf(stderr, " %d bytes each with it. Then it decodes.\n", sizeof(long));
fprintf(stderr, " Vandermonde-based generator matrix and encodes k devices of\n");
fprintf(stderr, " %ld bytes each with it. Then it decodes.\n", sizeof(long));
fprintf(stderr, " \n");
fprintf(stderr, "This demonstrates: jerasure_matrix_encode()\n");
fprintf(stderr, " jerasure_matrix_decode()\n");
@ -111,6 +108,7 @@ int main(int argc, char **argv)
int k, w, i, j, m;
int *matrix;
char **data, **coding;
unsigned char uc;
int *erasures, *erased;
int *decoding_matrix, *dm_ids;
@ -130,8 +128,10 @@ int main(int argc, char **argv)
data = talloc(char *, k);
for (i = 0; i < k; i++) {
data[i] = talloc(char, sizeof(long));
l = lrand48();
memcpy(data[i], &l, sizeof(long));
for (j = 0; j < sizeof(long); j++) {
uc = lrand48()%256;
data[i][j] = (char) uc;
}
}
coding = talloc(char *, m);

View File

@ -57,7 +57,7 @@ usage(char *s)
fprintf(stderr, " \n");
fprintf(stderr, " w must be 8, 16 or 32. k+2 must be <= 2^w. It sets up a classic\n");
fprintf(stderr, " RAID-6 coding matrix based on Anvin's optimization and encodes\n");
fprintf(stderr, " %d-byte devices with it. Then it decodes.\n", sizeof(long));
fprintf(stderr, " %ld-byte devices with it. Then it decodes.\n", sizeof(long));
fprintf(stderr, " \n");
fprintf(stderr, "This demonstrates: reed_sol_r6_encode()\n");
fprintf(stderr, " reed_sol_r6_coding_matrix()\n");
@ -109,6 +109,7 @@ static void print_data_and_coding(int k, int m, int w, int size,
int main(int argc, char **argv)
{
long l;
unsigned char uc;
int k, w, i, j, m;
int *matrix;
char **data, **coding;
@ -123,7 +124,7 @@ int main(int argc, char **argv)
matrix = reed_sol_r6_coding_matrix(k, w);
printf("Last 2 rows of the Distribution Matrix:\n\n");
printf("Last 2 rows of the Generator Matrix:\n\n");
jerasure_print_matrix(matrix, m, k, w);
printf("\n");
@ -131,8 +132,10 @@ int main(int argc, char **argv)
data = talloc(char *, k);
for (i = 0; i < k; i++) {
data[i] = talloc(char, sizeof(long));
l = lrand48();
memcpy(data[i], &l, sizeof(long));
for (j = 0; j < sizeof(long); j++) {
uc = lrand48()%256;
data[i][j] = (char) uc;
}
}
coding = talloc(char *, m);

View File

@ -234,7 +234,7 @@ timer_split (const double *t)
usage(char *s)
{
fprintf(stderr, "usage: reed_sol_hard_test_gf k m w [additional GF args]- Test and time Reed-Solomon in a particular GF(2^w).\n");
fprintf(stderr, "usage: reed_sol_hard_test_gf k m w iterations bufsize [additional GF args]- Test and time Reed-Solomon in a particular GF(2^w).\n");
fprintf(stderr, " \n");
fprintf(stderr, " w must be 8, 16 or 32. k+m must be <= 2^w.\n");
fprintf(stderr, " See the README for information on the additional GF args.\n");

View File

@ -81,7 +81,7 @@ timer_split (const double *t)
usage(char *s)
{
fprintf(stderr, "usage: reed_sol_test_gf k m w [additional GF args]- Test and time Reed-Solomon in a particular GF(2^w).\n");
fprintf(stderr, "usage: reed_sol_time_gf k m w iterations bufsize [additional GF args]- Test and time Reed-Solomon in a particular GF(2^w).\n");
fprintf(stderr, " \n");
fprintf(stderr, " w must be 8, 16 or 32. k+m must be <= 2^w.\n");
fprintf(stderr, " See the README for information on the additional GF args.\n");