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:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-14 09:00:47 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-14 09:00:47 +0400
commitbe1506e7595bd8602a3aec3469a2407c3453d0b2 (patch)
tree24b16fa17391e57839f5d7e0ac5dcfb2f3db6dcc /mert/Util.cpp
parent0c7a38d9d252861e7fa7c3973a4737eb6b915279 (diff)
Use passing objects by const references not passing by their values.
Diffstat (limited to 'mert/Util.cpp')
-rw-r--r--mert/Util.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/mert/Util.cpp b/mert/Util.cpp
index dc4824559..a5d68713e 100644
--- a/mert/Util.cpp
+++ b/mert/Util.cpp
@@ -16,7 +16,7 @@ using namespace std;
// global variables
Timer g_timer;
-int verbose=0;
+int verbose = 0;
namespace {
@@ -34,7 +34,7 @@ int verboselevel()
int setverboselevel(int v)
{
- verbose=v;
+ verbose = v;
return verbose;
}
@@ -74,18 +74,16 @@ 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;
+ 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;