Fix compilation warnings and a couple of errors due to GCC -pedantic flags
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1329 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
61df7cd551
commit
99135b1237
39 changed files with 77 additions and 188 deletions
|
@ -138,67 +138,14 @@ void XMLSerializer::fill_doc(xmlDocPtr doc, const History& hist)
|
|||
* Creates a DTD declaration. Isn't mandatory.
|
||||
*/
|
||||
xmlDtdPtr dtd = xmlCreateIntSubset(doc, (const xmlChar *) "sgpem", NULL, (const xmlChar *) "sgpem.dtd");
|
||||
|
||||
//TODO: check for DTD compliance??
|
||||
|
||||
XMLVisitor xvisit(root_node);
|
||||
xvisit.from_history(hist);
|
||||
/*
|
||||
//
|
||||
// xmlNewChild() creates a new node, which is "attached" as child node
|
||||
// of root_node node.
|
||||
//
|
||||
xmlNodePtr resources_node = xmlNewChild(root_node, NULL, (const xmlChar *) "resources", NULL);
|
||||
//
|
||||
// The same as above, but the new child node doesn't have a content
|
||||
//
|
||||
xmlNodePtr schedulables_node = xmlNewChild(root_node, NULL, (const xmlChar *) "schedulables", NULL);
|
||||
|
||||
fill_resources(resources_node, hist);
|
||||
fill_schedulables(schedulables_node, hist);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
void XMLSerializer::fill_resources(xmlNodePtr resources_node, const History& hist)
|
||||
{
|
||||
|
||||
|
||||
const Environment& env = hist.get_last_environment();
|
||||
|
||||
const Environment::Resources& rvect = env.get_resources();
|
||||
typedef Environment::Resources::const_iterator res_iterator;
|
||||
|
||||
res_iterator iter = rvect.begin();
|
||||
res_iterator end = rvect.end();
|
||||
while(iter!=end)
|
||||
{
|
||||
XMLVisitor xvisit(resources_node);
|
||||
Glib::ustring key;
|
||||
int_to_string((int)(*iter).first, key);
|
||||
xvisit.from_resource(*((*iter).second), key);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
void XMLSerializer::fill_schedulables(xmlNodePtr schedulables_node, const History& hist)
|
||||
{
|
||||
|
||||
|
||||
const Environment& env = hist.get_last_environment();
|
||||
|
||||
const Environment::Processes& pvect = env.get_processes();
|
||||
typedef std::vector<Process*>::const_iterator proc_iterator;
|
||||
|
||||
proc_iterator iter = pvect.begin();
|
||||
proc_iterator end = pvect.end();
|
||||
while(iter!=end)
|
||||
{
|
||||
XMLVisitor xvisit(schedulables_node);
|
||||
xvisit.from_process(*(*iter));
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(SerializerError)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -86,7 +86,7 @@ XMLSerializerFactory::create_resource(Parameters& parameters)
|
|||
int arrival_time = 0;
|
||||
int how_many = 1;
|
||||
bool preemptable = false;
|
||||
int old_key;
|
||||
int old_key = 0;
|
||||
Parameters::iterator pos;
|
||||
|
||||
// read "name" property
|
||||
|
|
|
@ -44,7 +44,7 @@ XMLVisitor::~XMLVisitor()
|
|||
{
|
||||
}
|
||||
|
||||
void XMLVisitor::from_resource(const Resource& obj) throw(SerializerError)
|
||||
void XMLVisitor::from_resource(const Resource& /*obj*/) throw(SerializerError)
|
||||
{
|
||||
throw SerializerError(
|
||||
_("XMLVisitor: unsupported method from_resource(const Resource& obj)")
|
||||
|
@ -203,8 +203,7 @@ void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj) throw(Seria
|
|||
while (iter != end)
|
||||
{
|
||||
const Thread* t = *iter;
|
||||
|
||||
from_thread(threads_node, *(*iter));
|
||||
from_thread(threads_node, *t);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
@ -244,8 +243,7 @@ void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) throw(Seriali
|
|||
while (iter != end)
|
||||
{
|
||||
const Request* r = *iter;
|
||||
|
||||
from_request(requests_node, *(*iter));
|
||||
from_request(requests_node, *r);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +276,7 @@ void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj) throw(Seria
|
|||
while (iter != end)
|
||||
{
|
||||
const SubRequest* sr = *iter;
|
||||
from_subrequest(request_node, *(*iter));
|
||||
from_subrequest(request_node, *sr);
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue