Advertisement
Guest User

Untitled

a guest
Dec 5th, 2014
1,199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.81 KB | None | 0 0
  1. diff -r d0d940cdc8e2 -r dd57dce3529a r0/r.cpp
  2. --- a/r0/r.cpp  Sat Dec 06 00:20:57 2014 +0900
  3. +++ b/r0/r.cpp  Sat Dec 06 02:44:57 2014 +0900
  4. @@ -181,11 +181,12 @@
  5.         uint64_t total_ave = 0;
  6.  
  7.         for (int j = 0; j < TRANS_NUM; j++) {
  8. +       retry:
  9.             LONG res = card.transmit(command, commandlen);
  10.             if (res != SCARD_S_SUCCESS) {
  11.                 std::fprintf(stderr, "retry: SCardTransmit(): %d\n", i);
  12.                 milliSleep(10);
  13. -               continue;
  14. +               goto retry;
  15.             }
  16.  //         std::fprintf(stderr, "%4u: %"PRIu64"\n", j, card.elapsed());
  17.             total_ave += card.elapsed();
  18. @@ -242,7 +243,7 @@
  19.  static void number2code(char *out, uint32_t x)
  20.  {
  21.     static const char tbl[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  22. -   const int n = sizeof(tbl);
  23. +   const int n = sizeof(tbl) - 1;
  24.     int i = 0;
  25.     while (x) {
  26.         out[i++] = tbl[x % n];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement