summaryrefslogtreecommitdiff
path: root/tools/thirdparty/OpenFst/fst/lib/symbol-table.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-05-28 23:04:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-28 23:04:55 +0000
commit8716b70bb7a580dd667247add717ff0b6ac2c5fe (patch)
tree9d5de85848329c642530920d2f4d4f78b486c564 /tools/thirdparty/OpenFst/fst/lib/symbol-table.h
parentf644e7f5def7f31790f38e00658664d2b5606f01 (diff)
parent73018b4a1d088cdda0e7bd059fddf1f308a8195a (diff)
downloadsrec-8716b70bb7a580dd667247add717ff0b6ac2c5fe.tar.gz
Merge "Fix 64-bit issues and compiler warnings."
Diffstat (limited to 'tools/thirdparty/OpenFst/fst/lib/symbol-table.h')
-rw-r--r--tools/thirdparty/OpenFst/fst/lib/symbol-table.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/thirdparty/OpenFst/fst/lib/symbol-table.h b/tools/thirdparty/OpenFst/fst/lib/symbol-table.h
index 0a67f29..50b3bd1 100644
--- a/tools/thirdparty/OpenFst/fst/lib/symbol-table.h
+++ b/tools/thirdparty/OpenFst/fst/lib/symbol-table.h
@@ -19,11 +19,10 @@
#ifndef FST_LIB_SYMBOL_TABLE_H__
#define FST_LIB_SYMBOL_TABLE_H__
-#include <ext/hash_map>
-using __gnu_cxx::hash_map;
#include <fstream>
#include <iostream>
#include <string>
+#include <unordered_map>
#include <vector>
#include "fst/lib/compat.h"
@@ -70,7 +69,7 @@ class SymbolTableImpl {
// Return the string associated with the key. If the key is out of
// range (<0, >max), return an empty string.
string Find(int64 key) const {
- hash_map<int64, string>::const_iterator it =
+ std::unordered_map<int64, string>::const_iterator it =
key_map_.find(key);
if (it == key_map_.end()) {
return "";
@@ -89,7 +88,7 @@ class SymbolTableImpl {
// Return the key associated with the symbol. If the symbol
// does not exists, return -1.
int64 Find(const char* symbol) const {
- hash_map<string, int64>::const_iterator it =
+ unordered_map<string, int64>::const_iterator it =
symbol_map_.find(symbol);
if (it == symbol_map_.end()) {
return -1;
@@ -126,8 +125,8 @@ class SymbolTableImpl {
string name_;
int64 available_key_;
vector<const char *> symbols_;
- hash_map<int64, string> key_map_;
- hash_map<string, int64> symbol_map_;
+ std::unordered_map<int64, string> key_map_;
+ std::unordered_map<string, int64> symbol_map_;
mutable int ref_count_;
mutable bool check_sum_finalized_;
@@ -376,7 +375,7 @@ inline bool CompatSymbols(const SymbolTable *syms1,
return true;
else if (!syms1 && !syms2)
return true;
- else if (syms1 && !syms2 || !syms1 && syms2)
+ else if ((syms1 && !syms2) || (!syms1 && syms2))
return false;
else
return syms1->CheckSum() == syms2->CheckSum();