Skip to content
Snippets Groups Projects
Commit 884a4d51 authored by deuce's avatar deuce
Browse files

Various fixups.

parent 92c853dd
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
/* ANSI */ /* ANSI */
#include <sys/types.h> /* _dev_t */ #include <sys/types.h> /* _dev_t */
#include <sys/stat.h> /* struct stat */ #include <sys/stat.h> /* struct stat */
#include <limits.h> /* struct stat */
#include "filewrap.h" /* Verify prototypes */ #include "filewrap.h" /* Verify prototypes */
...@@ -275,7 +276,7 @@ int DLLCALL unlock(int file, off_t offset, off_t size) ...@@ -275,7 +276,7 @@ int DLLCALL unlock(int file, off_t offset, off_t size)
return(i); return(i);
} }
static inline size_t static size_t
p2roundup(size_t n) p2roundup(size_t n)
{ {
if(n & (n-1)) { // If n isn't a power of two already... if(n & (n-1)) { // If n isn't a power of two already...
...@@ -293,7 +294,7 @@ p2roundup(size_t n) ...@@ -293,7 +294,7 @@ p2roundup(size_t n)
return (n); return (n);
} }
static inline int expandtofit(char **linep, size_t len, size_t *linecapp) static int expandtofit(char **linep, size_t len, size_t *linecapp)
{ {
char *newline; char *newline;
size_t newcap; size_t newcap;
...@@ -305,7 +306,7 @@ static inline int expandtofit(char **linep, size_t len, size_t *linecapp) ...@@ -305,7 +306,7 @@ static inline int expandtofit(char **linep, size_t len, size_t *linecapp)
newcap = LONG_MAX + 1; newcap = LONG_MAX + 1;
else else
newcap = p2roundup(len); newcap = p2roundup(len);
newline = realloc(*linep, newcap); newline = (char *)realloc(*linep, newcap);
if(newline == NULL) if(newline == NULL)
return -1; return -1;
*linecapp = newcap; *linecapp = newcap;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment