Changeset 954


Ignore:
Timestamp:
12/26/09 21:21:53 (11 years ago)
Author:
C.H.A.D.o
Message:

Fix compiler warnings

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/cscrypt/des.c

    r64 r954  
     1#include <stdlib.h>
    12#include <stdio.h>
    23#include <string.h>
  • trunk/csctapi/atr.c

    r908 r954  
    2525#include "defines.h"
    2626#include "atr.h"
     27#include "../globals.h"
    2728#include <stdlib.h>
    2829#include <string.h>
  • trunk/globals.h

    r853 r954  
    449449
    450450struct s_acasc_shm {
    451   ushort count : 15;
    452   ushort deny  : 1;
     451  ushort ac_count : 15;
     452  ushort ac_deny  : 1;
    453453};
    454454
     
    711711extern int chk_rsfilter(ECM_REQUEST *, int);
    712712extern int chk_avail_reader(ECM_REQUEST *, struct s_reader *);
     713extern int matching_reader(ECM_REQUEST *, struct s_reader *);
    713714extern void set_signal_handler(int , int , void (*)(int));
    714715extern void cs_log_config(void);
     716extern void cs_resolve(void);
    715717
    716718#ifdef CS_ANTICASC
    717719//extern void start_anticascader(void);
    718720extern void init_ac(void);
    719 extern void ac_init_stat(int);
     721extern void ac_init_stat();
    720722extern int  ac_init_log(char*);
    721723extern void ac_do_stat(void);
     
    747749// oscam-log
    748750extern int  cs_init_log(char *);
     751extern void cs_write_log(char *);
    749752extern void cs_log(char *,...);
    750753extern void cs_debug(char *,...);
     
    764767extern int reader_device_init(char *, int);
    765768extern int reader_checkhealth(void);
     769extern void reader_post_process(void);
    766770extern int reader_ecm(ECM_REQUEST *);
    767771extern int reader_emm(EMM_PACKET *);
  • trunk/oscam-ac.c

    r573 r954  
    2323}
    2424
    25 void ac_init_stat(int i)
     25void ac_init_stat()
    2626{
    2727  memset(ac_stat, 0, sizeof(ac_stat));
     
    5353  {
    5454    idx = ac_stat[i].idx;
    55     ac_stat[i].stat[idx] = acasc[i].count;
    56     acasc[i].count=0;
     55    ac_stat[i].stat[idx] = acasc[i].ac_count;
     56    acasc[i].ac_count=0;
    5757    cl_idx = idx_from_ac_idx(i);
    5858
     
    6666      if( client[cl_idx].ac_penalty==2 ) {// banned
    6767        cs_debug("user '%s' banned", client[cl_idx].usr);
    68         acasc[i].deny=1;
     68        acasc[i].ac_deny=1;
    6969      }
    7070      else
     
    7676          exceeds+=(ac_stat[i].stat[j]>client[cl_idx].ac_limit);
    7777        }
    78         prev_deny=acasc[i].deny;
    79         acasc[i].deny = (exceeds >= cfg->ac_denysamples);
     78        prev_deny=acasc[i].ac_deny;
     79        acasc[i].ac_deny = (exceeds >= cfg->ac_denysamples);
    8080       
    8181        cs_debug("%s limit=%d, max=%d, samples=%d, dsamples=%d, ac[ci=%d][si=%d]:",
     
    8686          ac_stat[i].stat[4], ac_stat[i].stat[5], ac_stat[i].stat[6],
    8787          ac_stat[i].stat[7], ac_stat[i].stat[8], ac_stat[i].stat[9]);
    88         if( acasc[i].deny ) {
     88        if( acasc[i].ac_deny ) {
    8989          cs_log("user '%s' exceeds limit", client[cl_idx].usr);
    9090          ac_stat[i].stat[idx] = 0;
     
    9393      }
    9494    }
    95     else if( acasc[i].deny )
     95    else if( acasc[i].ac_deny )
    9696    {
    9797      prev_deny=1;
    98       acasc[i].deny=0;
     98      acasc[i].ac_deny=0;
    9999      if( cl_idx!=-1 )
    100100        cs_log("restored access for inactive user '%s'", client[cl_idx].usr);
     
    103103    }
    104104
    105     if( !acasc[i].deny && !prev_deny )
     105    if( !acasc[i].ac_deny && !prev_deny )
    106106      ac_stat[i].idx = (ac_stat[i].idx + 1) % cfg->ac_samples;
    107107  }
     
    150150  if( level==1 )
    151151  {
    152     if( er->rc==7 ) acasc[client[cs_idx].ac_idx].count++;
     152    if( er->rc==7 ) acasc[client[cs_idx].ac_idx].ac_count++;
    153153    if( er->rc>3 ) return; // not found
    154154    if( memcmp(ac_ecmd5, er->ecmd5, CS_ECMSTORESIZE) != 0 )
    155155    {
    156       acasc[client[cs_idx].ac_idx].count+=ac_dw_weight(er);
     156      acasc[client[cs_idx].ac_idx].ac_count+=ac_dw_weight(er);
    157157      memcpy(ac_ecmd5, er->ecmd5, CS_ECMSTORESIZE);
    158158    }
     
    160160  }
    161161
    162   if( acasc[client[cs_idx].ac_idx].deny )
     162  if( acasc[client[cs_idx].ac_idx].ac_deny )
    163163    if( client[cs_idx].ac_penalty )
    164164    {
  • trunk/oscam.c

    r835 r954  
    269269}
    270270
    271 static void cs_alarm(int sig)
     271static void cs_alarm()
    272272{
    273273  cs_debug("Got alarm signal");
     
    276276}
    277277
    278 static void cs_master_alarm(int sig)
     278static void cs_master_alarm()
    279279{
    280280  cs_log("PANIC: master deadlock! last location: %s", mloc);
     
    284284}
    285285
    286 static void cs_sigpipe(int sig)
     286static void cs_sigpipe()
    287287{
    288288  if ((cs_idx) && (master_pid!=getppid()))
     
    664664  ecmidx=(int *)&ecmcache[CS_ECMCACHESIZE];
    665665#endif
    666   mcl=(int *)((void *)ecmidx+sizeof(int));
    667   logidx=(int *)((void *)mcl+sizeof(int));
    668   c_start=(int *)((void *)logidx+sizeof(int));
    669   log_fd=(int *)((void *)c_start+sizeof(int));
    670   oscam_sem=(int *)((void *)log_fd+sizeof(int));
    671   client=(struct s_client *)((void *)oscam_sem+sizeof(int));
     666  mcl=(int *)(ecmidx+sizeof(int));
     667  logidx=(int *)(mcl+sizeof(int));
     668  c_start=(int *)(logidx+sizeof(int));
     669  log_fd=(int *)(c_start+sizeof(int));
     670  oscam_sem=(int *)(log_fd+sizeof(int));
     671  client=(struct s_client *)(oscam_sem+sizeof(int));
    672672  reader=(struct s_reader *)&client[CS_MAXPID];
    673673#ifdef CS_WITH_GBOX
     
    680680#endif
    681681#ifdef CS_LOGHISTORY
    682   loghistidx=(int *)((void *)cfg+sizeof(struct s_config));
    683   loghist=(char *)((void *)loghistidx+sizeof(int));
     682  loghistidx=(int *)(cfg+sizeof(struct s_config));
     683  loghist=(char *)(loghistidx+sizeof(int));
    684684#endif
    685685
     
    833833}
    834834
    835 static void cs_client_resolve(void *dummy)
     835static void cs_client_resolve()
    836836{
    837837  while (1)
     
    921921      {
    922922        case PIP_ID_LOG:
    923           cs_write_log(ptr);
     923          cs_write_log((char *)ptr);
    924924          break;
    925925      }
     
    964964  set_signal_handler(SIGHUP, 1, ac_init_stat);
    965965 
    966   ac_init_stat(0);
     966  ac_init_stat();
    967967  while(1)
    968968  {
     
    18421842      if ((er->caid==ttab->bt_caidfrom[n]) && ((er->srvid==ttab->bt_srvid[n]) || (ttab->bt_srvid[n])==mask_all))
    18431843      {
    1844         char hack_n3[13]={0x70, 0x51, 0xc7, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x87, 0x12, 0x07};
    1845         char hack_n2[13]={0x70, 0x51, 0xc9, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x48, 0x12, 0x07};
     1844        uchar hack_n3[13]={0x70, 0x51, 0xc7, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x87, 0x12, 0x07};
     1845        uchar hack_n2[13]={0x70, 0x51, 0xc9, 0x00, 0x00, 0x00, 0x01, 0x10, 0x10, 0x00, 0x48, 0x12, 0x07};
    18461846        er->caid=ttab->bt_caidto[n];
    18471847        er->prid=0;
     
    21102110  {
    21112111    case PIP_ID_LOG:
    2112       cs_write_log(ptr);
     2112      cs_write_log((char *)ptr);
    21132113      break;
    21142114    case PIP_ID_HUP:
Note: See TracChangeset for help on using the changeset viewer.