Commit 59037aef authored by yanmorin's avatar yanmorin

Fix amd64 issue (std::string::size_type return). Thanks to Pierre Pomes

parent 9ff9c76b
/**
* Copyright (C) 2005 Savoir-Faire Linux inc.
/*
* Copyright (C) 2005, 2006 Savoir-Faire Linux inc.
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
* Inspired by tonegenerator of
......@@ -20,6 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* YM: 2006-11-15: changes unsigned int to std::string::size_type, thanks to Pierre Pomes (AMD64 compilation)
*/
#include "tone.h"
#include <math.h>
......@@ -43,13 +46,13 @@ Tone::genBuffer(const std::string& definition)
SFLDataFormat* bufferPos = buffer;
// Number of format sections
unsigned int posStart = 0; // position of precedent comma
unsigned int posEnd = 0; // position of the next comma
std::string::size_type posStart = 0; // position of precedent comma
std::string::size_type posEnd = 0; // position of the next comma
std::string s; // portion of frequency
int count; // number of int for one sequence
unsigned int deflen = definition.length();
std::string::size_type deflen = definition.length();
do {
posEnd = definition.find(',', posStart);
if (posEnd == std::string::npos) {
......@@ -62,10 +65,10 @@ Tone::genBuffer(const std::string& definition)
s = definition.substr(posStart, posEnd-posStart);
// The 1st frequency is before the first + or the /
unsigned int pos_plus = s.find('+');
unsigned int pos_slash = s.find('/');
unsigned int len = s.length();
unsigned int endfrequency = 0;
std::string::size_type pos_plus = s.find('+');
std::string::size_type pos_slash = s.find('/');
std::string::size_type len = s.length();
std::string::size_type endfrequency = 0;
if ( pos_slash == std::string::npos ) {
time = 0;
......
......@@ -219,7 +219,7 @@ ConfigTree::populateFromFile(const std::string& fileName) {
std::string section("");
std::string key("");
std::string val("");
int pos;
std::string::size_type pos;
while (!file.eof()) {
// Read the file line by line
......
/*
* Author: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*/
/*
* 2006-11-15: add <string.h> declaration, thanks to Pierre Pomes (AMD64 compilation)
*/
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "display.h"
#include "setup.h"
......
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
/*
* Copyright (C) 2004, 2005, 2006 Savoir-Faire Linux inc.
* Author: Jean-Philippe Barrette-LaPierre
* <jean-philippe.barrette-lapierre@savoirfairelinux.com>
*
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -17,7 +18,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* YM: 2006-11-15: fix type for QString.length(), return a uint
* YM: 2006-11-15: commentunused variable
*/
#include <string>
#include <qurl.h>
......@@ -36,15 +40,14 @@ static uchar hex_to_int( uchar c )
void Url::decode( QString& url )
{
int oldlen = url.length();
uint oldlen = url.length();
if ( !oldlen )
return;
int newlen = 0;
// uint newlen = 0;
std::string newUrl;
int i = 0;
uint i = 0;
while ( i < oldlen ) {
ushort c = url[ i++ ].unicode();
if ( c == '%' ) {
......@@ -55,7 +58,7 @@ void Url::decode( QString& url )
c = ' ';
}
newUrl += c;
newlen++;
// newlen++;
}
url = QString::fromUtf8(newUrl.c_str());
......
......@@ -17,6 +17,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* YM: 2006-11-15: changes unsigned int to std::string::size_type, thanks to Pierre Pomes (AMD64 compilation)
*/
#include "sipvoiplink.h"
#include "eventthread.h"
#include "sipcall.h"
......@@ -1359,9 +1362,6 @@ SIPVoIPLink::SIPMessageNew(eXosip_event_t *event)
else if (MSG_IS_NOTIFY(event->request)){
_debug(" > NOTIFY Voice message\n");
int ii;
unsigned int pos;
unsigned int pos_slash;
osip_body_t *body = NULL;
// Get the message body
ii = osip_message_get_body(event->request, 0, &body);
......@@ -1375,6 +1375,8 @@ SIPVoIPLink::SIPMessageNew(eXosip_event_t *event)
return;
}
std::string str(body->body);
std::string::size_type pos;
std::string::size_type pos_slash;
pos = str.find(VOICE_MSG);
if (pos == std::string::npos) {
......@@ -1496,8 +1498,8 @@ SIPVoIPLink::handleDtmfRelay(eXosip_event_t* event) {
if (0 == osip_message_get_body(event->request, 0, &body) && body->body != 0 ) {
_debug("* SIP Info: Text body: %s\n", body->body);
std::string dtmfBody(body->body);
unsigned int posStart = 0;
unsigned int posEnd = 0;
std::string::size_type posStart = 0;
std::string::size_type posEnd = 0;
std::string signal;
std::string duration;
// search for signal=and duration=
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment