Changeset 34070 for lang/c

Show
Ignore:
Timestamp:
06/21/09 03:45:47 (6 years ago)
Author:
itkz
Message:

fixed some warning

Location:
lang/c/librtmp
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lang/c/librtmp/Makefile.gcc

    r28370 r34070  
    22CC = gcc 
    33 
    4 CFLAGS = -g -Wall -fmudflap 
     4CFLAGS = -g -Wall -Wextra -Wstrict-aliasing=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith -fmudflap 
    55LDFLAGS = -lpthread -lmudflap 
    66 
  • lang/c/librtmp/rtmp.c

    r33948 r34070  
    7272static rtmp_server_client_t *get_new_server_client(rtmp_server_t *s); 
    7373static int rtmp_server_client_set_will_send_buffer( 
    74     rtmp_server_client_t *rc, unsigned char *data, int size); 
     74    rtmp_server_client_t *rc, unsigned char *data, size_t size); 
    7575static void rtmp_server_client_delete_received_buffer( 
    76     rtmp_server_client_t *rsc, int size); 
     76    rtmp_server_client_t *rsc, size_t size); 
    7777static rtmp_result_t rtmp_server_client_send_and_recv( 
    7878    rtmp_server_client_t *rsc); 
     
    115115    ret = bind( 
    116116        rtmp_server->conn_sock, 
    117         (struct sockaddr*)&rtmp_server->conn_sockaddr, 
     117        (struct sockaddr*)&(rtmp_server->conn_sockaddr), 
    118118        sizeof(rtmp_server->conn_sockaddr)); 
    119119    if (ret == -1) { 
     
    137137    rtmp_server_client_t *next; 
    138138    int client_sock; 
    139     socklen_t addrlen; 
     139    socklen_t addrlen[200]; 
    140140    fd_set fdset; 
    141141    int ret; 
     
    151151        rsc = get_new_server_client(rs); 
    152152 
     153printf("a\n"); 
    153154        client_sock = accept( 
    154155            rs->conn_sock, 
    155             (struct sockaddr*)&(rsc->conn_sockaddr), 
    156             &addrlen); 
     156            (struct sockaddr*)&(rs->conn_sockaddr), 
     157            &addrlen[0]); 
     158printf("b\n"); 
    157159        if (client_sock == -1) { 
    158160            return; 
     
    279281 
    280282static int rtmp_server_client_set_will_send_buffer( 
    281     rtmp_server_client_t *rsc, unsigned char *data, int size) 
     283    rtmp_server_client_t *rsc, unsigned char *data, size_t size) 
    282284{ 
    283285    if (rsc->will_send_size + size > RTMP_BUFFER_SIZE) { 
     
    293295 
    294296static void rtmp_server_client_delete_received_buffer( 
    295     rtmp_server_client_t *rsc, int size) 
     297    rtmp_server_client_t *rsc, size_t size) 
    296298{ 
    297299    if (size >= rsc->received_size) { 
     
    325327        now = time(NULL) * 1000; 
    326328#endif 
    327         write_le32int(rsc->handshake, now); 
     329        write_le32int(rsc->handshake, (int)now); 
    328330        write_le32int(rsc->handshake + 4, 0); 
    329331        for (i = 8; i < RTMP_HANDSHAKE_SIZE; ++i) { 
     
    547549 
    548550static int rtmp_client_set_will_send_buffer( 
    549     rtmp_client_t *rc, unsigned char *data, int size); 
     551    rtmp_client_t *rc, unsigned char *data, size_t size); 
    550552static void rtmp_client_delete_received_buffer( 
    551     rtmp_client_t *rc, int size); 
     553    rtmp_client_t *rc, size_t size); 
    552554static rtmp_result_t rtmp_client_send_packet( 
    553555    rtmp_client_t *rc, rtmp_packet_t *packet); 
     
    569571#endif 
    570572 
    571     srand(time(NULL)); 
     573    srand((unsigned)time(NULL)); 
    572574 
    573575    rc = (rtmp_client_t*)malloc(sizeof(rtmp_client_t)); 
     
    687689 
    688690static int rtmp_client_set_will_send_buffer( 
    689     rtmp_client_t *rc, unsigned char *data, int size) 
     691    rtmp_client_t *rc, unsigned char *data, size_t size) 
    690692{ 
    691693    if (rc->will_send_size + size > RTMP_BUFFER_SIZE) { 
     
    701703 
    702704static void rtmp_client_delete_received_buffer( 
    703     rtmp_client_t *rc, int size) 
     705    rtmp_client_t *rc, size_t size) 
    704706{ 
    705707    if (size >= rc->received_size) { 
     
    732734    now = time(NULL) * 1000; 
    733735#endif 
    734     write_le32int(rc->handshake, now); 
     736    write_le32int(rc->handshake, (int)now); 
    735737    write_le32int(rc->handshake + 4, 0); 
    736738    for (i = 8; i < RTMP_HANDSHAKE_SIZE; ++i) { 
  • lang/c/librtmp/rtmp_packet.c

    r33905 r34070  
    114114rtmp_result_t rtmp_packet_analyze_data( 
    115115    rtmp_packet_t *packet, 
    116     unsigned char *data, int data_size, 
     116    unsigned char *data, size_t data_size, 
    117117    size_t amf_chunk_size, 
    118118    size_t *packet_size) 
  • lang/c/librtmp/rtmp_packet.h

    r33058 r34070  
    9191extern rtmp_result_t rtmp_packet_analyze_data( 
    9292    rtmp_packet_t *packet, 
    93     unsigned char *data, int data_size, 
     93    unsigned char *data, size_t data_size, 
    9494    size_t amf_chunk_size, 
    9595    size_t *packet_size);