Ignore:
Timestamp:
05/12/09 05:25:27 (12 years ago)
Author:
rorothetroll
Message:

csctapi/io_serial.c : fix the serial port read/write wait routine to use select instead of poll

This make them compatible with Mac OS X and now oscamd works on OS X. The same code off course
still works on linux and other unix platforms. I let that code ran for 24h before commiting this code.
If you have any issue let me know and I'llr evert to poll for non compatible machines.

all the others : fix all the warning due to sign difference (mostly uchar versus char). This make the code compile

with -Werror on the more strict version of gcc (which is the case on OS X). I also noticed that in a lot of places
the code use a buffer defined as an uchar * ... and use strings functions (strnXXXX) where some memcpy/memcmp .. function
would have been preferable as we're suposedly manipulation a binary buffer. Anyway I fixed all of them and it now compile
without any warning or error on linux and OS X (and also probably on all the other unices but we will have to try before
adding -Werror on the other platform).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-cryptoworks.c

    r39 r70  
    242242    uchar keybuf[256];
    243243    BIGNUM *ipk;
    244     if (search_boxkey(reader[ridx].caid[0], 0, keybuf))
     244    if (search_boxkey(reader[ridx].caid[0], 0, (char *)keybuf))
    245245    {
    246246      ipk=BN_new();
     
    271271  if (read_record(0xC0)>=16)
    272272  {
    273     strncpy(issuer, cta_res+2, sizeof(issuer)-1);
     273    strncpy(issuer, (const char *)cta_res+2, sizeof(issuer)-1);
    274274    trim(issuer);
    275275  }
     
    282282  {
    283283    cta_res[6]=0;
    284     pin=cta_res+2;
     284    pin=(char *)cta_res+2;
    285285  }
    286286  cs_ri_log("issuer: %s, id: %02X, bios: v%d, pin: %s, mfid: %04X", issuer, issuerid, atr[7], pin, mfid);
     
    578578    if (read_record(0xD6)>=16)
    579579    {
    580       strncpy(l_name+8, cta_res+2, sizeof(l_name)-9);
     580      strncpy(l_name+8, (const char *)cta_res+2, sizeof(l_name)-9);
    581581      l_name[sizeof(l_name)]=0;
    582582      trim(l_name+8);
     
    598598          chid_date(cta_res+30, de, sizeof(de)-1);
    599599          cs_ri_log("chid: %02X%02X, date: %s - %s, name: %s",
    600                     cta_res[6], cta_res[7], ds, de, trim(cta_res+10));
     600                    cta_res[6], cta_res[7], ds, de, trim((char *) cta_res+10));
    601601        }
    602602      }
     
    619619          cta_res[27]=0;
    620620          cs_ri_log("chid: %02X%02X, date: %s - %s, name: %s",
    621                     cta_res[6], cta_res[7], ds, de, trim(cta_res+10));
     621                    cta_res[6], cta_res[7], ds, de, trim((char *)cta_res+10));
    622622        }
    623623      }
Note: See TracChangeset for help on using the changeset viewer.