Skip to content

Commit

Permalink
Correction of trivial warnings.
Browse files Browse the repository at this point in the history
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4670 19bc5d8c-e614-43d4-8b26-e1612bc8e597
  • Loading branch information
kurtis.heimerl committed Dec 22, 2012
1 parent c697a01 commit 478221e
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 35 deletions.
19 changes: 10 additions & 9 deletions CLI/CLI.cpp
Expand Up @@ -284,14 +284,14 @@ int tmsis(int argc, char** argv, ostream& os)

int isIMSI(const char *imsi)
{
int i = 0;

if (!imsi)
return 0;
if (strlen(imsi) != 15)

size_t imsiLen = strlen(imsi);
if (imsiLen != 15)
return 0;

for (i = 0; i < strlen(imsi); i++) {
for (size_t i = 0; i < imsiLen; i++) {
if (!isdigit(imsi[i]))
return 0;
}
Expand Down Expand Up @@ -461,14 +461,15 @@ int cellID(int argc, char** argv, ostream& os)


/** Print table of current transactions. */
int calls(int argc, char** argv, ostream& os)
int calls(int argc, char** /*argv*/, ostream& os)
{
bool showAll = false;
if (argc==2) showAll = true;
if (argc>2) return BAD_NUM_ARGS;
size_t count = gTransactionTable.dump(os);
if (argc > 2)
return BAD_NUM_ARGS;

//fix later -kurtis
//bool showAll = (argc == 2);
//size_t count = gTransactionTable.dump(os,showAll);
size_t count = gTransactionTable.dump(os);
os << endl << count << " transactions in table" << endl;
return SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion CommonLibs/ConfigurationTest.cpp
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char *argv[])

gConfig.setUpdateHook(purgeConfig);

char *keys[5] = {"key1", "key2", "key3", "key4", "key5"};
const char *keys[5] = {"key1", "key2", "key3", "key4", "key5"};

for (int i=0; i<5; i++) {
gConfig.set(keys[i],i);
Expand Down
2 changes: 1 addition & 1 deletion CommonLibs/URLEncode.cpp
Expand Up @@ -35,7 +35,7 @@ string URLEncode(const string &c)
{
static const char *digits = "01234567890ABCDEF";
string retVal="";
for (int i=0; i<c.length(); i++)
for (size_t i=0; i<c.length(); i++)
{
const char ch = c[i];
if (isalnum(ch) || strchr("-_.!~'()",ch)) {
Expand Down
2 changes: 1 addition & 1 deletion GSM/GSML2LAPDm.h
Expand Up @@ -135,7 +135,7 @@ class CCCHL2 : public L2DL {

void writeLowSide(const GSM::L2Frame&) { assert(0); }

L3Frame* readHighSide(unsigned timeout=3600000) { assert(0); return NULL; }
L3Frame* readHighSide(unsigned /*timeout = 3600000*/) { assert(0); return NULL; }

void writeHighSide(const GSM::L3Frame&);

Expand Down
16 changes: 8 additions & 8 deletions SIP/SIPEngine.cpp
Expand Up @@ -214,7 +214,7 @@ void SIPEngine::saveResponse(osip_message_t *response)



void SIPEngine::saveBYE(const osip_message_t *BYE, bool mine)
void SIPEngine::saveBYE(const osip_message_t *BYE, bool /*mine*/)
{
// Instead of cloning, why not just keep the old one?
// Because that doesn't work in all calling contexts.
Expand All @@ -223,7 +223,7 @@ void SIPEngine::saveBYE(const osip_message_t *BYE, bool mine)
osip_message_clone(BYE,&mBYE);
}

void SIPEngine::saveCANCEL(const osip_message_t *CANCEL, bool mine)
void SIPEngine::saveCANCEL(const osip_message_t *CANCEL, bool /*mine*/)
{
// Instead of cloning, why not just keep the old one?
// Because that doesn't work in all calling contexts.
Expand All @@ -232,7 +232,7 @@ void SIPEngine::saveCANCEL(const osip_message_t *CANCEL, bool mine)
osip_message_clone(CANCEL,&mCANCEL);
}

void SIPEngine::saveERROR(const osip_message_t *ERROR, bool mine)
void SIPEngine::saveERROR(const osip_message_t *ERROR, bool /*mine*/)
{
// Instead of cloning, why not just keep the old one?
// Because that doesn't work in all calling contexts.
Expand Down Expand Up @@ -276,7 +276,7 @@ void SIPEngine::user( const char * wCallID, const char * IMSI, const char *origI
}


void SIPEngine::writePrivateHeaders(osip_message_t *msg, const GSM::LogicalChannel *chan)
void SIPEngine::writePrivateHeaders(osip_message_t *msg, const GSM::LogicalChannel* /*chan*/)
{
// P-PHY-Info
// This is a non-standard private header in OpenBTS.
Expand Down Expand Up @@ -474,7 +474,7 @@ SIPState SIPEngine::SOSSendINVITE(short wRtp_port, unsigned wCodec, const GSM::
gConfig.getStr("Control.Emergency.Geolocation").c_str());
osip_message_set_content_type(invite, strdup("application/pidf+xml"));
char tmp[20];
sprintf(tmp,"%u",strlen(xml));
sprintf(tmp,"%u", static_cast<unsigned>(strlen(xml)));
osip_message_set_content_length(invite, strdup(tmp));
osip_message_set_body(invite,xml,strlen(xml));
}
Expand All @@ -485,7 +485,7 @@ SIPState SIPEngine::SOSSendINVITE(short wRtp_port, unsigned wCodec, const GSM::
osip_message_free(invite);
mState = Starting;
return mState;
};
}


SIPState SIPEngine::MOCSendINVITE( const char * wCalledUsername,
Expand Down Expand Up @@ -526,7 +526,7 @@ SIPState SIPEngine::MOCSendINVITE( const char * wCalledUsername,
osip_message_free(invite);
mState = Starting;
return mState;
};
}


SIPState SIPEngine::MOCResendINVITE()
Expand Down Expand Up @@ -893,7 +893,7 @@ SIPState SIPEngine::MODWaitForCANCELOK(Mutex *lock)

static bool containsResponse(vector<unsigned> *validResponses, unsigned code)
{
for (int i = 0; i < validResponses->size(); i++) {
for (size_t i = 0; i < validResponses->size(); i++) {
if (validResponses->at(i) == code)
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions SIP/SIPMessage.cpp
Expand Up @@ -328,7 +328,7 @@ osip_message_t * SIP::sip_message( const char * dialed_number, const char * sip_
}

// Content-Length
sprintf(temp_buf,"%u",strlen(message));
sprintf(temp_buf,"%u", static_cast<unsigned>(strlen(message)));
osip_message_set_content_length(request, strdup(temp_buf));

// Payload.
Expand Down Expand Up @@ -645,7 +645,7 @@ osip_message_t * SIP::sip_ack(const char * req_uri, const char * dialed_number,
}


osip_message_t * SIP::sip_bye(const char * req_uri, const char * dialed_number, const char * sip_username, short wlocal_port, const char * local_ip, const char * proxy_ip, short wproxy_port, const osip_from_t* from_header, const osip_to_t* to_header, const char * via_branch, const osip_call_id_t* call_id_header, int cseq) {
osip_message_t * SIP::sip_bye(const char * req_uri, const char * dialed_number, const char * sip_username, short wlocal_port, const char * local_ip, const char * /*proxy_ip*/, short wproxy_port, const osip_from_t* from_header, const osip_to_t* to_header, const char * via_branch, const osip_call_id_t* call_id_header, int cseq) {

// FIXME -- We really need some NULL-value error checking in here.

Expand Down Expand Up @@ -1005,7 +1005,7 @@ osip_message_t * SIP::sip_ringing( osip_message_t * invite, const char * sip_use
}


osip_message_t * SIP::sip_okay( osip_message_t * inv, const char * sip_username, const char * local_ip, short wlocal_port)
osip_message_t * SIP::sip_okay( osip_message_t * inv, const char* /*sip_username*/, const char* /*local_ip*/, short wlocal_port)
{

// Check for consistency.
Expand Down Expand Up @@ -1048,7 +1048,7 @@ osip_message_t * SIP::sip_okay( osip_message_t * inv, const char * sip_username,
}


osip_message_t * SIP::sip_info(unsigned info, const char *dialed_number, short rtp_port, const char * sip_username, short wlocal_port, const char * local_ip, const char * proxy_ip, const char * from_tag, const char * via_branch, const osip_call_id_t *call_id_header, int cseq) {
osip_message_t * SIP::sip_info(unsigned info, const char *dialed_number, short /*rtp_port*/, const char * sip_username, short wlocal_port, const char * local_ip, const char * proxy_ip, const char * from_tag, const char * via_branch, const osip_call_id_t *call_id_header, int cseq) {

char local_port[10];
sprintf(local_port, "%i", wlocal_port);
Expand Down
2 changes: 1 addition & 1 deletion SIP/SIPUtility.cpp
Expand Up @@ -99,7 +99,7 @@ void SIP::make_branch( char * branch )
uint64_t r1 = random();
uint64_t r2 = random();
uint64_t val = (r1<<32) + r2;
sprintf(branch,"z9hG4bKobts28%llx", val);
sprintf(branch,"z9hG4bKobts28%llx", static_cast<long long unsigned int>(val));
}

/* get the return address from the SIP VIA header
Expand Down
4 changes: 2 additions & 2 deletions Transceiver52M/DummyLoad.cpp
Expand Up @@ -97,11 +97,11 @@ int DummyLoad::readSamples(short *buf, int len, bool *overrun,
underrunLock.unlock();
if (currstamp+len < timestamp) {
usleep(100);
return NULL;
return 0;
}
else if (currstamp < timestamp) {
usleep(100);
return NULL;
return 0;
}
else if (timestamp+len < currstamp) {
memcpy(buf,dummyBurst+dummyBurstCursor*2,sizeof(short)*2*(dummyBurstSz-dummyBurstCursor));
Expand Down
8 changes: 4 additions & 4 deletions TransceiverRAD1/DummyLoad.cpp
Expand Up @@ -86,22 +86,22 @@ bool DummyLoad::stop()


// NOTE: Assumes sequential reads
int DummyLoad::readSamples(short *buf, int len, bool *overrun,
int DummyLoad::readSamples(short *buf, int len, bool* /*overrun*/,
TIMESTAMP timestamp,
bool *wUnderrun,
unsigned *RSSI)
unsigned* /*RSSI*/)
{
updateTime();
underrunLock.lock();
*wUnderrun = underrun;
underrunLock.unlock();
if (currstamp+len < timestamp) {
usleep(100);
return NULL;
return 0;
}
else if (currstamp < timestamp) {
usleep(100);
return NULL;
return 0;
}
else if (timestamp+len < currstamp) {
memcpy(buf,dummyBurst+dummyBurstCursor*2,sizeof(short)*2*(dummyBurstSz-dummyBurstCursor));
Expand Down
4 changes: 2 additions & 2 deletions TransceiverRAD1/sigProcLib.h
Expand Up @@ -32,13 +32,13 @@
using namespace GSM;

/** Indicated signalVector symmetry */
typedef enum Symmetry {
enum Symmetry {
NONE = 0,
ABSSYM = 1
};

/** Convolution type indicator */
typedef enum ConvType {
enum ConvType {
FULL_SPAN = 0,
OVERLAP_ONLY = 1,
START_ONLY = 2,
Expand Down
4 changes: 2 additions & 2 deletions apps/OpenBTS.cpp
Expand Up @@ -116,8 +116,8 @@ void startTransceiver()

// Start the transceiver binary, if the path is defined.
// If the path is not defined, the transceiver must be started by some other process.
char TRXnumARFCN[4];
sprintf(TRXnumARFCN,"%1d",gConfig.getNum("GSM.Radio.ARFCNs"));
char TRXnumARFCN[16];
sprintf(TRXnumARFCN,"%1d", static_cast<int>(gConfig.getNum("GSM.Radio.ARFCNs")));
LOG(NOTICE) << "starting transceiver " << transceiverPath << " " << TRXnumARFCN;
gTransceiverPid = vfork();
LOG_ASSERT(gTransceiverPid>=0);
Expand Down

0 comments on commit 478221e

Please sign in to comment.