Skip to content

Commit 0bd5f1d

Browse files
committed
linux fixes
1 parent 871d654 commit 0bd5f1d

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# default MingW path for Qt 6.3.x:
2-
WIN_MINGW_BIN_PATH=C:\\Qt\\Tools\\mingw1120_64\\bin
2+
WIN_MINGW_BIN_PATH=C:\\Qt\\Tools\\mingw1310_64\\bin
33

44
LIB_VERSION=2025.07.07a
55

@@ -19,7 +19,7 @@ OBJ=$(patsubst %.c, $(OBJDIR)/%.o, $(SRC))
1919
OBJFILES=$(patsubst %.c, %.o, $(SRC))
2020

2121
CFLAGS=-std=c11 -Wall -Wextra -Wconversion -Wshadow -Wstrict-overflow -Wformat=2 -Wundef -fno-common -O3 -Os \
22-
-Wpedantic -pedantic -Werror -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -D"LIB_VERSION=\"$(LIB_VERSION)\""
22+
-Wpedantic -pedantic -Werror -Wno-int-to-pointer-cast -D"LIB_VERSION=\"$(LIB_VERSION)\""
2323

2424
ifdef OS # Windows:
2525
define fn_mkdir

src/libdither/kdtree/kdtree.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ OF SUCH DAMAGE.
3434
#include <stdlib.h>
3535
#include <string.h>
3636
#include <math.h>
37+
#if defined(_MSC_VER) || defined(__MINGW32__)
38+
#include <malloc.h>
39+
#else
3740
#include <alloca.h>
41+
#endif
42+
3843
#include "kdtree.h"
3944

4045
#if defined(WIN32) || defined(__WIN32__)

src/libdither/tetrapal/tetrapal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,11 +1757,11 @@ int tetrapal_number_of_elements(const Tetrapal* tetrapal)
17571757
for (size_t i = 0; i < tetrapal->simplices.count; i++)
17581758
{
17591759
/* Skip infinite simplices. */
1760-
if (is_infinite_simplex(tetrapal, i) == true)
1760+
if (is_infinite_simplex(tetrapal, (simplex_t)i) == true)
17611761
continue;
17621762

17631763
/* Skip free simplices. */
1764-
if (is_free_simplex(tetrapal, i) == true)
1764+
if (is_free_simplex(tetrapal, (simplex_t)i) == true)
17651765
continue;
17661766

17671767
count += 1;
@@ -1818,11 +1818,11 @@ int tetrapal_get_elements(const Tetrapal* tetrapal, int* buffer)
18181818
for (size_t i = 0; i < tetrapal->simplices.count; i++)
18191819
{
18201820
/* Skip infinite simplices. */
1821-
if (is_infinite_simplex(tetrapal, i) == true)
1821+
if (is_infinite_simplex(tetrapal, (simplex_t)i) == true)
18221822
continue;
18231823

18241824
/* Skip free simplices. */
1825-
if (is_free_simplex(tetrapal, i) == true)
1825+
if (is_free_simplex(tetrapal, (simplex_t)i) == true)
18261826
continue;
18271827

18281828
for (int j = 0; j < stride; j++)
@@ -2150,12 +2150,12 @@ static size_t find_first_simplex(Tetrapal* tetrapal, const float* points, const
21502150
static inline long xrandom(random_t* seed)
21512151
{
21522152
*seed = 214013u * *seed + 2531011u;
2153-
return (*seed >> 16) & RANDOM_MAX;
2153+
return (long int)((*seed >> 16) & RANDOM_MAX);
21542154
}
21552155

21562156
static inline random_t random_range(random_t* seed, random_t range)
21572157
{
2158-
return (size_t)xrandom(seed) / (RANDOM_MAX / range + 1);
2158+
return (random_t)((size_t)xrandom(seed) / (RANDOM_MAX / range + 1));
21592159
}
21602160

21612161
static inline void swap_vertex(vertex_t* a, vertex_t* b)

0 commit comments

Comments
 (0)