From owner-p4-projects@FreeBSD.ORG Tue Jun 10 17:56:24 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66DD01065675; Tue, 10 Jun 2008 17:56:24 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267D01065670 for ; Tue, 10 Jun 2008 17:56:24 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 18D948FC1C for ; Tue, 10 Jun 2008 17:56:24 +0000 (UTC) (envelope-from zec@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 m5AHuO8v016806 for ; Tue, 10 Jun 2008 17:56:24 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5AHuO6U016804 for perforce@freebsd.org; Tue, 10 Jun 2008 17:56:24 GMT (envelope-from zec@FreeBSD.org) Date: Tue, 10 Jun 2008 17:56:24 GMT Message-Id: <200806101756.m5AHuO6U016804@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 143245 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2008 17:56:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=143245 Change 143245 by zec@zec_tpx32 on 2008/06/10 17:55:27 Introduce a script for automated renaming of global variables. The script searches for references of variable names in .c and .h files in the srcdir hierarchy, and prepends them with a "V_" prefix. The script also creates or updates a "vimage.h" file in the current directory containing macros which resolve V_ instances back to their original counterparts (e.g. V_rt_tables -> rt_tables). Best effort is made not to change any variable declarations nor field names in structure declarations and / or C-style comments. The script attempts to avoid changing structure names if they happen to have the same name as any of the requested variables (e.g. ifnet). So far the only manual intervention that has to be done on resulting sources is placement of #include lines in .c files for which the script couldn't figure out automatically that they require this #include. The resulting diff is ~550K in size, roughly half of the current delta between HEAD and projects/vimage in p4. The kernel and modules compile cleanly, as does the buildworld. Note that the script is _slow_ when operating over the entire sys tree. Affected files ... .. //depot/projects/vimage/var_rename.tcl#1 add Differences ...