1
0
forked from GitHub/gf-core

Merge branch 'majestic' of github.com:GrammaticalFramework/gf-core into majestic

This commit is contained in:
Krasimir Angelov
2023-05-11 05:54:30 +02:00
7 changed files with 8 additions and 8 deletions

View File

@@ -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;

View File

@@ -989,4 +989,4 @@ PgfExpr PgfParser::fetch(PgfDB *db, prob_t *prob)
}
return 0;
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<PgfAbstr> 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;

View File

@@ -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)

View File

@@ -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);