Added include guards to all class headers.

Removed unnecessary or potentially harmful compiler flags. 
Added alignment attribute to all old struct members. 
Removed some unused variables. 
Made some switch statements handle all or more cases. 
Removed using declarations in favor of fully qualified names. 
Fixed a couple of assignments in conditionals that should have been comparisons. 
Eliminated linker warnings by restoring default linking of standard libraries. 
Fixed some comparisons between signed and unsigned integers. 

Note: No testing has been done, in particular of old file I/O. This should be checked for regression caused by alteration of old struct definitions. 


git-svn-id: http://openexile.googlecode.com/svn/trunk@63 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Niemand
2009-05-22 03:01:05 +00:00
parent 8ddf7eccc6
commit f198b4899d
57 changed files with 691 additions and 580 deletions

View File

@@ -6,7 +6,12 @@
*
*/
#ifndef ITEM_H
#define ITEM_H
#include "location.h"
#include <string>
#include <iostream>
namespace legacy { struct item_record_type; };
@@ -201,8 +206,8 @@ public:
unsigned char weight;
unsigned char special_class;
location item_loc;
string full_name;
string name;
std::string full_name;
std::string name;
unsigned char treas_class;
unsigned char item_properties;
private:
@@ -230,16 +235,16 @@ public:
cItemRec();
cItemRec(long preset);
cItemRec& operator = (legacy::item_record_type& old);
void writeTo(ostream& file, string prefix = "");
void readAttrFrom(string cur, istream& sin);
void writeTo(std::ostream& file, std::string prefix = "");
void readAttrFrom(std::string cur, std::istream& sin);
};
ostream& operator << (ostream& out, eWeapType& e);
ostream& operator << (ostream& out, eItemType& e);
ostream& operator << (ostream& out, eItemAbil& e);
istream& operator >> (istream& in, eWeapType& e);
istream& operator >> (istream& in, eItemType& e);
istream& operator >> (istream& in, eItemAbil& e);
std::ostream& operator << (std::ostream& out, eWeapType& e);
std::ostream& operator << (std::ostream& out, eItemType& e);
std::ostream& operator << (std::ostream& out, eItemAbil& e);
std::istream& operator >> (std::istream& in, eWeapType& e);
std::istream& operator >> (std::istream& in, eItemType& e);
std::istream& operator >> (std::istream& in, eItemAbil& e);
/*
typedef struct {
@@ -254,3 +259,5 @@ istream& operator >> (istream& in, eItemAbil& e);
unsigned char magic_use_type, ability_strength, treas_class, real_abil;
} short_item_record_type;
*/
#endif