X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fsnprintf.c;fp=sbr%2Fsnprintf.c;h=2b198811aa740030699e1150c78c6cf0767e8fa9;hb=b067ff5c465a5d243ce5a19e562085a9a1a97215;hp=9bc163ab18c53f5a53db6045715994a91561a40a;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1;p=mmh diff --git a/sbr/snprintf.c b/sbr/snprintf.c index 9bc163a..2b19881 100644 --- a/sbr/snprintf.c +++ b/sbr/snprintf.c @@ -135,7 +135,8 @@ typedef int bool_int; #define NDIG 80 /* buf must have at least NDIG bytes */ -static char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) +static char * +ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf) { register int r2; double fi, fj; @@ -207,12 +208,14 @@ static char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, c return (buf); } -static char *ap_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char * +ap_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { return (ap_cvt(arg, ndigits, decpt, sign, 1, buf)); } -static char *ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) +static char * +ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) { return (ap_cvt(arg, ndigits, decpt, sign, 0, buf)); } @@ -222,7 +225,8 @@ static char *ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf) * minimal length string */ -static char *ap_gcvt(double number, int ndigit, char *buf, boolean_e altform) +static char * +ap_gcvt(double number, int ndigit, char *buf, boolean_e altform) { int sign, decpt; register char *p1, *p2; @@ -357,7 +361,8 @@ static char *ap_gcvt(double number, int ndigit, char *buf, boolean_e altform) * which is a pointer to the END of the buffer + 1 (i.e. if the buffer * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) */ -static char *conv_10(register wide_int num, register bool_int is_unsigned, +static char * +conv_10(register wide_int num, register bool_int is_unsigned, register bool_int *is_negative, char *buf_end, register int *len) { @@ -404,7 +409,8 @@ static char *conv_10(register wide_int num, register bool_int is_unsigned, -static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len) +static char * +conv_in_addr(struct in_addr *ia, char *buf_end, int *len) { unsigned addr = ntohl(ia->s_addr); char *p = buf_end; @@ -425,7 +431,8 @@ static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len) -static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) +static char * +conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) { char *p = buf_end; bool_int is_negative; @@ -447,7 +454,8 @@ static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len) * The sign is returned in the is_negative argument (and is not placed * in buf). */ -static char *conv_fp(register char format, register double num, +static char * +conv_fp(register char format, register double num, boolean_e add_dp, int precision, bool_int *is_negative, char *buf, int *len) { @@ -539,7 +547,8 @@ static char *conv_fp(register char format, register double num, * which is a pointer to the END of the buffer + 1 (i.e. if the buffer * is declared as buf[ 100 ], buf_end should be &buf[ 100 ]) */ -static char *conv_p2(register u_wide_int num, register int nbits, +static char * +conv_p2(register u_wide_int num, register int nbits, char format, char *buf_end, register int *len) { register int mask = (1 << nbits) - 1; @@ -562,7 +571,8 @@ static char *conv_p2(register u_wide_int num, register int nbits, /* * Do format conversion placing the output in buffer */ -int ap_vformatter(int (*flush_func)(ap_vformatter_buff *), +static int +ap_vformatter(int (*flush_func)(ap_vformatter_buff *), ap_vformatter_buff *vbuff, const char *fmt, va_list ap) { register char *sp; @@ -983,7 +993,8 @@ int ap_vformatter(int (*flush_func)(ap_vformatter_buff *), } -static int snprintf_flush(ap_vformatter_buff *vbuff) +static int +snprintf_flush(ap_vformatter_buff *vbuff) { /* if the buffer fills we have to abort immediately, there is no way * to "flush" a snprintf... there's nowhere to flush it to. @@ -992,7 +1003,8 @@ static int snprintf_flush(ap_vformatter_buff *vbuff) } -int snprintf(char *buf, size_t len, const char *format,...) +int +snprintf(char *buf, size_t len, const char *format,...) { int cc; va_list ap; @@ -1012,7 +1024,8 @@ int snprintf(char *buf, size_t len, const char *format,...) } -int vsnprintf(char *buf, size_t len, const char *format, va_list ap) +int +vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; ap_vformatter_buff vbuff;