Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mert/Util.cpp')
-rw-r--r--mert/Util.cpp31
1 files changed, 7 insertions, 24 deletions
diff --git a/mert/Util.cpp b/mert/Util.cpp
index 63b10d7be..5142b526a 100644
--- a/mert/Util.cpp
+++ b/mert/Util.cpp
@@ -11,29 +11,28 @@
using namespace std;
-// global variables
-Timer g_timer;
-
-int verbose = 0;
-
namespace {
+Timer g_timer;
+int g_verbose = 0;
+
bool FindDelimiter(const std::string &str, const std::string &delim, size_t *pos)
{
*pos = str.find(delim);
return *pos != std::string::npos ? true : false;
}
+
} // namespace
int verboselevel()
{
- return verbose;
+ return g_verbose;
}
int setverboselevel(int v)
{
- verbose = v;
- return verbose;
+ g_verbose = v;
+ return g_verbose;
}
size_t getNextPound(std::string &str, std::string &substr,
@@ -73,22 +72,6 @@ void Tokenize(const char *str, const char delim,
}
}
-int swapbytes(char *p, int sz, int n)
-{
- char c, *l, *h;
-
- if((n < 1) || (sz < 2)) return 0;
- for (; n--; p += sz) {
- for (h = (l = p) + sz; --h > l; l++) {
- c = *h;
- *h = *l;
- *l = c;
- }
- }
- return 0;
-
-}
-
void ResetUserTime()
{
g_timer.start();