Skip to content

Commit

Permalink
- fix make structure (remove macOld exception, no --genconfig anymore)
Browse files Browse the repository at this point in the history
- fix some minor gcc warnings
- fix timers (double --> simtime_t)


git-svn-id: https://mixim.svn.sourceforge.net/svnroot/mixim/trunk@460 ccb5d51d-3e1d-0410-9886-bf3c9037c363
  • Loading branch information
otvi committed Oct 23, 2008
1 parent a84d80d commit 22ea54d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions base/timers/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class Timer
@param index Timer number to set.
@param when Time in seconds in the future to fire the timer
*/
void setTimer(unsigned int index, double when){checkCT();ct->setTimer(index,when);}
void setTimer(unsigned int index, simtime_t when){checkCT();ct->setTimer(index,when);}

/** Set a timer to fire at a point in the future.
Auto-generates a timer id. This will not be an id allocated to any other existing timer
(either running or finished) but may be an id from a timer deleted by deleteTimer.
@param when Time in seconds in the future to fire the timer
@return Timer id
*/
unsigned int setTimer(double when){checkCT();return ct->setTimer(when);}
unsigned int setTimer(simtime_t when){checkCT();return ct->setTimer(when);}

/** Cancel an existing timer set by @b setTimer()
If the timer has not been set, or has already fires, this does nothing
Expand Down
4 changes: 2 additions & 2 deletions base/timers/TimerCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void TimerCore::init(Timer *owner)
destructors = new std::map<unsigned int,cleanup *>();
}

unsigned int TimerCore::setTimer(double when)
unsigned int TimerCore::setTimer(simtime_t when)
{
unsigned int key = timers->size();
while (timers->find(key)!=timers->end())
Expand All @@ -34,7 +34,7 @@ unsigned int TimerCore::setTimer(double when)
return key;
}

void TimerCore::setTimer(unsigned int index, double when)
void TimerCore::setTimer(unsigned int index, simtime_t when)
{
Enter_Method_Silent();
cMessage *timer;
Expand Down
4 changes: 2 additions & 2 deletions base/timers/TimerCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class TimerCore: public BaseModule
@param index Timer number to set.
@param when Time in seconds in the future to fire the timer
*/
void setTimer(unsigned int index, double when);
void setTimer(unsigned int index, simtime_t when);

/** Set a timer to fire at a point in the future.
Auto-generates a timer id that's guaranteed not to have been used by anyone else.
If the timer with that id has already been set then this discards the old information.
@param when Time in seconds in the future to fire the timer
@return Timer id
*/
unsigned int setTimer(double when);
unsigned int setTimer(simtime_t when);

/** Cancel an existing timer set by @b setTimer()
If the timer has not been set, or has already fires, this does nothing
Expand Down
4 changes: 2 additions & 2 deletions base/utils/ModuleAccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include "ModuleAccess.h"

static cModule *findSubmodRecursive(cModule *curmod, const char *name, const char *classname)
static cModule *findSubmodRecursive(const cModule *curmod, const char *name, const char *classname)
{
for (cSubModIterator i(*curmod); !i.end(); i++)
for (cModule::SubmoduleIterator i(curmod); !i.end(); i++)
{
cModule *submod = i();
if (!strcmp(submod->getFullName(), name))
Expand Down
4 changes: 2 additions & 2 deletions examples/phyLayer/TestPhyLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class TestPhyLayer:public BasePhyLayer{
int myIndex;
std::string myName;

TestAnalogueModel(std::string name, double attenuation, int myIndex):
att(attenuation), myName(name), myIndex(myIndex) {}
TestAnalogueModel(std::string name, double attenuation, int index):
att(attenuation), myIndex(index), myName(name) {}

void filterSignal(Signal& s) {
log("Filtering signal.");
Expand Down
2 changes: 1 addition & 1 deletion makemakefiles
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ all:
# @cd $(ROOT)/base/localization && $(MAKEMAKE) $(OPTS) -n $(IBASE)

@echo $(ROOT)/modules
@cd $(ROOT)/modules && $(MAKEMAKE) $(OPTS) $(MODULES_OPTS) -K MIXIMROOT=$(ROOT) --deep -o libmiximmodules -s -X phy -X channel -X localization -X macOld
@cd $(ROOT)/modules && $(MAKEMAKE) $(OPTS) $(MODULES_OPTS) -K MIXIMROOT=$(ROOT) --deep -o libmiximmodules -s -X phy -X channel -X localization


# @echo $(ROOT)/modules
Expand Down
5 changes: 0 additions & 5 deletions mkmk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
# set root directory
ROOT=`pwd`

if [ ! -f omnetppconfig ]; then
# make omnetppconfig if it doesn't exist
opp_makemake -f --genconfig omnetppconfig
fi

# copy lib makefrag for linux
(cd $ROOT/lib && cp makefrag.linux makefrag)

Expand Down
4 changes: 2 additions & 2 deletions tests/basePhyLayer/TestPhyLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ void TestPhyLayer::testInitialisation() {
}

assertTrue("Check attenuation value of AnalogueModels.",
FWMath::close(att1, 1.1) && FWMath::close(att2, 2.1)
|| FWMath::close(att1, 2.1) && FWMath::close(att2, 1.1));
(FWMath::close(att1, 1.1) && FWMath::close(att2, 2.1))
|| (FWMath::close(att1, 2.1) && FWMath::close(att2, 1.1)));

//check initialisation of timers
assertNotEqual("Check initialisation of TX-OVER timer", (void*)0, txOverTimer);
Expand Down

0 comments on commit 22ea54d

Please # to comment.