From owner-svn-src-head@freebsd.org Tue Jun 5 17:18:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81828FE332F; Tue, 5 Jun 2018 17:18:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFA5856E9; Tue, 5 Jun 2018 17:18:11 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEF251F535; Tue, 5 Jun 2018 17:18:10 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w55HIAv4089948; Tue, 5 Jun 2018 17:18:10 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w55HIABO089947; Tue, 5 Jun 2018 17:18:10 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806051718.w55HIABO089947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 5 Jun 2018 17:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334665 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 334665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2018 17:18:11 -0000 Author: ian Date: Tue Jun 5 17:18:10 2018 New Revision: 334665 URL: https://svnweb.freebsd.org/changeset/base/334665 Log: Make the v*printf() functions in libsa return int instead of void. This makes them compatible with the C standard signatures, avoiding spurious mismatch errors in the places where the oddball requirements of standalone code end up putting two declarations of the same function in play. Modified: head/stand/libsa/printf.c head/stand/libsa/stand.h Modified: head/stand/libsa/printf.c ============================================================================== --- head/stand/libsa/printf.c Tue Jun 5 15:49:35 2018 (r334664) +++ head/stand/libsa/printf.c Tue Jun 5 17:18:10 2018 (r334665) @@ -80,11 +80,11 @@ printf(const char *fmt, ...) return retval; } -void +int vprintf(const char *fmt, va_list ap) { - kvprintf(fmt, putchar_wrapper, NULL, 10, ap); + return (kvprintf(fmt, putchar_wrapper, NULL, 10, ap)); } int @@ -140,27 +140,32 @@ snprintf(char *buf, size_t size, const char *cfmt, ... return retval; } -void +int vsnprintf(char *buf, size_t size, const char *cfmt, va_list ap) { struct print_buf arg; + int retval; arg.buf = buf; arg.size = size; - kvprintf(cfmt, &snprint_func, &arg, 10, ap); + retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap); if (arg.size >= 1) *(arg.buf)++ = 0; + + return (retval); } -void +int vsprintf(char *buf, const char *cfmt, va_list ap) { int retval; retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap); buf[retval] = '\0'; + + return (retval); } /* Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Tue Jun 5 15:49:35 2018 (r334664) +++ head/stand/libsa/stand.h Tue Jun 5 17:18:10 2018 (r334665) @@ -270,9 +270,9 @@ extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); -extern void vprintf(const char *fmt, __va_list); -extern void vsprintf(char *buf, const char *cfmt, __va_list); -extern void vsnprintf(char *buf, size_t size, const char *cfmt, __va_list); +extern int vprintf(const char *fmt, __va_list); +extern int vsprintf(char *buf, const char *cfmt, __va_list); +extern int vsnprintf(char *buf, size_t size, const char *cfmt, __va_list); extern void twiddle(u_int callerdiv); extern void twiddle_divisor(u_int globaldiv);