diff --git a/src/runtime/c/pgf/db.cxx b/src/runtime/c/pgf/db.cxx index 2f5f840d6..066340306 100644 --- a/src/runtime/c/pgf/db.cxx +++ b/src/runtime/c/pgf/db.cxx @@ -1559,8 +1559,8 @@ void PgfDB::commit(object o) object save_free_descriptors = ms->free_descriptors; object save_active_revision = ms->active_revision; - int res; #ifndef _WIN32 + int res; #ifndef MREMAP_MAYMOVE if (fd < 0) { ms->active_revision = o; diff --git a/src/runtime/c/pgf/parser.cxx b/src/runtime/c/pgf/parser.cxx index c1547f3c5..48ace5e87 100644 --- a/src/runtime/c/pgf/parser.cxx +++ b/src/runtime/c/pgf/parser.cxx @@ -989,4 +989,4 @@ PgfExpr PgfParser::fetch(PgfDB *db, prob_t *prob) } return 0; -} \ No newline at end of file +} diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index 0191b5dab..fdad8e59a 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -864,7 +864,7 @@ pgf_graphviz_word_alignment(PgfDB *db, PgfConcrRevision* revisions, size_t n_rev typedef struct { PgfText *phrase; - int n_fids; + size_t n_fids; int fids[]; } PgfAlignmentPhrase; diff --git a/src/runtime/c/pgf/probspace.cxx b/src/runtime/c/pgf/probspace.cxx index 78bc107e0..920f1caa5 100644 --- a/src/runtime/c/pgf/probspace.cxx +++ b/src/runtime/c/pgf/probspace.cxx @@ -220,7 +220,7 @@ bool probspace_random(PgfProbspace space, PgfText *cat, bool is_res = space->value.is_result(); if (is_res && !st->excluded.count(space->value.fun)) { - st->rand -= exp(-space->value.fun->prob); + st->rand -= expf(-space->value.fun->prob); st->result = space->value.fun; if (st->rand <= 0) return true; diff --git a/src/runtime/c/pgf/reader.cxx b/src/runtime/c/pgf/reader.cxx index 9e2010d7d..59d2b2f9b 100644 --- a/src/runtime/c/pgf/reader.cxx +++ b/src/runtime/c/pgf/reader.cxx @@ -79,7 +79,7 @@ prob_t PgfReader::read_prob(PgfText *name) if (probs_callback != NULL) { d = probs_callback->fn(probs_callback, name); } - return - log(d); + return - logf(d); } uint64_t PgfReader::read_uint() @@ -458,7 +458,7 @@ void PgfReader::read_abstract(ref abstract) for (size_t i = 0; i < itor.cats->len; i++) { PgfAbsCatCounts *counts = &itor.cats->data[i]; - counts->prob = - log((1-counts->probs_sum) / counts->n_nan_probs); + counts->prob = - logf((1-counts->probs_sum) / counts->n_nan_probs); } itor.fn = pad_probs; diff --git a/src/runtime/haskell/PGF2.hsc b/src/runtime/haskell/PGF2.hsc index b6a8680b1..13b8bd28d 100644 --- a/src/runtime/haskell/PGF2.hsc +++ b/src/runtime/haskell/PGF2.hsc @@ -501,7 +501,7 @@ alignWords c e = unsafePerformIO $ c_phrase <- (#peek PgfAlignmentPhrase, phrase) ptr phrase <- peekText c_phrase n_fids <- (#peek PgfAlignmentPhrase, n_fids) ptr - (fids :: [CInt]) <- peekArray (fromIntegral (n_fids :: CInt)) (ptr `plusPtr` (#offset PgfAlignmentPhrase, fids)) + (fids :: [CInt]) <- peekArray (fromIntegral (n_fids :: CSize)) (ptr `plusPtr` (#offset PgfAlignmentPhrase, fids)) free c_phrase free ptr return (phrase, map fromIntegral fids) diff --git a/src/runtime/python/ffi.c b/src/runtime/python/ffi.c index 4c1ec52fa..8dce9e33d 100644 --- a/src/runtime/python/ffi.c +++ b/src/runtime/python/ffi.c @@ -517,7 +517,7 @@ match_lit(PgfMarshaller *this, PgfUnmarshaller *u, PgfLiteral lit) Py_DECREF(intShifter); return 0; } - for (int n = size-1; n > 0; n--) { + for (size_t n = size-1; n > 0; n--) { PyObject *rem = PyNumber_Remainder(x, intShifter); if (!rem) { PyMem_RawFree(i);