[Ante-cvs] SF.net SVN: ante:[498] trunk/ant
Brought to you by:
roguestar191
|
From: <rog...@us...> - 2009-04-01 02:38:07
|
Revision: 498
http://ante.svn.sourceforge.net/ante/?rev=498&view=rev
Author: roguestar191
Date: 2009-04-01 02:37:58 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
Make compile with gcc 4.3.2
Modified Paths:
--------------
trunk/ant/ConfigFileParser.cpp
trunk/ant/cache.cpp
trunk/ant/cgiscript.cpp
trunk/ant/command.cpp
trunk/ant/command.h
trunk/ant/forum.cpp
trunk/ant/functors.h
trunk/ant/help.cpp
trunk/ant/httpd.cpp
trunk/ant/mud.h
trunk/ant/script.h
trunk/ant/socket.cpp
trunk/ant/socket.h
trunk/ant/tools.h
Modified: trunk/ant/ConfigFileParser.cpp
===================================================================
--- trunk/ant/ConfigFileParser.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/ConfigFileParser.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -22,6 +22,8 @@
#include "ConfigFileParser.h"
#include "tools.h"
#include "Logger.h"
+#include <stdio.h>
+#include <stdlib.h>
/*
* A static instance for this component.
Modified: trunk/ant/cache.cpp
===================================================================
--- trunk/ant/cache.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/cache.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -10,6 +10,7 @@
#include <iostream>
#include "Logger.h"
#include "ConfigFileParser.h"
+#include <langinfo.h>
inline void sreplace(std::string &in) {
size_t x = 0;
Modified: trunk/ant/cgiscript.cpp
===================================================================
--- trunk/ant/cgiscript.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/cgiscript.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -587,7 +587,7 @@
if(target.compare("this") != 0 && d.size() < 5) {
return "Target != this and no skill knowledge amount given";
}
- if(d.size() >=4)
+if(d.size() >=4) {
if(target.compare("this") == 0) { // {{{
std::string& amount = d[4];
std::string acmd;
@@ -617,6 +617,7 @@
return x->skills.setSkill(acmd);
} // }}}
} //}}}
+}
object&obj = *static_cast<object*>(callera);
std::string mytype = obj.myTypes();
if(d.size() >=4) {
Modified: trunk/ant/command.cpp
===================================================================
--- trunk/ant/command.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/command.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -21,6 +21,12 @@
#include "help.h" // helpsystem
Help Helper;
bool isWebbInput = false;
+// Add command overload for std::String {{{
+void commandI::addCommand(TFunctor *f, std::string *str) {
+ this->addCommand(f, const_cast<char *>(str->c_str()));
+}
+// }}}
+
// {{{ command interpretor constructor
commandI::commandI(mud *world_in) : object() {
//ALL commands must be first defined as a VIRTUAL function in object.h
@@ -290,7 +296,7 @@
}
// }}}
// {{{ addCommand - Add a command to the interpreter
-void commandI::addCommand(TFunctor *com, char *name){
+void commandI::addCommand(TFunctor *com, const char *name){
coms *newOne = new coms(com);
//use new() to make sure it doesn't get deleted when addCommad
//returns.
@@ -1388,7 +1394,7 @@
};
// }}}
// set a menu {{{
-std::string commandI::setMenu(char *name_in) {
+std::string commandI::setMenu(const char *name_in) {
std::string name;
name.append(name_in);
if(name[0] == 32) name.replace(0, 1, "");
Modified: trunk/ant/command.h
===================================================================
--- trunk/ant/command.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/command.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -76,7 +76,7 @@
class menu {
public:
menu() { selected = false; noescape = false; autoselect = false; defaultInput = false;};
- menu(char *n_in, char *d_in, char *e_in) {
+ menu(const char *n_in, const char *d_in, const char *e_in) {
selected = false;
noescape = false;
autoselect = false;
@@ -139,8 +139,8 @@
//if args is not supplied it assumes your function
//has no arguements (not even a void)
void help(std::vector<std::string *>*d); //help command, should read a help file
- void addCommand(TFunctor *com, char *name); //add a downcasted Functor, with an ACCESS NAMC and an enumerated ARGS type (see tools.h)
-
+ void addCommand(TFunctor *com, const char *name); //add a downcasted Functor, with an ACCESS NAMC and an enumerated ARGS type (see tools.h)
+ void addCommand(TFunctor *com, std::string *name);
void dummy(std::vector<std::string *> *d, int &sock_in);// {return;}; //first thing to be added to the vecto
void prompt();
void pcommands();//lists all the commands to the socket
@@ -162,7 +162,7 @@
//the args added at addMenu are appended when the
//menuitem is called
bool callMenu(std::string &name, std::string &args, std::string &s2manip);
- std::string setMenu(char *name); //force a menu set.
+ std::string setMenu(const char *name); //force a menu set.
std::string displaymenu(); //utility to display the current menu
void breakmenu(); //utility to force a break from all menus
virtual std::string display(std::string &s); //display info, defined in mob.cpp
Modified: trunk/ant/forum.cpp
===================================================================
--- trunk/ant/forum.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/forum.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -2,6 +2,7 @@
#include "tools.h"
#include <vector>
#include "mob.h"
+#include <algorithm>
extern ssize_t msend(int &socket, const char *buf, size_t size, int opts);
bool forum::forum::UserStack::find(std::string &cookie) {
for(std::vector<forum::forum::UserStack::User>::iterator iter =
Modified: trunk/ant/functors.h
===================================================================
--- trunk/ant/functors.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/functors.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -20,6 +20,9 @@
#ifdef FUNCTORS_INC
#else
#define FUNCTORS_INC 1
+#include <stdio.h>
+#include <stdlib.h>
+
class TFunctor {
public:
Attributes attribs;
Modified: trunk/ant/help.cpp
===================================================================
--- trunk/ant/help.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/help.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -1,6 +1,10 @@
#include "help.h"
#include "tools.h"
#include <iomanip>
+#include <algorithm>
+#include <stdio.h>
+#include <stdlib.h>
+
class Helper {
friend class Help;
public:
Modified: trunk/ant/httpd.cpp
===================================================================
--- trunk/ant/httpd.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/httpd.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -1122,7 +1122,7 @@
} catch (const char *msg) {
std::string error; error.append( msg );
error.append("<BR>");
- char *bmp = "BADPASS";
+ const char *bmp = "BADPASS";
if(memcmp(bmp, msg, 7) == 0) {
std::string code;
std::string content_type;
Modified: trunk/ant/mud.h
===================================================================
--- trunk/ant/mud.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/mud.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -29,6 +29,12 @@
#include "objects.h" //objects.h doesn't have to include anything.
//but everything must include mud.h because
#include "forum.h" //of that
+#include <stdio.h>
+#include <stdlib.h>
+#include <cstdlib>
+#include <cstring>
+#include <algorithm>
+
//#include "phpscript.h"
//class phpCom;
class login {
Modified: trunk/ant/script.h
===================================================================
--- trunk/ant/script.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/script.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -8,6 +8,8 @@
#include <cstdlib>
#include <stdio.h>
#include <assert.h>
+#include <memory.h>
+#include <algorithm>
extern char* itoa( int value, char* result, int base=10);
extern char* ltoa( long long int value, char* result, int base=10);
// Large introduction comments {{{
Modified: trunk/ant/socket.cpp
===================================================================
--- trunk/ant/socket.cpp 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/socket.cpp 2009-04-01 02:37:58 UTC (rev 498)
@@ -159,8 +159,8 @@
#define ERROR(s) {printf("%d-",errno); perror(s); return false;}
#define ERROR2(s) {printf("%d-",errno); perror(s); return;}
//create the socket handeler.. do nothing else {{{
-playersocket::playersocket(char *port) {
- DEFAULT_SERVER_PORT = port;
+playersocket::playersocket(const char *port) {
+ DEFAULT_SERVER_PORT = const_cast<char *>(port);
maxfd = 10000; // about 9000 max connections?
// serverorclient = true;
sockVec = new std::vector<playersocket::sockholder>();
Modified: trunk/ant/socket.h
===================================================================
--- trunk/ant/socket.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/socket.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -105,7 +105,7 @@
std::vector<playersocket::sockholder> *sockVec;
public: //create the server object
size_t getSize() { return sockVec->size(); };
- playersocket(char *port);
+ playersocket(const char *port);
playersocket(bool clientmode);
~playersocket();
std::string getSockAddr(int socket);
Modified: trunk/ant/tools.h
===================================================================
--- trunk/ant/tools.h 2008-05-03 19:27:27 UTC (rev 497)
+++ trunk/ant/tools.h 2009-04-01 02:37:58 UTC (rev 498)
@@ -123,7 +123,7 @@
bool writeFile(std::string filename, std::string &buf, bool data=true);
bool fileExists(std::string filename, bool data=true);
std::string readFile(std::string filename, bool data=true, void *httpdobj = NULL);
- void rawWrite(std::string fname, char *data, bool data=true); // don't use
+ void rawWrite(std::string fname, char *data, bool datab=true); // don't use
std::vector<char> rawread(std::string fname, bool data=true);
};
extern gtools Utils; //a global object based on that class
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|