Commit 4e89d233 by alokp@chromium.org

Cleaned up Common.h. Removed unnecessary includes and typedefs. Removed tabs…

Cleaned up Common.h. Removed unnecessary includes and typedefs. Removed tabs from PoolAlloc.h and replaced UINT_PTR with uintptr_t. Review URL: http://codereview.appspot.com/1221041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@289 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent cff1aff5
......@@ -7,46 +7,17 @@
#ifndef _COMMON_INCLUDED_
#define _COMMON_INCLUDED_
#ifdef _WIN32
#include <basetsd.h>
#elif defined (solaris)
#include <sys/int_types.h>
#define UINT_PTR uintptr_t
#else
#include <stdint.h>
#define UINT_PTR uintptr_t
#endif
/* windows only pragma */
#ifdef _MSC_VER
#pragma warning(disable : 4786) // Don't warn about too long identifiers
#pragma warning(disable : 4514) // unused inline method
#pragma warning(disable : 4201) // nameless union
#endif
#include <assert.h>
#include <stdio.h>
//
// Doing the push and pop below for warnings does not leave the warning state
// the way it was. This seems like a defect in the compiler. We would like
// to do this, but since it does not work correctly right now, it is turned
// off.
//
//??#pragma warning(push, 3)
#include <map>
#include <string>
#include <vector>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <string>
#include <stdio.h>
//??#pragma warning(pop)
#include "compiler/PoolAlloc.h"
typedef int TSourceLoc;
#include <assert.h>
#include "compiler/PoolAlloc.h"
//
// Put POOL_ALLOCATOR_NEW_DELETE in base classes to make them use this scheme.
//
......@@ -82,20 +53,6 @@ public:
TVector(size_type i): std::vector<T, pool_allocator<T> >(i) {}
};
template <class T> class TList : public std::list<T, pool_allocator<T> > {
public:
typedef typename std::list<T, pool_allocator<T> >::size_type size_type;
TList() : std::list<T, pool_allocator<T> >() {}
TList(const pool_allocator<T>& a) : std::list<T, pool_allocator<T> >(a) {}
TList(size_type i): std::list<T, pool_allocator<T> >(i) {}
};
// This is called TStlSet, because TSet is taken by an existing compiler class.
template <class T, class CMP> class TStlSet : public std::set<T, CMP, pool_allocator<T> > {
// No pool allocator versions of constructors in std::set.
};
template <class K, class D, class CMP = std::less<K> >
class TMap : public std::map<K, D, CMP, pool_allocator<std::pair<const K, D> > > {
public:
......@@ -113,12 +70,6 @@ public:
typedef std::basic_string<char> TPersistString;
//
// templatized min and max functions.
//
template <class T> T Min(const T a, const T b) { return a < b ? a : b; }
template <class T> T Max(const T a, const T b) { return a > b ? a : b; }
//
// Create a TString object from an integer.
//
inline const TString String(const int i, const int base = 10)
......
......@@ -7,6 +7,8 @@
#ifndef CROSSCOMPILERGLSL_OUTPUTGLSL_H_
#define CROSSCOMPILERGLSL_OUTPUTGLSL_H_
#include <set>
#include "compiler/intermediate.h"
#include "compiler/ParseHelper.h"
......
......@@ -7,6 +7,9 @@
#ifndef COMPILER_OUTPUTHLSL_H_
#define COMPILER_OUTPUTHLSL_H_
#include <list>
#include <set>
#include "compiler/intermediate.h"
#include "compiler/ParseHelper.h"
......
......@@ -244,7 +244,7 @@ public:
totalSize = size;
if (isArray())
totalSize *= Max(getArraySize(), getMaxArraySize());
totalSize *= std::max(getArraySize(), getMaxArraySize());
return totalSize;
}
......
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