summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-03-31 10:21:22 (UTC)
committer mickeyl <mickeyl>2003-03-31 10:21:22 (UTC)
commit636449b2246963c2c9e48163332a0227036e4364 (patch) (side-by-side diff)
treec7383136a93938584b80b8f59c756733772d314d
parent2318b309ef4c5147fa1a975b7b261ceec5dd13a7 (diff)
downloadopie-636449b2246963c2c9e48163332a0227036e4364.zip
opie-636449b2246963c2c9e48163332a0227036e4364.tar.gz
opie-636449b2246963c2c9e48163332a0227036e4364.tar.bz2
resolve potential ambiguities in pow()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index cd36f16..50d67bb 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -384,25 +384,25 @@ void OWirelessNetworkInterface::init()
char __extraBufferForBuggyDrivers[sizeof range];
_iwr.u.data.pointer = (char*) &range;
_iwr.u.data.length = (sizeof range) * 2;
_iwr.u.data.flags = 0;
if ( !wioctl( SIOCGIWRANGE ) )
{
qDebug( "OWirelessNetworkInterface::init(): SIOCGIWRANGE failed (%s)", strerror( errno ) );
return;
}
for ( int i = 0; i < range.num_frequency; ++i )
{
- int freq = (int) ( double( range.freq[i].m ) * pow( 10, range.freq[i].e ) / 1000000.0 );
+ int freq = (int) ( double( range.freq[i].m ) * pow( 10.0, range.freq[i].e ) / 1000000.0 );
_channels.insert( freq, i+1 );
}
}
QString OWirelessNetworkInterface::associatedAP() const
{
//FIXME: use OMacAddress
QString mac;
if ( ioctl( SIOCGIWAP ) )
{
@@ -427,25 +427,25 @@ int OWirelessNetworkInterface::channel() const
//FIXME: When monitoring enabled, then use it
//FIXME: to gather the current RF channel
//FIXME: Until then, get active channel from hopper.
if ( _hopper && _hopper->isActive() )
return _hopper->channel();
if ( !wioctl( SIOCGIWFREQ ) )
{
return -1;
}
else
{
- return _channels[ static_cast<int>(double( _iwr.u.freq.m ) * pow( 10, _iwr.u.freq.e ) / 1000000) ];
+ return _channels[ static_cast<int>(double( _iwr.u.freq.m ) * pow( 10.0, _iwr.u.freq.e ) / 1000000) ];
}
}
void OWirelessNetworkInterface::setChannel( int c ) const
{
if ( !_mon )
{
memset( &_iwr, 0, sizeof( iwreqstruct ) );
_iwr.u.freq.m = c;
_iwr.u.freq.e = 0;
wioctl( SIOCSIWFREQ );
@@ -456,25 +456,25 @@ void OWirelessNetworkInterface::setChannel( int c ) const
}
}
double OWirelessNetworkInterface::frequency() const
{
if ( !wioctl( SIOCGIWFREQ ) )
{
return -1.0;
}
else
{
- return double( _iwr.u.freq.m ) * pow( 10, _iwr.u.freq.e ) / 1000000000.0;
+ return double( _iwr.u.freq.m ) * pow( 10.0, _iwr.u.freq.e ) / 1000000000.0;
}
}
int OWirelessNetworkInterface::channels() const
{
return _channels.count();
}
void OWirelessNetworkInterface::setChannelHopping( int interval )
{