Skip to content

Commit

Permalink
Memory alignment improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukuchi committed Oct 2, 2017
1 parent 5c40306 commit 6b9b214
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2017.10.02 Kentaro Fukuchi <[email protected]>
[4.0]
* bitstream.h, qrencode.c, qrencode_inner.h:
- Memory alignment improved.
* tests/test_qrencode.c:
- Error messages improved.

2017.09.29 Kentaro Fukuchi <[email protected]>
[4.0]
* README.md:
Expand Down
2 changes: 1 addition & 1 deletion bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

typedef struct {
int length;
unsigned char *data;
int datasize;
unsigned char *data;
} BitStream;

extern BitStream *BitStream_new(void);
Expand Down
2 changes: 1 addition & 1 deletion qrencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

typedef struct {
int dataLength;
unsigned char *data;
int eccLength;
unsigned char *data;
unsigned char *ecc;
} RSblock;

Expand Down
2 changes: 1 addition & 1 deletion qrencode_inner.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

typedef struct {
int dataLength;
unsigned char *data;
int eccLength;
unsigned char *data;
unsigned char *ecc;
} RSblock;

Expand Down
8 changes: 4 additions & 4 deletions tests/test_qrencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void test_qrraw_new(void)
char num[9] = "01234567";
QRRawCode *raw;

testStart("Test QRRaw_new()");
testStart("Test QRraw_new()");
stream = QRinput_new();
QRinput_setVersion(stream, 10);
QRinput_setErrorCorrectionLevel(stream, QR_ECLEVEL_Q);
Expand All @@ -66,13 +66,13 @@ void test_qrraw_new(void)
assert_equal(raw->blocks, 8, "QRraw.blocks was not as expected.\n");

for(i=0; i<raw->b1; i++) {
assert_equal(raw->rsblock[i].dataLength, 19, "QRraw.rsblock[].dataLength was not as expected.\n");
assert_equal(raw->rsblock[i].dataLength, 19, "QRraw.rsblock[%d].dataLength was not as expected. (%d)\n", i, raw->rsblock[i].dataLength);
}
for(i=raw->b1; i<raw->blocks; i++) {
assert_equal(raw->rsblock[i].dataLength, 20, "QRraw.rsblock[].dataLength was not as expected.\n");
assert_equal(raw->rsblock[i].dataLength, 20, "QRraw.rsblock[%d].dataLength was not as expected. (%d)\n", i, raw->rsblock[i].dataLength);
}
for(i=0; i<raw->blocks; i++) {
assert_equal(raw->rsblock[i].eccLength, 24, "QRraw.rsblock[].eccLength was not as expected.\n");
assert_equal(raw->rsblock[i].eccLength, 24, "QRraw.rsblock[%d].eccLength was not as expected. (%d)\n", i, raw->rsblock[i].eccLength);
}

QRinput_free(stream);
Expand Down

0 comments on commit 6b9b214

Please sign in to comment.