Changeset 1450


Ignore:
Timestamp:
10/15/09 18:46:08 (4 years ago)
Author:
perry
Message:

Tidy up thousands of little warnings

Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/libtrace_int.h

    r1444 r1450  
    214214        uint16_t hatype;                /* link-layer address type */ 
    215215        uint16_t halen;                 /* link-layer address length */ 
    216         char addr[8];                   /* link-layer address */ 
     216        unsigned char addr[8];          /* link-layer address */ 
    217217        uint16_t protocol;              /* protocol */ 
    218218} libtrace_sll_header_t; 
  • trunk/libpacketdump/bitbuffer.c

    r1351 r1450  
    4949    return ret; 
    5050} 
     51 
     52int yyparse(void); 
    5153 
    5254element_t* parse_protocol_file(char *filename) 
     
    109111 
    110112 
    111 void decode_protocol_file(uint16_t link_type,const char *packet,int len,element_t *el) 
     113void decode_protocol_file(uint16_t link_type UNUSED,const char *packet,int len,element_t *el) 
    112114{ 
    113115    bitbuffer_t result; 
     
    134136                                 
    135137                        el->data->field->value = result; 
    136                         printf(" %s %lld\n",  
     138                        printf(" %s %" PRIi64 "\n",  
    137139                                el->data->field->identifier, 
    138140                                result); 
     
    151153                         
    152154                        el->data->field->value = result; 
    153                         printf(" %s 0x%llx\n",  
     155                        printf(" %s 0x%" PRIx64 "\n",  
    154156                                el->data->field->identifier, 
    155157                                result); 
  • trunk/libpacketdump/eth_2048.c

    r1351 r1450  
    2121#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&ip->x)) 
    2222 
    23 void decode(int link_type,const char *packet,unsigned len) 
     23void decode(int link_type UNUSED,const char *packet,unsigned len) 
    2424{ 
    2525        libtrace_ip_t *ip = (libtrace_ip_t*)packet; 
  • trunk/libpacketdump/eth_2054.c

    r1351 r1450  
    2020 * attempt to decode. 
    2121 */ 
    22 static char *format_hrd(struct arphdr *arp, char *hrd) { 
     22static char *format_hrd(const struct arphdr *arp, const char *hrd) { 
    2323        static char buffer[1024] = {0,}; 
    2424        int i; 
     
    3131        switch(ntohs(arp->ar_hrd)) { 
    3232                case ARPHRD_ETHER: 
    33                         trace_ether_ntoa(hrd, buffer); 
     33                        trace_ether_ntoa((const unsigned char *)hrd, buffer); 
    3434                        break; 
    3535                default: 
     
    5050 * attempt to decode. 
    5151 */ 
    52 static char *format_pro(struct arphdr *arp, char *pro) { 
     52static char *format_pro(const struct arphdr *arp, const char *pro) { 
    5353        static char buffer[1024] = {0,}; 
    5454        int i; 
     
    7777} 
    7878         
    79 void decode(int link_type,const char *packet,unsigned len) 
     79void decode(int link_type UNUSED,const char *packet,unsigned len) 
    8080{ 
    8181        struct arphdr *arp = (struct arphdr*)packet; 
    82         char *source_hrd = NULL; 
    83         char *source_pro = NULL; 
    84         char *dest_hrd = NULL; 
    85         char *dest_pro = NULL; 
     82        const char *source_hrd = NULL; 
     83        const char *source_pro = NULL; 
     84        const char *dest_hrd = NULL; 
     85        const char *dest_pro = NULL; 
    8686 
    8787        if (len < sizeof(struct arphdr)) { 
  • trunk/libpacketdump/eth_33024.c

    r1363 r1450  
    2222        } while(0) 
    2323 
    24 void decode(int link_type,const char *packet,unsigned len) 
     24void decode(int link_type UNUSED,const char *packet,unsigned len) 
    2525{ 
    26         int offset=0; 
     26        unsigned int offset=0; 
    2727        int value; 
    2828        uint16_t ethertype; 
  • trunk/libpacketdump/eth_34887.c

    r1359 r1450  
    2222        } while(0) 
    2323 
    24 void decode(int link_type,const char *packet,unsigned len) 
     24void decode(int link_type UNUSED,const char *packet,unsigned len) 
    2525{ 
    26         int offset=0; 
     26        unsigned int offset=0; 
    2727        int value; 
    2828        int more = 0; 
  • trunk/libpacketdump/eth_34916.c

    r1360 r1450  
    1515} pppoe_t; 
    1616 
    17 void decode(int link_type,const char *pkt,unsigned len)  
     17void decode(int link_type UNUSED,const char *pkt,unsigned len)  
    1818{ 
    1919        pppoe_t *pppoe = (pppoe_t *) pkt; 
  • trunk/libpacketdump/eth_34958.c

    r1351 r1450  
    1515                } while(0) 
    1616 
    17 static void decode_eap_request(char *packet, unsigned len) 
     17static void decode_eap_request(const char *packet, unsigned len) 
    1818{ 
    1919        int v; 
     
    3434} 
    3535 
    36 static void decode_eap(char *packet, unsigned len) 
     36static void decode_eap(const char *packet, unsigned len) 
    3737{ 
    3838        int v; 
     
    5454} 
    5555 
    56 static void decode_eapol_start(char *packet, unsigned len) 
     56static void decode_eapol_start(const char *packet, unsigned len) 
    5757{ 
    5858        int v; 
     
    6161} 
    6262 
    63 static void decode_eapol_logoff(char *packet, unsigned len) 
     63static void decode_eapol_logoff(const char *packet, unsigned len) 
    6464{ 
    6565        int v; 
     
    7777}; 
    7878 
    79 static void decode_eapol_key(char *packet, unsigned len) 
     79static void decode_eapol_key(const char *packet, unsigned len) 
    8080{ 
    8181        int v; 
     
    8484} 
    8585 
    86 static void decode_eapol_encapsulated_asf_alert(char *packet, unsigned len) 
     86static void decode_eapol_encapsulated_asf_alert(const char *packet, unsigned len) 
    8787{ 
    8888        int v; 
     
    9191} 
    9292 
    93 void decode(int link_type,const char *packet,unsigned len) 
     93void decode(int link_type UNUSED,const char *packet,unsigned len) 
    9494{ 
    95         int offset; 
    9695        int v; 
    9796        int type; 
  • trunk/libpacketdump/ip_1.c

    r1351 r1450  
    3939}; 
    4040 
    41 void decode(int link_type,const char *packet,unsigned len) 
     41void decode(int link_type UNUSED,const char *packet,unsigned len) 
    4242{ 
    4343        libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet; 
  • trunk/libpacketdump/ip_132.c

    r1351 r1450  
    151151} 
    152152 
    153 void decode(int link_type,const char *packet,unsigned len) 
     153void decode(int link_type UNUSED,const char *packet,unsigned len) 
    154154{ 
    155155    struct sctp_common_hdr *hdr; 
  • trunk/libpacketdump/ip_17.c

    r1351 r1450  
    2525 
    2626 
    27 void decode(int link_type,const char *packet,unsigned len) 
     27void decode(int link_type UNUSED,const char *packet,unsigned len) 
    2828{ 
    2929        struct libtrace_udp *udp = (struct libtrace_udp*)packet; 
  • trunk/libpacketdump/ip_33.c

    r1351 r1450  
    4747        }; 
    4848 
    49 void decode(int link_type,const char *packet,unsigned len) 
     49void decode(int link_type UNUSED,const char *packet,unsigned len) 
    5050{ 
    5151        struct dccphdr *dccp = (struct dccphdr*)packet; 
  • trunk/libpacketdump/ip_47.c

    r1368 r1450  
    1111} gre_t; 
    1212 
    13 void decode(int link_type,const char *packet,unsigned len) 
     13void decode(int link_type UNUSED,const char *packet,unsigned len) 
    1414{ 
    1515        // GRE 
  • trunk/libpacketdump/ip_6.c

    r1351 r1450  
    2020#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x)) 
    2121 
    22 void decode(int link_type,const char *packet,unsigned len) 
     22void decode(int link_type UNUSED,const char *packet,unsigned len) 
    2323{ 
    2424        unsigned char *pkt = NULL; 
  • trunk/libpacketdump/link_0.c

    r1351 r1450  
    66#include "libpacketdump.h" 
    77 
    8 void decode(int link_type,const char *packet,unsigned len) 
     8void decode(int link_type UNUSED,const char *packet,unsigned len) 
    99{ 
    1010        printf(" Legacy PoS:"); 
  • trunk/libpacketdump/link_10.c

    r1351 r1450  
    55#include "libtrace.h" 
    66 
    7 void decode(int link_type,const char *packet,unsigned len) 
     7void decode(int link_type UNUSED,const char *packet,unsigned len) 
    88{ 
    99        // ATM 
  • trunk/libpacketdump/link_11.c

    r1351 r1450  
    44#include "libpacketdump.h" 
    55 
    6 void decode(int link_type,const char *packet,unsigned len) 
     6void decode(int link_type UNUSED,const char *packet,unsigned len) 
    77{ 
    88        // Ethernet - just raw ethernet frames 
  • trunk/libpacketdump/link_15.c

    r1351 r1450  
    1616        while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;}  
    1717 
    18 void decode(int link_type,const char *packet,unsigned len) 
     18void decode(int link_type UNUSED,const char *packet,unsigned len) 
    1919{ 
    2020        uint32_t *ptr;  
     
    5555 
    5656        if (rtap->it_present & (1 << TRACE_RADIOTAP_TSFT)) { 
    57                 printf(" Radiotap: TSFT = %llu microseconds\n", bswap_le_to_host64(*((uint64_t *)p))); 
     57                printf(" Radiotap: TSFT = %" PRIu64 " microseconds\n", bswap_le_to_host64(*((uint64_t *)p))); 
    5858                p += sizeof (uint64_t); 
    5959                rtap_real_len += sizeof (uint64_t); 
  • trunk/libpacketdump/link_2.c

    r1351 r1450  
    77#include "libpacketdump.h" 
    88 
    9 void decode(int link_type,const char *packet,unsigned len) 
     9void decode(int link_type UNUSED,const char *packet,unsigned len) 
    1010{ 
    1111        char ether_buf[18] = {0, }; 
  • trunk/libpacketdump/link_4.c

    r1351 r1450  
    2525#include <netinet/in.h> 
    2626#include <stdio.h> 
     27#include <inttypes.h> 
    2728#include "libpacketdump.h" 
    2829#include "libtrace.h" 
     
    194195        ieee80211_ie *ie; 
    195196        int i = 0; 
    196         uint8_t * data; 
     197        const uint8_t * data; 
    197198        uint8_t bmap_offset; 
    198199        while (len >= sizeof(ieee80211_ie)) { 
     
    204205                } 
    205206                 
    206                 data = (( char *)pkt + sizeof (ieee80211_ie)); 
     207                data = (( const unsigned char *)pkt + sizeof (ieee80211_ie)); 
    207208                 
    208209                switch (ie->id) { 
     
    432433        } 
    433434         
    434         printf(" 802.11MAC: Timestamp = %llu\n", b->ts); 
     435        printf(" 802.11MAC: Timestamp = %" PRIu64 "\n", b->ts); 
    435436        printf(" 802.11MAC: Beacon Interval = %u\n", b->interval); 
    436437        decode_80211_capinfo(&b->capinfo); 
     
    499500static void decode_80211_mgmt(const char *pkt, unsigned len) { 
    500501        ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt; 
    501         uint8_t *data; 
     502        const char *data; 
    502503         
    503504        printf(" 802.11MAC: Management frame: "); 
     
    557558                        break; 
    558559                case 10: 
    559                         data = ((char *)pkt + sizeof(ieee80211_mgmt_frame)); 
     560                        data = (pkt + sizeof(ieee80211_mgmt_frame)); 
    560561                        printf(" 802.11MAC: Reason Code = "); 
    561562                        ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1]))); 
     
    567568                        break; 
    568569                case 12: 
    569                         data = ((char *)pkt + sizeof(ieee80211_mgmt_frame)); 
     570                        data = (pkt + sizeof(ieee80211_mgmt_frame)); 
    570571                        printf(" 802.11MAC: Reason Code = "); 
    571572                        ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1]))); 
     
    747748} 
    748749 
    749 void decode(int link_type, const char *pkt, unsigned len)  
     750void decode(int link_type UNUSED, const char *pkt, unsigned len)  
    750751{ 
    751752        ieee80211_frame_control *fc; 
  • trunk/libpacketdump/link_6.c

    r1351 r1450  
    1111#include "libtrace_int.h" 
    1212 
    13 void decode(int link_type,const char *pkt,unsigned len)  
     13void decode(int link_type UNUSED,const char *pkt,unsigned len)  
    1414{ 
    1515        libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt; 
  • trunk/libpacketdump/parser.y

    r979 r1450  
    1919    element_t *el_list = NULL; 
    2020 
    21     /* i didnt want these to be global, but i think they have to be? :/ */ 
    22     static bitbuffer_t buffer = 0; 
    23     static int bits = 0; 
    2421%} 
    2522 
Note: See TracChangeset for help on using the changeset viewer.