forked from GitHub/gf-core
use size_t consistently as the type for constituent indices in the C runtime
This commit is contained in:
@@ -16,7 +16,7 @@ pgf_match_string_lit(PgfConcr* concr, PgfItem* item, PgfToken tok,
|
|||||||
{
|
{
|
||||||
GuPool* tmp_pool = gu_new_pool();
|
GuPool* tmp_pool = gu_new_pool();
|
||||||
|
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
PgfSequence seq;
|
PgfSequence seq;
|
||||||
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
||||||
gu_assert(lin_idx == 0);
|
gu_assert(lin_idx == 0);
|
||||||
@@ -64,7 +64,7 @@ pgf_match_int_lit(PgfConcr* concr, PgfItem* item, PgfToken tok,
|
|||||||
{
|
{
|
||||||
GuPool* tmp_pool = gu_new_pool();
|
GuPool* tmp_pool = gu_new_pool();
|
||||||
|
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
PgfSequence seq;
|
PgfSequence seq;
|
||||||
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
||||||
gu_assert(lin_idx == 0);
|
gu_assert(lin_idx == 0);
|
||||||
@@ -121,7 +121,7 @@ pgf_match_float_lit(PgfConcr* concr, PgfItem* item, PgfToken tok,
|
|||||||
{
|
{
|
||||||
GuPool* tmp_pool = gu_new_pool();
|
GuPool* tmp_pool = gu_new_pool();
|
||||||
|
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
PgfSequence seq;
|
PgfSequence seq;
|
||||||
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
pgf_item_sequence(item, &lin_idx, &seq, tmp_pool);
|
||||||
gu_assert(lin_idx == 0);
|
gu_assert(lin_idx == 0);
|
||||||
@@ -176,7 +176,7 @@ static bool
|
|||||||
pgf_match_name_lit(PgfConcr* concr, PgfItem* item, PgfToken tok,
|
pgf_match_name_lit(PgfConcr* concr, PgfItem* item, PgfToken tok,
|
||||||
PgfExprProb** out_ep, GuPool *pool)
|
PgfExprProb** out_ep, GuPool *pool)
|
||||||
{
|
{
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
PgfSequence seq;
|
PgfSequence seq;
|
||||||
pgf_item_sequence(item, &lin_idx, &seq, pool);
|
pgf_item_sequence(item, &lin_idx, &seq, pool);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ static GU_DEFINE_TYPE(PgfItemBuf, abstract, _);
|
|||||||
|
|
||||||
struct PgfItemConts {
|
struct PgfItemConts {
|
||||||
PgfCCat* ccat;
|
PgfCCat* ccat;
|
||||||
unsigned short lin_idx;
|
size_t lin_idx;
|
||||||
#ifdef PGF_PARSER_DEBUG
|
#ifdef PGF_PARSER_DEBUG
|
||||||
unsigned short offset;
|
unsigned short offset;
|
||||||
#endif
|
#endif
|
||||||
@@ -63,12 +63,12 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int fid;
|
int fid;
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
} PgfCFCat;
|
} PgfCFCat;
|
||||||
|
|
||||||
static GU_DEFINE_TYPE(PgfCFCat, struct,
|
static GU_DEFINE_TYPE(PgfCFCat, struct,
|
||||||
GU_MEMBER(PgfCFCat, fid, int),
|
GU_MEMBER(PgfCFCat, fid, int),
|
||||||
GU_MEMBER(PgfCFCat, lin_idx, int));
|
GU_MEMBER(PgfCFCat, lin_idx, size_t));
|
||||||
|
|
||||||
extern GuHasher pgf_cfcat_hasher;
|
extern GuHasher pgf_cfcat_hasher;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ pgf_prev_extern_sym(PgfSymbol sym)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
size_t
|
||||||
pgf_item_lin_idx(PgfItem* item) {
|
pgf_item_lin_idx(PgfItem* item) {
|
||||||
return item->conts->lin_idx;
|
return item->conts->lin_idx;
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ pgf_extern_seq_get(PgfItem* item, GuPool* pool)
|
|||||||
|
|
||||||
void
|
void
|
||||||
pgf_item_sequence(PgfItem* item,
|
pgf_item_sequence(PgfItem* item,
|
||||||
int* lin_idx, PgfSequence* seq,
|
size_t* lin_idx, PgfSequence* seq,
|
||||||
GuPool* pool) {
|
GuPool* pool) {
|
||||||
*lin_idx = item->conts->lin_idx;
|
*lin_idx = item->conts->lin_idx;
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ static void
|
|||||||
pgf_print_item_seq(PgfItem *item,
|
pgf_print_item_seq(PgfItem *item,
|
||||||
GuWriter* wtr, GuExn* err, GuPool* pool)
|
GuWriter* wtr, GuExn* err, GuPool* pool)
|
||||||
{
|
{
|
||||||
int lin_idx;
|
size_t lin_idx;
|
||||||
PgfSequence seq;
|
PgfSequence seq;
|
||||||
pgf_item_sequence(item, &lin_idx, &seq, pool);
|
pgf_item_sequence(item, &lin_idx, &seq, pool);
|
||||||
|
|
||||||
|
|||||||
@@ -106,12 +106,12 @@ PgfExpr
|
|||||||
pgf_parse_best_result(PgfParseState* state, GuPool* pool);
|
pgf_parse_best_result(PgfParseState* state, GuPool* pool);
|
||||||
|
|
||||||
|
|
||||||
int
|
size_t
|
||||||
pgf_item_lin_idx(PgfItem* item);
|
pgf_item_lin_idx(PgfItem* item);
|
||||||
|
|
||||||
void
|
void
|
||||||
pgf_item_sequence(PgfItem* item,
|
pgf_item_sequence(PgfItem* item,
|
||||||
int* lin_idx, PgfSequence* seq,
|
size_t* lin_idx, PgfSequence* seq,
|
||||||
GuPool* pool);
|
GuPool* pool);
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user