Permalink
Browse files

cleanup

  • Loading branch information...
1 parent b369123 commit f9c3d8f2a3383aaf2d80fa6c4d65695a879f2f9b @prusnak prusnak committed Feb 17, 2012
Showing with 67 additions and 219 deletions.
  1. +21 −22 main.c
  2. +46 −197 qr_encode.c
View
43 main.c
@@ -3,30 +3,29 @@
int main(int argc, char *argv[])
{
- int side, i, j, a;
- unsigned char bitdata[MAX_BITDATA];
+ int side, i, j, a;
+ unsigned char bitdata[MAX_BITDATA];
- if (argc < 2) {
- printf("Pass string as first command line parameter.\n");
- return 1;
- }
+ if (argc < 2) {
+ printf("Pass string as first command line parameter.\n");
+ return 1;
+ }
- side = QREncode(QR_LEVEL_H, 0, argv[1], 0, bitdata);
+ side = QREncode(QR_LEVEL_H, 0, argv[1], 0, bitdata);
- for (i = 0; i < side+2; i++) printf("██");
- printf("\n");
- for (i = 0; i < side; i++)
- {
- printf("██");
- for (j = 0; j< side; j++) {
- a = i*side + j;
- printf((bitdata[a/8] & (1<<(7-a%8))) ? " " : "██");
- }
- printf("██");
- printf("\n");
- }
- for (i = 0; i < side+2; i++) printf("██");
- printf("\n");
+ for (i = 0; i < side+2; i++) printf("██");
+ printf("\n");
+ for (i = 0; i < side; i++) {
+ printf("██");
+ for (j = 0; j< side; j++) {
+ a = i*side + j;
+ printf((bitdata[a/8] & (1<<(7-a%8))) ? " " : "██");
+ }
+ printf("██");
+ printf("\n");
+ }
+ for (i = 0; i < side+2; i++) printf("██");
+ printf("\n");
- return 0;
+ return 0;
}
Oops, something went wrong.

0 comments on commit f9c3d8f

Please sign in to comment.