Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
DOCS_DIR := docs
# Default compiler flags (override with: make CFLAGS="...").
CFLAGS ?= -Wall -Wextra -Wsign-compare -Werror

build:
luarocks --local make
CFLAGS="$(CFLAGS)" luarocks --local make

spec: test

Expand Down
2 changes: 1 addition & 1 deletion src/luaharfbuzz/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static int buffer_add_codepoints(lua_State *L) {
item_offset = luaL_optinteger(L, 3, 0);
item_length = luaL_optinteger(L, 4, -1);

int n = lua_rawlen(L, 2);
unsigned int n = lua_rawlen(L, 2);

hb_codepoint_t *text = (hb_codepoint_t *) malloc(n * sizeof(hb_codepoint_t));

Expand Down
8 changes: 4 additions & 4 deletions src/luaharfbuzz/face.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static int face_var_get_axis_infos(lua_State *L) {
hb_ot_var_get_axis_infos(*face, start, &count, axis_infos);

lua_createtable(L, count, 0);
for (int i = 0; i != count; i++) {
for (unsigned int i = 0; i != count; i++) {
push_axis_info(L, axis_infos + i);
lua_seti(L, -2, i + 1);
}
Expand Down Expand Up @@ -549,7 +549,7 @@ static int face_var_named_instance_get_design_coords(lua_State *L) {
unsigned int count = STATIC_ARRAY_SIZE;
count = hb_ot_var_named_instance_get_design_coords(*face, index, &count, coords);

for (int i = 0; i != count; i++) {
for (unsigned int i = 0; i != count; i++) {
lua_pushnumber(L, coords[i]);
}
return count;
Expand All @@ -570,7 +570,7 @@ static int face_var_normalize_variations(lua_State *L) {
int normalized[STATIC_ARRAY_SIZE];
hb_ot_var_normalize_variations(*face, variations, count, normalized, coord_count);

for (int i = 0; i != coord_count; i++) {
for (unsigned int i = 0; i != coord_count; i++) {
lua_pushinteger(L, normalized[i]);
}
return coord_count;
Expand All @@ -590,7 +590,7 @@ static int face_var_normalize_coords(lua_State *L) {
int normalized[STATIC_ARRAY_SIZE];
hb_ot_var_normalize_coords(*face, count, coords, normalized);

for (int i = 0; i != count; i++) {
for (unsigned int i = 0; i != count; i++) {
lua_pushinteger(L, normalized[i]);
}
return count;
Expand Down
8 changes: 4 additions & 4 deletions src/luaharfbuzz/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int font_set_variations(lua_State *L) {
if (count > 128)
count = 128;
Variation variations[128];
for (int i = 0; i != count; i++)
for (unsigned int i = 0; i != count; i++)
variations[i] = *(Variation *)luaL_checkudata(L, i + 2, "harfbuzz.Variation");

hb_font_set_variations(*f, variations, count);
Expand All @@ -262,7 +262,7 @@ static int font_set_var_coords_design(lua_State *L) {
if (count > 128)
count = 128;
float coords[128];
for (int i = 0; i != count; i++)
for (unsigned int i = 0; i != count; i++)
coords[i] = luaL_checknumber(L, i + 2);

hb_font_set_var_coords_design(*f, coords, count);
Expand All @@ -275,7 +275,7 @@ static int font_set_var_coords_normalized(lua_State *L) {
if (count > 128)
count = 128;
int coords[128];
for (int i = 0; i != count; i++)
for (unsigned int i = 0; i != count; i++)
coords[i] = luaL_checkinteger(L, i + 2);

hb_font_set_var_coords_normalized(*f, coords, count);
Expand All @@ -294,7 +294,7 @@ static int font_get_var_coords_normalized(lua_State *L) {
Font *f = (Font *)luaL_checkudata(L, 1, "harfbuzz.Font");
unsigned int count;
const int *coords = hb_font_get_var_coords_normalized(*f, &count);
for (int i = 0; i != count; i++)
for (unsigned int i = 0; i != count; i++)
lua_pushinteger(L, coords[i]);
return count;
}
Expand Down
Loading