Changeset 952 for trunk/lib/trace.c


Ignore:
Timestamp:
08/25/06 15:47:43 (7 years ago)
Author:
perry
Message:

Fixed lots of warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/trace.c

    r935 r952  
    637637                free(packet->buffer); 
    638638        } 
    639         packet->buf_control='\0'; /* an "bad" value to force an assert 
    640                                    * if this packet is ever reused 
    641                                    */ 
     639        packet->buf_control=(buf_control_t)'\0';  
     640                                /* an "bad" value to force an assert 
     641                                 * if this packet is ever reused 
     642                                 */ 
    642643        free(packet); 
    643644}        
     
    685686        } 
    686687        trace_set_err(libtrace,TRACE_ERR_UNSUPPORTED,"This format does not support reading packets\n"); 
    687         packet->size=-1; 
    688         return -1; 
     688        packet->size=~0U; 
     689        return ~0U; 
    689690} 
    690691 
     
    832833                return packet->trace->format->get_capture_length(packet); 
    833834        } 
    834         return -1; 
     835        return ~0U; 
    835836} 
    836837         
     
    850851                return packet->trace->format->get_wire_length(packet); 
    851852        } 
    852         return -1; 
     853        return ~0U; 
    853854 
    854855} 
     
    867868                return packet->trace->format->get_framing_length(packet); 
    868869        } 
    869         return -1; 
     870        return ~0U; 
    870871} 
    871872 
     
    975976                        return -1; 
    976977                } 
    977                 if (libtrace_to_pcap_dlt(linktype) == ~0U) { 
     978                if (libtrace_to_pcap_dlt(linktype) == -1) { 
    978979                        trace_set_err(packet->trace,TRACE_ERR_BAD_PACKET, 
    979980                                        "Unknown pcap equivilent linktype"); 
     
    10241025 
    10251026        assert(filter->flag); 
    1026         return bpf_filter(filter->filter.bf_insns, linkptr, clen, clen); 
     1027        return bpf_filter(filter->filter.bf_insns,(u_char*)linkptr,clen,clen); 
    10271028#else 
    10281029        fprintf(stderr,"This version of libtrace does not have bpf filter support\n"); 
     
    10441045                return packet->trace->format->set_direction(packet,direction); 
    10451046        } 
    1046         return -1; 
     1047        return (libtrace_direction_t)~0U; 
    10471048} 
    10481049 
     
    10631064                return packet->trace->format->get_direction(packet); 
    10641065        } 
    1065         return -1; 
     1066        return (libtrace_direction_t)~0U; 
    10661067} 
    10671068 
     
    10791080 * @param dest the TCP or UDP destination port 
    10801081 * @returns a hint as to which port is the server port 
    1081  * @author Daniel Lawson 
    1082  */ 
    1083 DLLEXPORT int8_t trace_get_server_port(uint8_t protocol UNUSED, uint16_t source, uint16_t dest) { 
     1082 */ 
     1083DLLEXPORT int8_t trace_get_server_port(UNUSED uint8_t protocol,  
     1084                uint16_t source, uint16_t dest)  
     1085{ 
    10841086        /* 
    10851087         * * If the ports are equal, return DEST 
     
    12031205        } 
    12041206 
    1205         return -1; 
     1207        return ~0U; 
    12061208} 
    12071209 
Note: See TracChangeset for help on using the changeset viewer.