aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVas Crabb <cuavas@users.noreply.github.com>2023-12-13 10:18:01 +1100
committerGitHub <noreply@github.com>2023-12-12 20:18:01 -0300
commit97b522ec123acb28971f19953fb6558fe79daabf (patch)
tree8f03b501c90b895b2b0ded966dee9fd278ef16d2
parent472cd783d7a98f6dfe549ac0d59f3fe8f2ea59c8 (diff)
downloadluafilesystem-97b522ec123acb28971f19953fb6558fe79daabf.tar.gz
luafilesystem-97b522ec123acb28971f19953fb6558fe79daabf.tar.bz2
luafilesystem-97b522ec123acb28971f19953fb6558fe79daabf.zip
Explicitly cast void * pointers - allows code to build cleanly as C++. (#165)
-rw-r--r--src/lfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lfs.c b/src/lfs.c
index f0a0db9..f93db95 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -275,7 +275,7 @@ static int get_dir(lua_State * L)
275 size_t size = LFS_MAXPATHLEN; /* initial buffer size */ 275 size_t size = LFS_MAXPATHLEN; /* initial buffer size */
276 int result; 276 int result;
277 while (1) { 277 while (1) {
278 char *path2 = realloc(path, size); 278 char *path2 = (char *)realloc(path, size);
279 if (!path2) { /* failed to allocate */ 279 if (!path2) { /* failed to allocate */
280 result = pusherror(L, "get_dir realloc() failed"); 280 result = pusherror(L, "get_dir realloc() failed");
281 break; 281 break;
@@ -1065,7 +1065,7 @@ static int push_link_target(lua_State * L)
1065 int tsize = 0, size = 256; /* size = initial buffer capacity */ 1065 int tsize = 0, size = 256; /* size = initial buffer capacity */
1066 int ok = 0; 1066 int ok = 0;
1067 while (!ok) { 1067 while (!ok) {
1068 char *target2 = realloc(target, size); 1068 char *target2 = (char *)realloc(target, size);
1069 if (!target2) { /* failed to allocate */ 1069 if (!target2) { /* failed to allocate */
1070 break; 1070 break;
1071 } 1071 }