Tighten string helper prototypes and quiet pointer-sign warnings
This commit is contained in:
@@ -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, ...);
|
||||
|
||||
Reference in New Issue
Block a user