Changeset 6919 for source/ariba/utility


Ignore:
Timestamp:
Nov 13, 2009, 1:41:34 PM (14 years ago)
Author:
mies
Message:

Fixed tons of warnings when using CXXFLAGS="-Wall"!

Location:
source/ariba/utility
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/addressing/endpoint_set.hpp

    r6877 r6919  
    399399                this->rfcomm = rhs.rfcomm;
    400400                this->tcp = rhs.tcp;
     401                return *this;
    401402        }
    402403
  • source/ariba/utility/addressing/ip_address.hpp

    r6841 r6919  
    166166        }
    167167
    168 
    169168        bool is_multicast_site_local() const {
    170169                if (addr.is_v4()) return false;
  • source/ariba/utility/bootstrap/modules/bluetoothsdp/BluetoothSdp.cpp

    r5967 r6919  
    6464namespace utility {
    6565
     66static bdaddr_t bd_addr_any = {{0, 0, 0, 0, 0, 0}};
     67static bdaddr_t bd_addr_local = {{0, 0, 0, 0xff, 0xff, 0xff}};
     68
    6669use_logging_cpp(BluetoothSdp);
    6770OverlayBootstrap* BluetoothSdp::CONNECTION_CHECKER = NULL;
     
    216219        // connect to the local SDP server, register the service record
    217220        if( sdp_session_ == NULL ){
    218                 sdp_session_ = sdp_connect(BDADDR_ANY, BDADDR_LOCAL, SDP_RETRY_IF_BUSY);
     221                sdp_session_ = sdp_connect(&bd_addr_any, &bd_addr_local, SDP_RETRY_IF_BUSY);
    219222        }
    220223
     
    275278
    276279                bdaddr_t address;
    277                 uint8_t channel;
     280//              uint8_t channel;
    278281
    279282                dev_id = hci_get_route(NULL);
     
    339342        char name[256], info1[256], info2[256], info3[256];
    340343
    341         session = sdp_connect(BDADDR_ANY, &target, SDP_RETRY_IF_BUSY);
     344        session = sdp_connect(&bd_addr_any, &target, SDP_RETRY_IF_BUSY);
    342345
    343346        if (session == NULL) {
     
    401404         * Returns a string holding the bt adress in human readable form.
    402405         */
    403         char addr[32] = { 0 };
    404406        char str[32] = { 0 };
    405407        ba2str(ba, str);
  • source/ariba/utility/bootstrap/modules/periodicbroadcast/PeriodicBroadcast.h

    r5973 r6919  
    197197        public:
    198198                udp_server(boost::asio::io_service& io_service, ServiceList* _services, boost::mutex* _servicesmutex)
    199                         : services(_services), servicesmutex(_servicesmutex),
    200                                 socket_v4(io_service), socket_v6(io_service) {
     199                        : socket_v4(io_service), socket_v6(io_service),
     200                          services(_services), servicesmutex(_servicesmutex) {
    201201
    202202                        if( open4() ) start_receive_4();
     
    350350
    351351                                { // insert new found service
    352                                         boost::mutex::scoped_lock( *servicesmutex );
     352                                        boost::mutex::scoped_lock lock( *servicesmutex );
    353353
    354354                                        ServiceList::iterator it = services->find( msg.getName() );
  • source/ariba/utility/measurement/PathloadMeasurement.cpp

    r5412 r6919  
    4545
    4646PathloadMeasurement::PathloadMeasurement(BaseOverlay* _overlay)
    47         : running( false ), resultNode( NodeID::UNSPECIFIED ),
    48           listener( NULL), serverpid( -1 ) {
     47        : running( false ), listener( NULL), resultNode( NodeID::UNSPECIFIED ),
     48          serverpid( -1 ) {
    4949
    5050        if( _overlay != NULL ) // this is important due to the singleton interface!
     
    142142        char buf[128];
    143143        string content = "";
    144         bool failed = true;
     144//      bool failed = true;
    145145
    146146        while( fgets(buf, 100, stream) != NULL ){
  • source/ariba/utility/messages/Message.h

    r6786 r6919  
    106106         */
    107107        explicit inline Message( const Data& data ) :
    108                 srcAddr(NULL),destAddr(NULL), releasePayload(true) {
     108                releasePayload(true), srcAddr(NULL),destAddr(NULL) {
    109109                this->payload = data.clone();
    110110//              this->root = shared_array<uint8_t>((uint8_t*)data.getBuffer());
     
    246246                        } else {
    247247                                if (msg->payload.isUnspecified()) {
    248                                         size_t l = ((len == ~0) ? X.getRemainingLength() : len);
     248                                        size_t l = ((len == ~(size_t)0) ? X.getRemainingLength() : len);
    249249                                        msg->payload = X.getRemainingData(l);
    250250                                        msg->releasePayload = false;
  • source/ariba/utility/messages/MessageProvider.cpp

    r3690 r6919  
    4949bool MessageProvider::sendMessageToReceivers( const Message* message ) {
    5050        bool sent =  false;
    51         for (int i=0; i<receivers.size(); i++)
     51        for (size_t i=0; i<receivers.size(); i++)
    5252                if (receivers[i]->receiveMessage(message, LinkID::UNSPECIFIED, NodeID::UNSPECIFIED)) sent = true;
    5353        return sent;
     
    5959
    6060void MessageProvider::removeMessageReceiver( MessageReceiver* receiver ) {
    61         for (int i=0; i<receivers.size(); i++)
     61        for (size_t i=0; i<receivers.size(); i++)
    6262                if (receivers[i]==receiver) {
    6363                        receivers.erase( receivers.begin()+i );
  • source/ariba/utility/serialization/DataStream.hpp

    r5638 r6919  
    516516
    517517        /* array and vector support */
    518         template<typename T>
     518        template<typename T, bool staticArray = false>
    519519        class ArrayTpl : public ExplicitSerializer {
    520520        private:
     
    527527
    528528                sznMethodBegin(X)
    529                 if (X.isDeserializer()) v = new T[l];
     529                if (X.isDeserializer() && !staticArray) v = new T[l];
    530530                for (size_t i=0; i<l; i++) X && v[i];
    531531                sznMethodEnd()
     
    556556        finline ArrayTpl<T> A( T*& array, size_t length ) {
    557557                return ArrayTpl<T>(array,length);
     558        }
     559
     560        template<typename T>
     561        finline ArrayTpl<T,true> static_A( T*& array, size_t length ) {
     562                return ArrayTpl<T, true>(array,length);
    558563        }
    559564
  • source/ariba/utility/system/SystemEvent.h

    r3690 r6919  
    5959        const void* data; //< data attached to the event
    6060
    61 public: 
     61public:
    6262        // TODO: these should be private, but the gcc 3.4 in scratchbox for cross-compiling
    6363        // for Maemo (Nokia N810) gets confused when the friend class SystemQueue has a
     
    6666        uint32_t delayTime; //< time the event is scheduled at, or 0 if it is to be fired immediately
    6767        uint32_t remainingDelay; //< remaining delay time for sleeping
    68        
     68
    6969public:
    70         inline SystemEvent(
    71                         SystemEventListener* mlistener,
    72                         SystemEventType mtype = SystemEventType::DEFAULT,
    73                         void* mdata = NULL)
    74                         :       scheduledTime(boost::posix_time::not_a_date_time),
    75                                 delayTime(0),
    76                                 remainingDelay(0),
    77                                 listener(mlistener),
    78                                 type(mtype),
    79                                 data(mdata) {
     70        inline SystemEvent(SystemEventListener* mlistener, SystemEventType mtype =
     71                        SystemEventType::DEFAULT, void* mdata = NULL) :
     72                listener(mlistener), type(mtype), data(mdata), scheduledTime(
     73                                boost::posix_time::not_a_date_time), delayTime(0),
     74                                remainingDelay(0)
     75
     76        {
    8077        }
    8178
    8279        template<typename T>
    83         inline SystemEvent( SystemEventListener* mlistener,
    84                         SystemEventType mtype = SystemEventType::DEFAULT,
    85                         T* mdata = NULL)
    86                                 :       scheduledTime(boost::posix_time::not_a_date_time),
    87                                         delayTime(0),
    88                                         remainingDelay(0),
    89                                         listener(mlistener),
    90                                         type(mtype),
    91                                         data((void*)mdata) {
     80        inline SystemEvent(SystemEventListener* mlistener, SystemEventType mtype =
     81                        SystemEventType::DEFAULT, T* mdata = NULL) :
     82                listener(mlistener), type(mtype), data((void*) mdata), scheduledTime(
     83                                boost::posix_time::not_a_date_time), delayTime(0),
     84                                remainingDelay(0) {
    9285        }
    93 
    94 
    9586
    9687        inline SystemEvent(const SystemEvent& copy) {
     
    126117        template<typename T>
    127118        inline T* getData() const {
    128                 return (T*)*this;
     119                return (T*) *this;
    129120        }
    130121
     
    147138};
    148139
    149 }} // spovnet, common
     140}
     141} // spovnet, common
    150142
    151143#endif /* SYSTEMEVENT_H_ */
  • source/ariba/utility/system/SystemQueue.cpp

    r5316 r6919  
    125125
    126126SystemQueue::QueueThread::QueueThread(QueueThread* _transferQueue)
    127         : running( false ), transferQueue( _transferQueue ) {
     127        : transferQueue( _transferQueue ), running( false ) {
    128128}
    129129
  • source/ariba/utility/system/SystemQueue.h

    r4702 r6919  
    234234#ifdef UNDERLAY_OMNET
    235235
     236#if 0
    236237        //
    237238        // the system queue must be a singleton in simulations, too.
     
    243244        // this is the macro definition from macros.h
    244245        //
    245         // #define Define_Module(CLASSNAME) \
    246         //   static cModule *CLASSNAME##__create() {return new CLASSNAME();} \
     246        // #define Define_Module(CLASSNAME) /backslash
     247        //   static cModule *CLASSNAME##__create() {return new CLASSNAME();} /backslash
    247248        //   EXECUTE_ON_STARTUP(CLASSNAME##__mod, modtypes.instance()->add(new cModuleType(#CLASSNAME,#CLASSNAME,(ModuleCreateFunc)CLASSNAME##__create));)
    248249        //
    249250        // and this is how we do it :)
    250251        //
     252#endif
    251253
    252254        static cModule* SystemQueue__create() {
  • source/ariba/utility/transport/tcpip/protlib/address.h

    r5284 r6919  
    790790
    791791        node *insert(netaddress &key, data_type &dat) {
    792                 node *a, *b, *c, *n, *m;
    793                 int cmp, pos = 0;
     792                node *a, *b = NULL, *c, *n, *m;
     793                int cmp = 0, pos = 0;
    794794
    795795                c = a = key.is_ipv4() ? v4head : v6head;
  • source/ariba/utility/transport/tcpip/tcpip.cpp

    r5718 r6919  
    183183                datamsg->set_pos(0);
    184184                uint32_t message_size = datamsg->decode32(true)-2;
    185                 uint16_t remote_port = datamsg->decode16(true);
     185                //uint16_t remote_port = datamsg->decode16(true);
    186186
    187187
  • source/ariba/utility/types/Identifier.cpp

    r4437 r6919  
    7070
    7171void Identifier::clearAddress() {
    72         for (int i = 0; i < array_size; i++)
     72        for (size_t i = 0; i < array_size; i++)
    7373                key[i] = 0;
    7474        isUnspec = false;
     
    7777
    7878bool Identifier::setAddress(string address) {
    79         // TODO
     79        return false;
    8080}
    8181
     
    204204        if (isUnspec) return std::string("<unspec>");
    205205
    206         char temp[80];
     206        char temp[250];
    207207        if (base == 16) {
    208208                int k = 0;
     
    238238}
    239239#endif
     240        return "<not supported>";
    240241}
    241242
  • source/ariba/utility/types/ServiceID.h

    r3690 r6919  
    7575
    7676        inline bool isUnspecified() const {
    77                 return (id==~0);
     77                return (id==~(uint32_t)0);
    7878        }
    7979
  • source/ariba/utility/visual/DddVis.cpp

    r6900 r6919  
    125125                                order = ORDER_RANDOMLY;
    126126                                break;
     127                        default:
     128                                break;
    127129                        }
    128130
Note: See TracChangeset for help on using the changeset viewer.