fix compilation error on gcc 4.1, fix warnings in mert

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@813 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
redpony 2006-09-12 19:46:16 +00:00
parent c69cfaf33e
commit 7d50d155dc
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include "data.h"
#include "point.h"
@ -215,7 +216,7 @@ point_t *line_optimize(data_t *data, point_t *origin, point_t *dir) {
if (intersection_n == 0)
best_x = 0.0;
else {
qsort(intersections, intersection_n, sizeof(intersection_t *), compare_intersections);
qsort(intersections, intersection_n, sizeof(intersection_t *), (int(*)(const void *, const void *))compare_intersections);
best_x = intersections[0]->x - 1000.0; // whatever
}
for (intersection_i = 0; intersection_i < intersection_n; intersection_i++) {
@ -304,8 +305,8 @@ point_t *optimize_powell(data_t *data, point_t *point) {
if (extrapolatedwin > 0 &&
2*(2*totalwin - extrapolatedwin) *
powf(totalwin - biggestwin, 2.0) <
powf(extrapolatedwin, 2.0)*biggestwin) {
powf(totalwin - biggestwin, 2.0f) <
powf(extrapolatedwin, 2.0f)*biggestwin) {
// replace dominant direction vector with sum vector
point_delete(u[biggestwin_i]);
point_normalize(point);

View File

@ -1,5 +1,6 @@
using namespace std;
#include <cassert>
#include <iomanip>
#include <iostream>
#include <fstream>