Changeset 4bd8a5b for lib/format_wag.c


Ignore:
Timestamp:
12/24/06 17:05:29 (14 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:
870e501
Parents:
778d459
Message:

Cleanup a gazillion warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_wag.c

    rcab58c5 r4bd8a5b  
    9292
    9393static int wag_init_input(libtrace_t *libtrace) {
    94         libtrace->format_data = calloc(1, sizeof(struct wag_format_data_t));
    95 
     94        libtrace->format_data = calloc((size_t)1,
     95                                        sizeof(struct wag_format_data_t));
    9696        return 0;
    9797}
     
    123123static int wtf_init_input(libtrace_t *libtrace)
    124124{
    125         libtrace->format_data = calloc(1,sizeof(struct wag_format_data_t));
     125        libtrace->format_data = calloc((size_t)1,
     126                                        sizeof(struct wag_format_data_t));
    126127        return 0;
    127128}
     
    216217        size_t framesize;
    217218        char *buf_ptr = (char *)buffer;
    218         unsigned int to_read = 0;
     219        size_t to_read = 0;
    219220        uint16_t magic = 0;
    220221        long fd_flags;
     
    295296       
    296297        while (to_read>0) {
    297                 int ret=read(INPUT.fd,buf_ptr,to_read);
     298                int ret=read(INPUT.fd,buf_ptr,(size_t)to_read);
    298299
    299300                if (ret == -1) {
     
    322323        if (packet->buf_control == TRACE_CTRL_EXTERNAL || !packet->buffer) {
    323324                packet->buf_control = TRACE_CTRL_PACKET;
    324                 packet->buffer = malloc(LIBTRACE_PACKET_BUFSIZE);
     325                packet->buffer = malloc((size_t)LIBTRACE_PACKET_BUFSIZE);
    325326        }
    326327       
     
    330331       
    331332        if ((numbytes = wag_read(libtrace, (void *)packet->buffer,
    332                                         RP_BUFSIZE, block_flag)) <= 0) {
     333                                        (size_t)RP_BUFSIZE, block_flag)) <= 0) {
    333334           
    334335                return numbytes;
     
    354355        if (packet->buf_control == TRACE_CTRL_EXTERNAL || !packet->buffer) {
    355356                packet->buf_control = TRACE_CTRL_PACKET;
    356                 packet->buffer = malloc(LIBTRACE_PACKET_BUFSIZE);
     357                packet->buffer = malloc((size_t)LIBTRACE_PACKET_BUFSIZE);
    357358        }
    358359        packet->type = TRACE_RT_DATA_WAG;
     
    385386        assert(size > 0);
    386387       
    387         if ((numbytes=libtrace_io_read(INPUT.file, buffer2, size)) != size) {
     388        if ((numbytes=libtrace_io_read(INPUT.file, buffer2, (size_t)size))
     389                                != size) {
    388390                trace_set_err(libtrace,
    389391                                errno,"read(%s,buffer)",packet->trace->uridata);
Note: See TracChangeset for help on using the changeset viewer.