From owner-cvs-src@FreeBSD.ORG Sun Jun 29 21:01:44 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81AE1065674; Sun, 29 Jun 2008 21:01:44 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A60DF8FC0C; Sun, 29 Jun 2008 21:01:44 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5TL1irw017340; Sun, 29 Jun 2008 21:01:44 GMT (envelope-from das@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5TL1ieH017339; Sun, 29 Jun 2008 21:01:44 GMT (envelope-from das@repoman.freebsd.org) Message-Id: <200806292101.m5TL1ieH017339@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to das@repoman.freebsd.org using -f From: David Schultz Date: Sun, 29 Jun 2008 21:01:27 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libc/stdio vfprintf.c vfwprintf.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jun 2008 21:01:44 -0000 das 2008-06-29 21:01:27 UTC FreeBSD src repository Modified files: lib/libc/stdio vfprintf.c vfwprintf.c Log: SVN rev 180102 on 2008-06-29 21:01:27Z by das Begin de-spaghettifying the code that handles positional arguments. In particular, encapsulate the state of the type table in a struct, and add inline functions to initialize, free, and manipulate that state. This replaces some ugly macros that made proper error handling impossible. While here, remove an unneeded test for NULL and a variable that is initialized (many times!) but never used. The compiler didn't catch these because of rampant use of the same variable to mean different things in different places. This commit should not cause any changes in functionality. Revision Changes Path 1.79 +153 -94 src/lib/libc/stdio/vfprintf.c 1.30 +153 -94 src/lib/libc/stdio/vfwprintf.c