Changeset 122


Ignore:
Timestamp:
Jan 18, 2006 11:32:27 PM (18 years ago)
Author:
bennylp
Message:

Fixed minor warnings/mismatched comments mainly in pjlib++

Location:
pjproject/trunk/pjlib
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/build/pjlib++.dsp

    r65 r122  
    108108# Begin Source File 
    109109 
     110SOURCE="..\include\pjlib++.hpp" 
     111# End Source File 
     112# Begin Source File 
     113 
    110114SOURCE="..\include\pj++\pool.hpp" 
    111115# End Source File 
  • pjproject/trunk/pjlib/include/pj++/file.hpp

    r65 r122  
    8484    enum Offset_Type 
    8585    { 
    86         SEEK_SET = PJ_SEEK_SET, 
    87         SEEK_CUR = PJ_SEEK_CUR, 
    88         SEEK_END = PJ_SEEK_END, 
     86        PJ_SEEK_SET = PJ_SEEK_SET, 
     87        PJ_SEEK_CUR = PJ_SEEK_CUR, 
     88        PJ_SEEK_END = PJ_SEEK_END, 
    8989    }; 
    9090 
  • pjproject/trunk/pjlib/include/pj++/os.hpp

    r65 r122  
    2121 
    2222#include <pj/os.h> 
     23#include <pj/string.h> 
    2324#include <pj++/types.hpp> 
    2425#include <pj++/pool.hpp> 
     
    152153        destroy(); 
    153154        return Pj_Thread_API::create( pool, &thread_, &thread_proc, this, 
    154                                       flags, thread_name); 
     155                                      flags, thread_name, stack_size); 
    155156    } 
    156157 
     
    532533    : sem_(NULL) 
    533534    { 
     535        create(pool, max, initial, name); 
    534536    } 
    535537 
     
    723725 
    724726// 
     727// Timestamp 
     728// 
     729class Pj_Timestamp 
     730{ 
     731public: 
     732    pj_status_t get_timestamp() 
     733    { 
     734        return pj_get_timestamp(&ts_); 
     735    } 
     736 
     737    Pj_Timestamp& operator += (const Pj_Timestamp &rhs) 
     738    { 
     739        pj_add_timestamp(&ts_, &rhs.ts_); 
     740        return *this; 
     741    } 
     742 
     743    Pj_Timestamp& operator -= (const Pj_Timestamp &rhs) 
     744    { 
     745        pj_sub_timestamp(&ts_, &rhs.ts_); 
     746        return *this; 
     747    } 
     748 
     749    Pj_Time_Val to_time() const 
     750    { 
     751        Pj_Timestamp zero; 
     752        pj_memset(&zero, 0, sizeof(zero)); 
     753        return Pj_Time_Val(pj_elapsed_time(&zero.ts_, &ts_)); 
     754    } 
     755 
     756    pj_uint32_t to_msec() const 
     757    { 
     758        Pj_Timestamp zero; 
     759        pj_memset(&zero, 0, sizeof(zero)); 
     760        return pj_elapsed_msec(&zero.ts_, &ts_); 
     761    } 
     762 
     763    pj_uint32_t to_usec() const 
     764    { 
     765        Pj_Timestamp zero; 
     766        pj_memset(&zero, 0, sizeof(zero)); 
     767        return pj_elapsed_usec(&zero.ts_, &ts_); 
     768    } 
     769 
     770    pj_uint32_t to_nanosec() const 
     771    { 
     772        Pj_Timestamp zero; 
     773        pj_memset(&zero, 0, sizeof(zero)); 
     774        return pj_elapsed_nanosec(&zero.ts_, &ts_); 
     775    } 
     776 
     777    pj_uint32_t to_cycle() const 
     778    { 
     779        Pj_Timestamp zero; 
     780        pj_memset(&zero, 0, sizeof(zero)); 
     781        return pj_elapsed_cycle(&zero.ts_, &ts_); 
     782    } 
     783 
     784private: 
     785    pj_timestamp    ts_; 
     786}; 
     787 
     788 
     789// 
    725790// OS abstraction. 
    726791// 
  • pjproject/trunk/pjlib/include/pj++/proactor.hpp

    r65 r122  
    207207    // Timeout callback. 
    208208    // 
    209     virtual void on_timeout(int data)  
     209    virtual void on_timeout(int)  
    210210    { 
    211211    } 
     
    214214    // On read complete callback. 
    215215    // 
    216     virtual void on_read_complete( Pj_Async_Op *op_key, 
    217                                    pj_ssize_t bytes_read)  
     216    virtual void on_read_complete( Pj_Async_Op*, pj_ssize_t)  
    218217    { 
    219218    } 
     
    222221    // On write complete callback. 
    223222    // 
    224     virtual void on_write_complete( Pj_Async_Op *op_key,  
    225                                     pj_ssize_t bytes_sent)  
     223    virtual void on_write_complete( Pj_Async_Op *, pj_ssize_t)  
    226224    { 
    227225    } 
     
    231229    // On connect complete callback. 
    232230    // 
    233     virtual void on_connect_complete(pj_status_t status)  
     231    virtual void on_connect_complete(pj_status_t)  
    234232    { 
    235233    } 
     
    238236    // On new connection callback. 
    239237    // 
    240     virtual void on_accept_complete( Pj_Async_Op *op_key, 
    241                                      pj_sock_t new_sock, 
    242                                      pj_status_t status)  
     238    virtual void on_accept_complete( Pj_Async_Op*, pj_sock_t, pj_status_t)  
    243239    { 
    244240    } 
     
    257253    // Static timer callback. 
    258254    // 
    259     static void timer_callback( pj_timer_heap_t *timer_heap,  
     255    static void timer_callback( pj_timer_heap_t*,  
    260256                                struct pj_timer_entry *entry) 
    261257    { 
  • pjproject/trunk/pjlib/include/pj++/scanner.hpp

    r65 r122  
    2323#include <pj++/string.hpp> 
    2424 
    25 class Pj_Char_Spec 
     25class Pj_Cis; 
     26class Pj_Cis_Buffer; 
     27class Pj_Scanner; 
     28 
     29class Pj_Cis_Buffer 
    2630{ 
     31    friend class Pj_Cis; 
     32 
    2733public: 
    28     Pj_Char_Spec() { pj_cs_init(cs__); } 
    29  
    30     void set(int c) { pj_cs_set(cs__, c); } 
    31     void add_range(int begin, int end) { pj_cs_add_range(cs__, begin, end); } 
    32     void add_alpha() { pj_cs_add_alpha(cs__); } 
    33     void add_num() { pj_cs_add_num(cs__); } 
    34     void add_str(const char *str) { pj_cs_add_str(cs__, str); } 
    35     void del_range(int begin, int end) { pj_cs_del_range(cs__, begin, end); } 
    36     void del_str(const char *str) { pj_cs_del_str(cs__, str); } 
    37     void invert() { pj_cs_invert(cs__); } 
    38     int  match(int c) { return pj_cs_match(cs__, c); } 
    39  
    40     pj_char_spec_element_t *cs_() 
    41     { 
    42         return cs__; 
    43     } 
    44  
    45     const pj_char_spec_element_t *cs_() const 
    46     { 
    47         return cs__; 
     34    Pj_Cis_Buffer()  
     35    {  
     36        pj_cis_buf_init(&buf_);  
    4837    } 
    4938 
    5039private: 
    51     pj_char_spec cs__; 
     40    pj_cis_buf_t buf_; 
    5241}; 
     42 
     43 
     44class Pj_Cis 
     45{ 
     46    friend class Pj_Scanner; 
     47 
     48public: 
     49    Pj_Cis(Pj_Cis_Buffer *buf) 
     50    { 
     51        pj_cis_init(&buf->buf_, &cis_); 
     52    } 
     53 
     54    Pj_Cis(const Pj_Cis &rhs) 
     55    { 
     56        pj_cis_dup(&cis_, (pj_cis_t*)&rhs.cis_); 
     57    } 
     58 
     59    void add_range(int start, int end) 
     60    { 
     61        pj_cis_add_range(&cis_, start, end); 
     62    } 
     63 
     64    void add_alpha() 
     65    { 
     66        pj_cis_add_alpha(&cis_); 
     67    } 
     68 
     69    void add_num() 
     70    { 
     71        pj_cis_add_num(&cis_); 
     72    } 
     73 
     74    void add_str(const char *str) 
     75    { 
     76        pj_cis_add_str(&cis_, str); 
     77    } 
     78 
     79    void add_cis(const Pj_Cis &rhs) 
     80    { 
     81        pj_cis_add_cis(&cis_, &rhs.cis_); 
     82    } 
     83 
     84    void del_range(int start, int end) 
     85    { 
     86        pj_cis_del_range(&cis_, start, end); 
     87    } 
     88 
     89    void del_str(const char *str) 
     90    { 
     91        pj_cis_del_str(&cis_, str); 
     92    } 
     93 
     94    void invert() 
     95    { 
     96        pj_cis_invert(&cis_); 
     97    } 
     98 
     99    bool match(int c) const 
     100    { 
     101        return pj_cis_match(&cis_, c) != 0; 
     102    } 
     103 
     104private: 
     105    pj_cis_t cis_; 
     106}; 
     107 
     108 
    53109 
    54110class Pj_Scanner 
     
    86142    } 
    87143 
    88     int peek(const Pj_Char_Spec *cs, Pj_String *out) 
    89     { 
    90         return pj_scan_peek(&scanner_,  cs->cs_(), out); 
     144    int peek(const Pj_Cis *cis, Pj_String *out) 
     145    { 
     146        return pj_scan_peek(&scanner_,  &cis->cis_, out); 
    91147    } 
    92148 
     
    96152    } 
    97153 
    98     int peek_until(const Pj_Char_Spec *cs, Pj_String *out) 
    99     { 
    100         return pj_scan_peek_until(&scanner_, cs->cs_(), out); 
    101     } 
    102  
    103     void get(const Pj_Char_Spec *cs, Pj_String *out) 
    104     { 
    105         pj_scan_get(&scanner_, cs->cs_(), out); 
     154    int peek_until(const Pj_Cis *cis, Pj_String *out) 
     155    { 
     156        return pj_scan_peek_until(&scanner_, &cis->cis_, out); 
     157    } 
     158 
     159    void get(const Pj_Cis *cis, Pj_String *out) 
     160    { 
     161        pj_scan_get(&scanner_, &cis->cis_, out); 
    106162    } 
    107163 
     
    126182    } 
    127183 
    128     void get_until(const Pj_Char_Spec *cs, Pj_String *out) 
    129     { 
    130         pj_scan_get_until(&scanner_, cs->cs_(), out); 
     184    void get_until(const Pj_Cis *cis, Pj_String *out) 
     185    { 
     186        pj_scan_get_until(&scanner_, &cis->cis_, out); 
    131187    } 
    132188 
     
    161217    } 
    162218 
    163     void save_state(State *state) 
     219    void save_state(State *state) const 
    164220    { 
    165221        pj_scan_save_state(&scanner_, state); 
     
    178234    int get_pos_col() const 
    179235    { 
    180         return scanner_.col; 
     236        return pj_scan_get_col(&scanner_); 
    181237    } 
    182238 
  • pjproject/trunk/pjlib/include/pj++/sock.hpp

    r65 r122  
    236236    // getsockopt. 
    237237    // 
    238     pj_status_t getsockopt(int level, int optname,  
     238    pj_status_t getsockopt(pj_uint16_t level, pj_uint16_t optname,  
    239239                           void *optval, int *optlen) 
    240240    { 
     
    245245    // setsockopt 
    246246    //  
    247     pj_status_t setsockopt(int level, int optname,  
     247    pj_status_t setsockopt(pj_uint16_t level, pj_uint16_t optname,  
    248248                           const void *optval, int optlen) 
    249249    { 
  • pjproject/trunk/pjlib/include/pj++/string.hpp

    r65 r122  
    345345 
    346346    // 
     347    // Assign from char* 
     348    // 
     349    Pj_String& operator=(char *s) 
     350    { 
     351        set(s); 
     352        return *this; 
     353    } 
     354 
     355    /// 
     356    // Assign from another Pj_String 
     357    // 
     358    Pj_String& operator=(Pj_String &rhs) 
     359    { 
     360        set(rhs); 
     361        return *this; 
     362    } 
     363 
     364    // 
    347365    // Find a character in the string. 
    348366    // 
     
    416434    } 
    417435 
    418  
    419 private: 
    420     //Pj_String(const Pj_String &rhs) {} 
    421     void operator=(const Pj_String &rhs) { pj_assert(false); } 
    422436}; 
    423437 
  • pjproject/trunk/pjlib/include/pj++/timer.hpp

    r65 r122  
    6363    pj_timer_entry entry_; 
    6464 
    65     static void timer_heap_callback(pj_timer_heap_t *th, pj_timer_entry *e) 
     65    static void timer_heap_callback(pj_timer_heap_t*, pj_timer_entry *e) 
    6666    { 
    6767        Pj_Timer_Entry *entry = (Pj_Timer_Entry*) e->user_data; 
  • pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h

    r75 r122  
    4545typedef unsigned long long pj_uint64_t; 
    4646 
     47#define PJ_INT64_FMT            "L" 
     48 
    4749 
    4850#endif  /* __PJ_COMPAT_CC_GCC_H__ */ 
  • pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h

    r75 r122  
    5858typedef unsigned __int64 pj_uint64_t; 
    5959 
     60#define PJ_INT64_FMT    "I64" 
     61 
     62 
    6063#endif  /* __PJ_COMPAT_CC_MSVC_H__ */ 
  • pjproject/trunk/pjlib/include/pj/sock.h

    r106 r122  
    664664 * @param tolen         The length of the address in bytes. 
    665665 * 
    666  * @return              The length of data successfully sent. 
     666 * @return              PJ_SUCCESS or the status code. 
    667667 */ 
    668668PJ_DECL(pj_status_t) pj_sock_sendto(pj_sock_t sockfd, 
  • pjproject/trunk/pjlib/include/pjlib++.hpp

    r66 r122  
    2020#define __PJLIBPP_H__ 
    2121 
     22#include <pj++/file.hpp> 
    2223#include <pj++/pool.hpp> 
    2324#include <pj++/hash.hpp> 
Note: See TracChangeset for help on using the changeset viewer.