Skip to content

Commit 0756a78

Browse files
committed
fix Windows x64 warnings
1 parent bdc401f commit 0756a78

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ static void lpbD_repeated(lpb_Env *e, pb_Field *f, uint32_t tag) {
16371637
lua_State *L = e->L;
16381638
lpb_fetchtable(e, f, NULL);
16391639
if (f->packed && pb_gettype(tag) == PB_TBYTES) {
1640-
int len = lua_rawlen(L, -1);
1640+
int len = (int)lua_rawlen(L, -1);
16411641
lpb_SliceEx p, *s = e->s;
16421642
lpb_readbytes(L, s, &p);
16431643
while (p.base.p < p.base.end) {

pb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ PB_API void pb_poolfree(pb_Pool *pool, void *obj)
821821
#define pbT_index(a, b) ((pb_Entry*)((char*)(a) + (b)))
822822

823823
PB_API void pb_inittable(pb_Table *t, size_t entrysize)
824-
{ memset(t, 0, sizeof(pb_Table)), t->entry_size = entrysize; }
824+
{ memset(t, 0, sizeof(pb_Table)), t->entry_size = (unsigned)entrysize; }
825825

826826
PB_API void pb_freetable(pb_Table *t)
827827
{ free(t->hash); pb_inittable(t, t->entry_size); }
@@ -1595,7 +1595,7 @@ static void pbL_loadType(pb_State *S, pbL_TypeInfo *info, pb_Loader *L) {
15951595
for (i = 0, count = pbL_count(info->oneof_decl); i < count; ++i) {
15961596
pb_OneofEntry *e = (pb_OneofEntry*)pb_settable(&t->oneof_index, i+1);
15971597
e->name = pb_newname(S, info->oneof_decl[i]);
1598-
e->index = i+1;
1598+
e->index = (int)i+1;
15991599
}
16001600
for (i = 0, count = pbL_count(info->field); i < count; ++i)
16011601
pbL_loadField(S, &info->field[i], L, t);

0 commit comments

Comments
 (0)