Skip to content

Commit

Permalink
Fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou committed Jul 5, 2024
1 parent 85485d6 commit b8b3349
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/_imagingft.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,13 @@ font_getvarnames(FontObject *self) {
num_namedstyles = master->num_namedstyles;
list_names = PyList_New(num_namedstyles);

int listnames_filled[num_namedstyles];
int *list_names_filled = PyMem_Malloc(num_namedstyles * sizeof(int));
if (list_names_filled == NULL) {
return PyErr_NoMemory();
}

for (int i = 0; i < num_namedstyles; i++) {

Check warning on line 1214 in src/_imagingft.c

View workflow job for this annotation

GitHub Actions / ubuntu-latest Python 3.12

comparison of integer expressions of different signedness: ‘int’ and ‘FT_UInt’ {aka ‘unsigned int’} [-Wsign-compare]
listnames_filled[i] = 0;
list_names_filled[i] = 0;
}

if (list_names == NULL) {
Expand All @@ -1226,14 +1230,14 @@ font_getvarnames(FontObject *self) {
}

for (j = 0; j < num_namedstyles; j++) {
if (listnames_filled[j]) {
if (list_names_filled[j]) {
continue;
}

if (master->namedstyle[j].strid == name.name_id) {
list_name = Py_BuildValue("y#", name.string, name.string_len);
PyList_SetItem(list_names, j, list_name);
listnames_filled[j] = 1;
list_names_filled[j] = 1;
break;
}
}
Expand Down

0 comments on commit b8b3349

Please sign in to comment.