extern int safe_format(char *buff, char **bp, const char *RESTRICT fmt, ...)
__attribute__ ((__format__(__printf__, 3, 4)));
/* Append an int to the end of a buffer */
- extern int safe_integer(int i, char *buff, char **bp);
- extern int safe_uinteger(unsigned int, char *buff, char **bp);
+ extern int safe_integer(long i, char *buff, char **bp);
+ extern int safe_uinteger(unsigned long, char *buff, char **bp);
/* Same, but for a SBUF_LEN buffer, not BUFFER_LEN */
#define SBUF_LEN 64 /**< A short buffer */
- extern int safe_integer_sbuf(int i, char *buff, char **bp);
+ extern int safe_integer_sbuf(long i, char *buff, char **bp);
/* Append a NVAL to a string */
extern int safe_number(NVAL n, char *buff, char **bp);
/* Append a dbref to a buffer */
#define unparse_boolean(x) ((x) ? "1" : "0")
char *unparse_dbref(dbref num);
-char *unparse_integer(int num);
-char *unparse_uinteger(unsigned int num);
+char *unparse_integer(long num);
+char *unparse_uinteger(unsigned long num);
char *unparse_number(NVAL num);
char *unparse_types(int type);
* \return 0 on success, non-zero on failure.
*/
int
-safe_integer(int i, char *buff, char **bp)
+safe_integer(long i, char *buff, char **bp)
{
return format_long(i, buff, bp, BUFFER_LEN, 10);
}
* \return 0 on success, non-zero on failure.
*/
int
-safe_uinteger(unsigned int i, char *buff, char **bp)
+safe_uinteger(unsigned long i, char *buff, char **bp)
{
return safe_str(unparse_uinteger(i), buff, bp);
}
* \return 0 on success, non-zero on failure.
*/
int
-safe_integer_sbuf(int i, char *buff, char **bp)
+safe_integer_sbuf(long i, char *buff, char **bp)
{
return format_long(i, buff, bp, SBUF_LEN, 10);
}
* \return address of static buffer containing stringified value.
*/
char *
-unparse_integer(int num)
+unparse_integer(long num)
{
static char str[SBUF_LEN];
char *strp;
* \return address of static buffer containing stringified value.
*/
char *
-unparse_uinteger(unsigned int num)
+unparse_uinteger(unsigned long num)
{
static char str[16];
- sprintf(str, "%u", num);
+ sprintf(str, "%lu", num);
return str;
}