Tighten string helper prototypes and quiet pointer-sign warnings

This commit is contained in:
Mario Fetka
2026-04-20 23:39:42 +02:00
parent f0bfd5a641
commit 33d1da469a
5 changed files with 26 additions and 26 deletions

View File

@@ -29,16 +29,16 @@
/* extern FILE *logfile; */
extern void x_x_xfree(char **p);
extern int x_x_xnewstr(uint8 **p, uint8 *s);
extern int x_x_xnewstr(uint8 **p, const char *s);
#define xfree(p) x_x_xfree((char **)&(p))
#define new_str(p, s) x_x_xnewstr((uint8 **)&(p), s)
#define new_str(p, s) x_x_xnewstr((uint8 **)&(p), (const char *)(s))
extern char *xmalloc(uint size);
extern char *xcmalloc(uint size);
extern int strmaxcpy(uint8 *dest, uint8 *source, int len);
#define xstrcpy(d, s) strmaxcpy((d), (s), sizeof(d)-1)
#define xstrmaxcpy(d, s, len) strmaxcpy((d), (s), min(sizeof(d)-1, (len)) )
extern int strmaxcpy(uint8 *dest, const char *source, int len);
#define xstrcpy(d, s) strmaxcpy((d), (const char *)(s), sizeof(d)-1)
#define xstrmaxcpy(d, s, len) strmaxcpy((d), (const char *)(s), min(sizeof(d)-1, (len)) )
extern void xdprintf(int dlevel, int mode, char *p, ...);
extern void errorp(int mode, char *what, char *p, ...);