Changeset 950


Ignore:
Timestamp:
05/25/07 11:52:54 (5 years ago)
Author:
aj
Message:

work on lots of warnings, mostly things once declared with static and later without.

Location:
trunk/src/ifd
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ifd/ifd-acr30u.c

    r927 r950  
    523523 * Set the card's baud rate etc 
    524524 */ 
    525 int acr_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) 
     525static int acr_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) 
    526526{ 
    527527        return 0; 
  • trunk/src/ifd/ifd-cardman.c

    r927 r950  
    332332 * Set the card's baud rate etc 
    333333 */ 
    334 int cm_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) 
     334static int cm_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) 
    335335{ 
    336336        return ifd_usb_control(dev, 0x42, 0x30, baudrate << 8, 2, NULL, 0, -1); 
     
    341341 * Interrupt URBs. 
    342342 */ 
    343 int cm_usb_int(ifd_device_t * dev, int requesttype, int request, int value, 
    344                int idx, const void *sbuf, size_t slen, void *rbuf, 
     343static int cm_usb_int(ifd_device_t * dev, int requesttype, int request, 
     344               int value, int idx, const void *sbuf, size_t slen, void *rbuf, 
    345345               size_t rlen, complete_fn_t complete, long timeout) 
    346346{ 
  • trunk/src/ifd/ifd-etoken64.c

    r891 r950  
    100100        if (ifd_usb_control(dev, 0x40, 0x08, 0, 0, NULL, 0, -1) < 0 
    101101            || ifd_usb_control(dev, 0xc0, 0x88, 0, 0, buffer, 02, -1) != 02 
    102             || ifd_usb_control(dev, 0x40, 0x03, 0, 0, 0, 0, -1) < 0 
     102            || ifd_usb_control(dev, 0x40, 0x03, 0, 0, NULL, 0, -1) < 0 
    103103            || ifd_usb_control(dev, 0xc0, 0x83, 0, 0, buffer, 1, -1) != 1 
    104104            || buffer[0] != 0) 
  • trunk/src/ifd/ifd-gempc.c

    r683 r950  
    343343 * Set Reader mode 
    344344 */ 
    345 int gpc_set_mode(ifd_reader_t * reader, int mode) 
     345static int gpc_set_mode(ifd_reader_t * reader, int mode) 
    346346{ 
    347347        unsigned char cmd[] = { 0x01, 0x00, 0x00 }; 
     
    662662 * Get the OS version 
    663663 */ 
    664 int gpc_get_os_version(ifd_reader_t * reader, char *buf, size_t len) 
     664static int gpc_get_os_version(ifd_reader_t * reader, char *buf, size_t len) 
    665665{ 
    666666        static unsigned char cmd[] = { 0x22, 0x05, 0x3F, 0xE0, 0x10 }; 
     
    674674 * Helper functions 
    675675 */ 
    676 int __gpc_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
    677                   void *res, size_t res_len, int *gpc_status) 
     676static int __gpc_command(ifd_reader_t * reader, const void *cmd, 
     677                  size_t cmd_len, void *res, size_t res_len, int *gpc_status) 
    678678{ 
    679679        gpc_status_t *st = (gpc_status_t *) reader->driver_data; 
     
    720720} 
    721721 
    722 int gpc_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
     722static int gpc_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
    723723                void *res, size_t res_len) 
    724724{ 
  • trunk/src/ifd/ifd-kaan.c

    r929 r950  
    209209 * Reset the card reader 
    210210 */ 
    211 int kaan_reset_ct(ifd_reader_t * reader) 
     211static int kaan_reset_ct(ifd_reader_t * reader) 
    212212{ 
    213213        unsigned char cmd1[] = { 0x20, 0x10, 0x00, 0x00 }; 
     
    397397 * Send the Freeze command to the reader 
    398398 */ 
    399 int kaan_freeze(ifd_reader_t * reader) 
     399static int kaan_freeze(ifd_reader_t * reader) 
    400400{ 
    401401        unsigned char freeze[16] = { 0x80, 0x70, 0x00, 0x00, 0x00, 0x30, 00 }; 
     
    803803 * Read from config/status file 
    804804 */ 
    805 int kaan_get_tlv_from_file(ifd_reader_t * reader, unsigned int df_id, 
     805static int kaan_get_tlv_from_file(ifd_reader_t * reader, unsigned int df_id, 
    806806                           unsigned int ef_id, unsigned char tag, 
    807807                           unsigned char *data, size_t len) 
     
    831831 * Stuff to interface with the Kaan's internal file system 
    832832 */ 
    833 int kaan_select_file(ifd_reader_t * reader, unsigned char nad, unsigned int fid, 
    834                      size_t * sizep) 
     833static int kaan_select_file(ifd_reader_t * reader, unsigned char nad, 
     834                     unsigned int fid, size_t * sizep) 
    835835{ 
    836836        unsigned char cmd[] = { 0x00, 0xa4, 0x00, 0x00, 2, 0x00, 0x00 }; 
     
    855855} 
    856856 
    857 int kaan_select_app(ifd_reader_t * reader, int nad, const void *aid, size_t len) 
     857static int kaan_select_app(ifd_reader_t * reader, int nad, const void *aid, 
     858                                size_t len) 
    858859{ 
    859860        unsigned char cmd[32] = { 0x00, 0xa4, 0x04, 0x00 }; 
     
    873874} 
    874875 
    875 int kaan_read_binary(ifd_reader_t * reader, unsigned char nad, 
     876static int kaan_read_binary(ifd_reader_t * reader, unsigned char nad, 
    876877                     unsigned int offset, unsigned char *data, size_t len) 
    877878{ 
     
    923924} 
    924925 
    925 int kaan_update_binary(ifd_reader_t * reader, unsigned char nad, 
     926static int kaan_update_binary(ifd_reader_t * reader, unsigned char nad, 
    926927                       unsigned int offset, const unsigned char *data, 
    927928                       size_t len) 
     
    961962 * APDU exchange with terminal 
    962963 */ 
    963 int __kaan_apdu_xcv(ifd_reader_t * reader, const unsigned char *sbuf, 
     964static int __kaan_apdu_xcv(ifd_reader_t * reader, const unsigned char *sbuf, 
    964965                    size_t slen, unsigned char *rbuf, size_t rlen, 
    965966                    time_t timeout, int activity) 
     
    10041005 * Check status word returned by Kaan 
    10051006 */ 
    1006 int kaan_check_sw(const char *msg, const unsigned char *buf, int rc) 
     1007static int kaan_check_sw(const char *msg, const unsigned char *buf, int rc) 
    10071008{ 
    10081009        unsigned short sw; 
     
    10191020} 
    10201021 
    1021 int kaan_get_sw(const unsigned char *buf, unsigned int n, unsigned short *sw) 
     1022static int kaan_get_sw(const unsigned char *buf, unsigned int n, 
     1023                                unsigned short *sw) 
    10221024{ 
    10231025        if (n < 2) { 
     
    10521054 * A value of 255 means a big endian two byte length value follows. 
    10531055 */ 
    1054 int kaan_get_tlv(unsigned char *buf, size_t len, unsigned char tag, 
     1056static int kaan_get_tlv(unsigned char *buf, size_t len, unsigned char tag, 
    10551057                 unsigned char **res) 
    10561058{ 
  • trunk/src/ifd/ifd-pertosmart1030.c

    r821 r950  
    537537} 
    538538 
    539 unsigned char ps_checksum(unsigned char iv, 
     539static unsigned char ps_checksum(unsigned char iv, 
    540540                          const unsigned char *buf, size_t len) 
    541541{ 
  • trunk/src/ifd/ifd-smartboard.c

    r667 r950  
    109109 * Reset the card reader 
    110110 */ 
    111 int smartboard_reset_ct(ifd_reader_t * reader) 
     111static int smartboard_reset_ct(ifd_reader_t * reader) 
    112112{ 
    113113        unsigned char buffer[128], code; 
     
    336336} 
    337337 
    338 int smartboard_command(ifd_reader_t * reader, unsigned char cmd, 
     338static int smartboard_command(ifd_reader_t * reader, unsigned char cmd, 
    339339                       const unsigned char *arg, size_t arg_len, 
    340340                       unsigned char *code, void *res, size_t res_len) 
  • trunk/src/ifd/ifd-smph.c

    r803 r950  
    2222#define PHS_CONV_INDIRECT 1 
    2323#define TIMEOUT 1000 
    24  
    25 extern int errno; 
    2624 
    2725/* table for indirect to direct byte mode conversion */ 
  • trunk/src/ifd/ifd-towitoko.c

    r775 r950  
    1414static int twt_command(ifd_reader_t *, const void *, size_t, void *, size_t); 
    1515static int twt_recv_checksum(const unsigned char *, size_t); 
    16 static unsigned int twt_send_checksum(unsigned char *, size_t); 
     16static size_t twt_send_checksum(unsigned char *, size_t); 
    1717 
    1818enum { 
     
    208208} 
    209209 
    210 int twt_try_reset(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
     210static int twt_try_reset(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
    211211                  void *atr, size_t atr_len) 
    212212{ 
     
    463463} 
    464464 
    465 int twt_sync_read(ifd_reader_t * reader, int slot, int proto, 
     465static int twt_sync_read(ifd_reader_t * reader, int slot, int proto, 
    466466                  unsigned short addr, unsigned char *buffer, size_t len) 
    467467{ 
     
    583583} 
    584584 
    585 int twt_sync_write(ifd_reader_t * reader, int slot, int proto, 
     585static int twt_sync_write(ifd_reader_t * reader, int slot, int proto, 
    586586                   unsigned short addr, const unsigned char *buffer, size_t len) 
    587587{ 
     
    597597 * Turn LED on/off 
    598598 */ 
    599 int twt_led(ifd_reader_t * reader, int what) 
     599static int twt_led(ifd_reader_t * reader, int what) 
    600600{ 
    601601        unsigned char cmd[] = { 0x6F, 0x00, 0x6A, 0x0F }; 
     
    608608 * Helper functions 
    609609 */ 
    610 int twt_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
     610static int twt_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, 
    611611                void *res, size_t res_len) 
    612612{ 
     
    657657} 
    658658 
    659 int twt_recv_checksum(const unsigned char *data, size_t len) 
     659static int twt_recv_checksum(const unsigned char *data, size_t len) 
    660660{ 
    661661        if (len == 0) 
     
    665665} 
    666666 
    667 unsigned int twt_send_checksum(unsigned char *data, size_t len) 
     667static size_t twt_send_checksum(unsigned char *data, size_t len) 
    668668{ 
    669669        data[len] = twt_checksum(0x00, data, len); 
  • trunk/src/ifd/ifd-wbeiuu.c

    r934 r950  
    2727} wbeiuu_status_t; 
    2828 
    29 wbeiuu_status_t wbeiuu_status; 
     29static wbeiuu_status_t wbeiuu_status; 
    3030 
    3131// PENDING:  
     
    6868                          uint16_t B, uint8_t F) 
    6969{ 
    70         const int BUFSIZE = 8; 
     70#define BUFSIZE 8 
    7171        int status; 
    7272        uint8_t buf[BUFSIZE]; 
     
    8888 
    8989        return status; 
     90#undef BUFSIZE 
    9091} 
    9192 
  • trunk/src/ifd/proto-gbp.c

    r774 r950  
    341341} 
    342342 
    343 unsigned int gbp_build(gbp_state_t * gp, unsigned char *block, 
     343static unsigned int gbp_build(gbp_state_t * gp, unsigned char *block, 
    344344                       unsigned char pcb, ct_buf_t * bp) 
    345345{ 
     
    388388 * Build/verify checksum 
    389389 */ 
    390 unsigned int gbp_compute_checksum(gbp_state_t * gp, unsigned char *data, 
     390static unsigned int gbp_compute_checksum(gbp_state_t * gp, unsigned char *data, 
    391391                                  size_t len) 
    392392{ 
     
    395395} 
    396396 
    397 int gbp_verify_checksum(gbp_state_t * gp, unsigned char *rbuf, size_t len) 
     397static int gbp_verify_checksum(gbp_state_t * gp, unsigned char *rbuf, size_t len) 
    398398{ 
    399399        unsigned char csum; 
     
    406406 * Send/receive block 
    407407 */ 
    408 int gbp_xcv(gbp_state_t * gp, unsigned char *block, size_t slen, size_t rmax) 
     408static int gbp_xcv(gbp_state_t * gp, unsigned char *block, size_t slen, size_t rmax) 
    409409{ 
    410410        ifd_protocol_t *prot = &gp->base; 
  • trunk/src/ifd/proto-sync.c

    r774 r950  
    105105 
    106106        if (ifd_deactivate(reader) < 0 || ifd_activate(reader) < 0) 
    107                 return 0; 
     107                return NULL; 
    108108 
    109109        if (!(p = ifd_protocol_new(proto, reader, slot))) 
    110                 return 0; 
     110                return NULL; 
    111111 
    112112        if (ifd_protocol_read_memory(p, slot, 0, &byte, 1) != 1) 
  • trunk/src/ifd/proto-t0.c

    r663 r950  
    290290} 
    291291 
    292 int t0_send(ifd_protocol_t * prot, ct_buf_t * bp, int count) 
     292static int t0_send(ifd_protocol_t * prot, ct_buf_t * bp, int count) 
    293293{ 
    294294        int n, avail; 
     
    305305} 
    306306 
    307 int t0_recv(ifd_protocol_t * prot, ct_buf_t * bp, int count, long timeout) 
     307static int t0_recv(ifd_protocol_t * prot, ct_buf_t * bp, int count, long timeout) 
    308308{ 
    309309        int n; 
     
    317317} 
    318318 
    319 int t0_resynch(t0_state_t * t0) 
     319static int t0_resynch(t0_state_t * t0) 
    320320{ 
    321321        return -1; 
  • trunk/src/ifd/proto-t1.c

    r826 r950  
    9090} 
    9191 
    92 void t1_set_checksum(t1_state_t * t1, int csum) 
     92static void t1_set_checksum(t1_state_t * t1, int csum) 
    9393{ 
    9494        switch (csum) { 
     
    440440} 
    441441 
    442 unsigned int 
    443 t1_build(t1_state_t * t1, unsigned char *block, 
     442static unsigned int t1_build(t1_state_t * t1, unsigned char *block, 
    444443         unsigned char dad, unsigned char pcb, ct_buf_t * bp, size_t * lenp) 
    445444{ 
     
    494493 * Build/verify checksum 
    495494 */ 
    496 unsigned int t1_compute_checksum(t1_state_t * t1, unsigned char *data, 
     495static unsigned int t1_compute_checksum(t1_state_t * t1, unsigned char *data, 
    497496                                 size_t len) 
    498497{ 
     
    500499} 
    501500 
    502 int t1_verify_checksum(t1_state_t * t1, unsigned char *rbuf, size_t len) 
     501static int t1_verify_checksum(t1_state_t * t1, unsigned char *rbuf, size_t len) 
    503502{ 
    504503        unsigned char csum[2]; 
     
    521520 * Send/receive block 
    522521 */ 
    523 int t1_xcv(t1_state_t * t1, unsigned char *block, size_t slen, size_t rmax) 
     522static int t1_xcv(t1_state_t * t1, unsigned char *block, size_t slen, size_t rmax) 
    524523{ 
    525524        ifd_protocol_t *prot = &t1->base; 
  • trunk/src/ifd/reader.c

    r949 r950  
    1010#include <signal.h> 
    1111#include <time.h> 
    12 #include <openct/driver.h> 
    1312 
    1413static int ifd_recv_atr(ifd_device_t *, ct_buf_t *, unsigned int, int); 
     
    8079} 
    8180 
     81#if 0 
    8282/* 
    8383 * Set the serial speed at which we communicate with the 
     
    9595        return rc; 
    9696} 
     97#endif 
    9798 
    9899/* 
     
    340341} 
    341342 
    342 int ifd_recv_atr(ifd_device_t * dev, ct_buf_t * bp, unsigned int count, 
     343static int ifd_recv_atr(ifd_device_t * dev, ct_buf_t * bp, unsigned int count, 
    343344                 int revert_bits) 
    344345{ 
  • trunk/src/ifd/ria.c

    r851 r950  
    100100} 
    101101 
    102 int ria_recv(ria_client_t * clnt, unsigned char expect, uint32_t xid, 
     102static int ria_recv(ria_client_t * clnt, unsigned char expect, uint32_t xid, 
    103103             void *res_buf, size_t res_len, long timeout) 
    104104{ 
     
    186186} 
    187187 
    188 int ria_claim_device(ria_client_t * clnt, const char *name, ria_device_t * info) 
     188static int ria_claim_device(ria_client_t * clnt, const char *name, ria_device_t * info) 
    189189{ 
    190190        return ria_command(clnt, RIA_MGR_CLAIM, name, strlen(name), 
  • trunk/src/ifd/serial.c

    r893 r950  
    480480}; 
    481481 
    482 unsigned int speed_to_termios(unsigned int speed) 
     482static unsigned int speed_to_termios(unsigned int speed) 
    483483{ 
    484484        unsigned int n; 
     
    492492} 
    493493 
    494 unsigned int termios_to_speed(unsigned int bits) 
     494static unsigned int termios_to_speed(unsigned int bits) 
    495495{ 
    496496        unsigned int n; 
  • trunk/src/ifd/usb-descriptors.c

    r942 r950  
    248248} 
    249249 
    250 int ifd_usb_parse_configuration(struct ifd_usb_config_descriptor *config, 
     250static int ifd_usb_parse_configuration(struct ifd_usb_config_descriptor *config, 
    251251                                unsigned char *buffer) 
    252252{ 
Note: See TracChangeset for help on using the changeset viewer.