Changeset d8f02df for lib/trace.c


Ignore:
Timestamp:
02/27/06 16:53:10 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
5fb2251
Parents:
8a8e54b
Message:

Cleanup even more warnings (Finding a few bugs where functions don't always
call return!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rd5879cc rd8f02df  
    292292        libtrace->filter = NULL;
    293293        libtrace->snaplen = 0;
     294        libtrace->started=false;
    294295
    295296        for (i = 0; i < nformats; i++) {
     
    330331
    331332        libtrace->fifo = create_tracefifo(1048576);
     333        if (!libtrace->fifo) {
     334                trace_set_err(libtrace,ENOMEM,"Could not allocate memory for fifo");
     335                free(scan);
     336                return libtrace;
     337        }
    332338        assert(libtrace->fifo);
    333339        free(scan);
    334         libtrace->started=false;
    335340        trace_set_err(libtrace,0,"");
    336341        return libtrace;
     
    594599        memcpy(dest->header,packet->header,trace_get_framing_length(packet));
    595600        memcpy(dest->payload,packet->payload,trace_get_capture_length(packet));
     601
     602        return dest;
    596603}
    597604
     
    631638                do {
    632639                        packet->size=libtrace->format->read_packet(libtrace,packet);
    633                         if (packet->size==-1 || packet->size==0)
     640                        if (packet->size==(size_t)-1 || packet->size==0)
    634641                                return packet->size;
    635642                        if (libtrace->filter) {
     
    11691176}
    11701177
    1171 int trace_get_capture_length(const struct libtrace_packet_t *packet) {
     1178size_t trace_get_capture_length(const libtrace_packet_t *packet) {
    11721179
    11731180        assert(packet->size>0 && packet->size<65536);
     
    11881195 * not be the same as the Capture Len.
    11891196 */
    1190 int trace_get_wire_length(const struct libtrace_packet_t *packet){
     1197size_t trace_get_wire_length(const libtrace_packet_t *packet){
    11911198        assert(packet->size>0 && packet->size<65536);
    11921199
     
    12071214 */
    12081215SIMPLE_FUNCTION
    1209 int trace_get_framing_length(const libtrace_packet_t *packet) {
     1216size_t trace_get_framing_length(const libtrace_packet_t *packet) {
    12101217        if (packet->trace->format->get_framing_length) {
    12111218                return packet->trace->format->get_framing_length(packet);
Note: See TracChangeset for help on using the changeset viewer.