Changeset 70 for trunk/oscam-config.c


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/oscam-config.c

    r57 r70  
    443443  if (!strcmp(token, "password")) cs_atob(cfg->gbox_pwd, value, 4);
    444444  if (!strcmp(token, "maxdist")) cfg->maxdist=atoi(value);
    445   if (!strcmp(token, "ignorelist")) strncpy(cfg->ignorefile, value, sizeof(cfg->ignorefile)-1);
    446   if (!strcmp(token, "onlineinfos")) strncpy(cfg->gbxShareOnl, value, sizeof(cfg->gbxShareOnl)-1);
    447   if (!strcmp(token, "cardinfos")) strncpy(cfg->cardfile, value, sizeof(cfg->cardfile)-1);
     445  if (!strcmp(token, "ignorelist")) strncpy((char *)cfg->ignorefile, value, sizeof(cfg->ignorefile)-1);
     446  if (!strcmp(token, "onlineinfos")) strncpy((char *)cfg->gbxShareOnl, value, sizeof(cfg->gbxShareOnl)-1);
     447  if (!strcmp(token, "cardinfos")) strncpy((char *)cfg->cardfile, value, sizeof(cfg->cardfile)-1);
    448448  if (!strcmp(token, "locals"))
    449449  {
     
    530530      if (word_atob(trim(c_caid))!=caid) continue;
    531531      if ((i=(strlen(trim(c_key))>>1))>256) continue;
    532       if (cs_atob(key, c_key, i)<0)
     532      if (cs_atob((uchar *)key, c_key, i)<0)
    533533      {
    534534        cs_log("wrong key in \"%s\"", cs_cert);
     
    635635  if (!strcmp(token, "user")) strncpy(account->usr, value, sizeof(account->usr)-1);
    636636  if (!strcmp(token, "pwd")) strncpy(account->pwd, value, sizeof(account->pwd)-1);
    637   if (!strcmp(token, "hostname")) strncpy(account->dyndns, value, sizeof(account->dyndns)-1);
     637  if (!strcmp(token, "hostname")) strncpy((char *)account->dyndns, value, sizeof(account->dyndns)-1);
    638638  if (!strcmp(token, "betatunnel")) chk_tuntab(value, &account->ttab);
    639639  if (!strcmp(token, "uniq")) account->uniq=atoi(value);
     
    939939    }
    940940  }
    941   if (!strcmp(token, "password")) strncpy(rdr->gbox_pwd, i2b(4, a2i(value, 4)), 4);
     941  if (!strcmp(token, "password")) strncpy((char *)rdr->gbox_pwd, (const char *)i2b(4, a2i(value, 4)), 4);
    942942  if (!strcmp(token, "premium")) rdr->gbox_prem=1;
    943943  if (!strcmp(token, "account"))
Note: See TracChangeset for help on using the changeset viewer.