mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 17:07:17 -05:00
Fixed compilation for Clang.
This commit is contained in:
parent
d696f72533
commit
5e94c772b3
@ -225,20 +225,13 @@ private:
|
|||||||
void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ;
|
void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ;
|
||||||
|
|
||||||
static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item);
|
static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item);
|
||||||
#ifdef __APPLE__
|
|
||||||
public:
|
|
||||||
#endif
|
|
||||||
class nullstream: public std::ostream {};
|
|
||||||
|
|
||||||
std::ostream& grouter_debug() const
|
std::ostream& grouter_debug() const
|
||||||
{
|
{
|
||||||
static nullstream null ;
|
static std::ostream null(0);
|
||||||
|
|
||||||
return _debug_enabled?(std::cerr):null;
|
return _debug_enabled?(std::cerr):null;
|
||||||
}
|
}
|
||||||
#ifdef __APPLE__
|
|
||||||
private:
|
|
||||||
#endif
|
|
||||||
void routePendingObjects() ;
|
void routePendingObjects() ;
|
||||||
void handleTunnels() ;
|
void handleTunnels() ;
|
||||||
void autoWash() ;
|
void autoWash() ;
|
||||||
@ -364,5 +357,3 @@ private:
|
|||||||
|
|
||||||
uint64_t _random_salt ;
|
uint64_t _random_salt ;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> p3GRouter::nullstream& operator<<(p3GRouter::nullstream& ns,const T&) { return ns ; }
|
|
||||||
|
@ -366,11 +366,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
|||||||
#ifdef LOCALNET_TESTING
|
#ifdef LOCALNET_TESTING
|
||||||
>> parameter('R',"restrict-port" ,portRestrictions ,"port1-port2","Apply port restriction" ,false)
|
>> parameter('R',"restrict-port" ,portRestrictions ,"port1-port2","Apply port restriction" ,false)
|
||||||
#endif
|
#endif
|
||||||
#ifdef __APPLE__
|
|
||||||
>> help('h',"help","Display this Help") ;
|
>> help('h',"help","Display this Help") ;
|
||||||
#else
|
|
||||||
>> help() ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
as.defaultErrorHandling(true) ;
|
as.defaultErrorHandling(true) ;
|
||||||
|
|
||||||
|
@ -140,16 +140,11 @@ namespace
|
|||||||
protected:
|
protected:
|
||||||
inline OptionHolder(char s,
|
inline OptionHolder(char s,
|
||||||
const char* l,
|
const char* l,
|
||||||
const char* desc);
|
const char* desc);
|
||||||
#ifdef __APPLE__
|
|
||||||
friend OptionHolder help(char s,
|
friend OptionHolder help(char s,
|
||||||
const char* l,
|
const char* l,
|
||||||
const char* desc);
|
const char* desc);
|
||||||
#else
|
|
||||||
friend OptionHolder help(char s='h',
|
|
||||||
const char* l="help",
|
|
||||||
const char* desc="Display this help");
|
|
||||||
#endif
|
|
||||||
private:
|
private:
|
||||||
std::string shortName_;
|
std::string shortName_;
|
||||||
std::string longName_;
|
std::string longName_;
|
||||||
|
@ -259,7 +259,7 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
|
static void convolveWithGaussian(double *forceMap,unsigned int S,int /*s*/)
|
||||||
{
|
{
|
||||||
static double *bf = NULL ;
|
static double *bf = NULL ;
|
||||||
|
|
||||||
@ -267,8 +267,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
|
|||||||
{
|
{
|
||||||
bf = new double[S*S*2] ;
|
bf = new double[S*S*2] ;
|
||||||
|
|
||||||
for(int i=0;i<S;++i)
|
for(unsigned int i=0;i<S;++i)
|
||||||
for(int j=0;j<S;++j)
|
for(unsigned int j=0;j<S;++j)
|
||||||
{
|
{
|
||||||
int x = (i<S/2)?i:(S-i) ;
|
int x = (i<S/2)?i:(S-i) ;
|
||||||
int y = (j<S/2)?j:(S-j) ;
|
int y = (j<S/2)?j:(S-j) ;
|
||||||
@ -284,8 +284,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
|
|||||||
unsigned long nn[2] = {S,S};
|
unsigned long nn[2] = {S,S};
|
||||||
fourn(&forceMap[-1],&nn[-1],2,1) ;
|
fourn(&forceMap[-1],&nn[-1],2,1) ;
|
||||||
|
|
||||||
for(int i=0;i<S;++i)
|
for(unsigned int i=0;i<S;++i)
|
||||||
for(int j=0;j<S;++j)
|
for(unsigned int j=0;j<S;++j)
|
||||||
{
|
{
|
||||||
float a = forceMap[2*(i+S*j)]*bf[2*(i+S*j)] - forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)+1] ;
|
float a = forceMap[2*(i+S*j)]*bf[2*(i+S*j)] - forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)+1] ;
|
||||||
float b = forceMap[2*(i+S*j)]*bf[2*(i+S*j)+1] + forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)] ;
|
float b = forceMap[2*(i+S*j)]*bf[2*(i+S*j)+1] + forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)] ;
|
||||||
@ -296,7 +296,7 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
|
|||||||
|
|
||||||
fourn(&forceMap[-1],&nn[-1],2,-1) ;
|
fourn(&forceMap[-1],&nn[-1],2,-1) ;
|
||||||
|
|
||||||
for(int i=0;i<S*S*2;++i)
|
for(unsigned int i=0;i<S*S*2;++i)
|
||||||
forceMap[i] /= S*S;
|
forceMap[i] /= S*S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,21 +362,21 @@ Rshare::showUsageMessageBox()
|
|||||||
out << "<table>";
|
out << "<table>";
|
||||||
//out << trow(tcol("-"ARG_HELP) +
|
//out << trow(tcol("-"ARG_HELP) +
|
||||||
// tcol(tr("Displays this usage message and exits.")));
|
// tcol(tr("Displays this usage message and exits.")));
|
||||||
out << trow(tcol("-"ARG_RESET) +
|
out << trow(tcol("-" ARG_RESET) +
|
||||||
tcol(tr("Resets ALL stored RetroShare settings.")));
|
tcol(tr("Resets ALL stored RetroShare settings.")));
|
||||||
out << trow(tcol("-"ARG_DATADIR" <dir>") +
|
out << trow(tcol("-" ARG_DATADIR" <dir>") +
|
||||||
tcol(tr("Sets the directory RetroShare uses for data files.")));
|
tcol(tr("Sets the directory RetroShare uses for data files.")));
|
||||||
out << trow(tcol("-"ARG_LOGFILE" <file>") +
|
out << trow(tcol("-" ARG_LOGFILE" <file>") +
|
||||||
tcol(tr("Sets the name and location of RetroShare's logfile.")));
|
tcol(tr("Sets the name and location of RetroShare's logfile.")));
|
||||||
out << trow(tcol("-"ARG_LOGLEVEL" <level>") +
|
out << trow(tcol("-" ARG_LOGLEVEL" <level>") +
|
||||||
tcol(tr("Sets the verbosity of RetroShare's logging.") +
|
tcol(tr("Sets the verbosity of RetroShare's logging.") +
|
||||||
"<br>[" + Log::logLevels().join("|") +"]"));
|
"<br>[" + Log::logLevels().join("|") +"]"));
|
||||||
out << trow(tcol("-"ARG_GUISTYLE" <style>") +
|
out << trow(tcol("-" ARG_GUISTYLE" <style>") +
|
||||||
tcol(tr("Sets RetroShare's interface style.") +
|
tcol(tr("Sets RetroShare's interface style.") +
|
||||||
"<br>[" + QStyleFactory::keys().join("|") + "]"));
|
"<br>[" + QStyleFactory::keys().join("|") + "]"));
|
||||||
out << trow(tcol("-"ARG_GUISTYLESHEET" <stylesheet>") +
|
out << trow(tcol("-" ARG_GUISTYLESHEET" <stylesheet>") +
|
||||||
tcol(tr("Sets RetroShare's interface stylesheets.")));
|
tcol(tr("Sets RetroShare's interface stylesheets.")));
|
||||||
out << trow(tcol("-"ARG_LANGUAGE" <language>") +
|
out << trow(tcol("-" ARG_LANGUAGE" <language>") +
|
||||||
tcol(tr("Sets RetroShare's language.") +
|
tcol(tr("Sets RetroShare's language.") +
|
||||||
"<br>[" + LanguageSupport::languageCodes().join("|") + "]"));
|
"<br>[" + LanguageSupport::languageCodes().join("|") + "]"));
|
||||||
out << "</table>";
|
out << "</table>";
|
||||||
|
@ -86,11 +86,8 @@ int main(int argc, char **argv)
|
|||||||
// unfinished
|
// unfinished
|
||||||
//args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false);
|
//args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false);
|
||||||
args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)");
|
args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)");
|
||||||
#ifdef __APPLE__
|
|
||||||
args >> help('h',"help","Display this Help");
|
args >> help('h',"help","Display this Help");
|
||||||
#else
|
|
||||||
args >> help();
|
|
||||||
#endif
|
|
||||||
if (args.helpRequested())
|
if (args.helpRequested())
|
||||||
{
|
{
|
||||||
std::cerr << args.usage() << std::endl;
|
std::cerr << args.usage() << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user