Changeset 1655

Show
Ignore:
Timestamp:
01/07/07 21:51:03 (2 years ago)
Author:
hugo
Message:

fixed g++ 4.1 compilation problem reported by Bernhard Schmidt.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/mrd/log.h

    r1652 r1655  
    3232#include <mrd/node.h> 
    3333 
     34class base_stream; 
     35 
    3436class stream_flusher { 
    3537public: 
     
    3840        virtual void flushed(const char *buffer, bool newline) = 0; 
    3941}; 
     42 
     43const char *stream_type_format_parameter(bool); 
     44const char *stream_type_format_parameter(int); 
     45const char *stream_type_format_parameter(uint32_t); 
     46const char *stream_type_format_parameter(uint64_t); 
     47const char *stream_type_format_parameter(const char *); 
     48const char *stream_type_format_parameter(const void *); 
     49void stream_push_formated_type(base_stream &, bool val); 
     50void stream_push_formated_type(base_stream &, int val); 
     51void stream_push_formated_type(base_stream &, uint32_t val); 
     52void stream_push_formated_type(base_stream &, uint64_t val); 
     53void stream_push_formated_type(base_stream &, const char *val); 
     54void stream_push_formated_type(base_stream &, const void *val); 
    4055 
    4156/*! 
     
    221236} 
    222237 
    223 static inline const char *stream_type_format_parameter(bool) { 
    224         return "b"; 
    225 } 
    226  
    227 static inline const char *stream_type_format_parameter(int) { 
    228         return "i"; 
    229 } 
    230  
    231 static inline const char *stream_type_format_parameter(uint32_t) { 
    232         return "u"; 
    233 } 
    234  
    235 static inline const char *stream_type_format_parameter(uint64_t) { 
    236         return "llu"; 
    237 } 
    238  
    239 static inline const char *stream_type_format_parameter(const char *) { 
    240         return "s"; 
    241 } 
    242  
    243 static inline const char *stream_type_format_parameter(const void *) { 
    244         return "p"; 
    245 } 
    246  
    247 static inline void stream_push_formated_type(base_stream &os, bool val) { 
    248         os.append_chunk(val ? "true" : "false"); 
    249 } 
    250  
    251 static inline void stream_push_formated_type(base_stream &os, int val) { 
    252         char *p = os.req_buffer(32); 
    253         snprintf(p, 32, "%i", val); 
    254         os.commit_change(strlen(p)); 
    255 } 
    256  
    257 static inline void stream_push_formated_type(base_stream &os, uint32_t val) { 
    258         char *p = os.req_buffer(32); 
    259         snprintf(p, 32, "%u", val); 
    260         os.commit_change(strlen(p)); 
    261 } 
    262  
    263 static inline void stream_push_formated_type(base_stream &os, uint64_t val) { 
    264         char *p = os.req_buffer(64); 
    265         snprintf(p, 64, "%llu", val); 
    266         os.commit_change(strlen(p)); 
    267 } 
    268  
    269 static inline void stream_push_formated_type(base_stream &os, const char *val) { 
    270         os.append_chunk(val ? val : "(null)"); 
    271 } 
    272  
    273 static inline void stream_push_formated_type(base_stream &os, const void *val) { 
    274         char *p = os.req_buffer(32); 
    275         snprintf(p, 32, "%p", val); 
    276         os.commit_change(strlen(p)); 
    277 } 
    278  
    279238class log_base; 
    280239 
  • trunk/src/log.cpp

    r1651 r1655  
    622622} 
    623623 
     624const char *stream_type_format_parameter(bool) { 
     625        return "b"; 
     626} 
     627 
     628const char *stream_type_format_parameter(int) { 
     629        return "i"; 
     630} 
     631 
     632const char *stream_type_format_parameter(uint32_t) { 
     633        return "u"; 
     634} 
     635 
     636const char *stream_type_format_parameter(uint64_t) { 
     637        return "llu"; 
     638} 
     639 
     640const char *stream_type_format_parameter(const char *) { 
     641        return "s"; 
     642} 
     643 
     644const char *stream_type_format_parameter(const void *) { 
     645        return "p"; 
     646} 
     647 
     648void stream_push_formated_type(base_stream &os, bool val) { 
     649        os.append_chunk(val ? "true" : "false"); 
     650} 
     651 
     652void stream_push_formated_type(base_stream &os, int val) { 
     653        char *p = os.req_buffer(32); 
     654        snprintf(p, 32, "%i", val); 
     655        os.commit_change(strlen(p)); 
     656} 
     657 
     658void stream_push_formated_type(base_stream &os, uint32_t val) { 
     659        char *p = os.req_buffer(32); 
     660        snprintf(p, 32, "%u", val); 
     661        os.commit_change(strlen(p)); 
     662} 
     663 
     664void stream_push_formated_type(base_stream &os, uint64_t val) { 
     665        char *p = os.req_buffer(64); 
     666        snprintf(p, 64, "%llu", val); 
     667        os.commit_change(strlen(p)); 
     668} 
     669 
     670void stream_push_formated_type(base_stream &os, const char *val) { 
     671        os.append_chunk(val ? val : "(null)"); 
     672} 
     673 
     674void stream_push_formated_type(base_stream &os, const void *val) { 
     675        char *p = os.req_buffer(32); 
     676        snprintf(p, 32, "%p", val); 
     677        os.commit_change(strlen(p)); 
     678} 
     679 
-->