From matt@gsicomp.on.ca  Wed Oct  2 21:28:55 2002
Return-Path: <matt@gsicomp.on.ca>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BEA7337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Oct 2002 21:28:55 -0700 (PDT)
Received: from tomts19-srv.bellnexxia.net (tomts19.bellnexxia.net [209.226.175.73])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E36BF43E75
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Oct 2002 21:28:54 -0700 (PDT)
	(envelope-from matt@gsicomp.on.ca)
Received: from xena.gsicomp.on.ca ([65.95.176.54])
          by tomts19-srv.bellnexxia.net
          (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP
          id <20021003042851.OGQJ6081.tomts19-srv.bellnexxia.net@xena.gsicomp.on.ca>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Thu, 3 Oct 2002 00:28:51 -0400
Received: from dhcp2.gsicomp.on.ca (dhcp2.gsicomp.on.ca [192.168.0.11])
	by xena.gsicomp.on.ca (8.11.3/8.11.3) with ESMTP id g9338sp12430
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 2 Oct 2002 23:08:54 -0400 (EDT)
	(envelope-from matt@dhcp2.gsicomp.on.ca)
Received: (from matt@localhost)
	by dhcp2.gsicomp.on.ca (8.12.6/8.12.6/Submit) id g934Sokk047282;
	Thu, 3 Oct 2002 00:28:50 -0400 (EDT)
	(envelope-from matt)
Message-Id: <200210030428.g934Sokk047282@dhcp2.gsicomp.on.ca>
Date: Thu, 3 Oct 2002 00:28:50 -0400 (EDT)
From: Matt Emmerton <matt@gsicomp.on.ca>
Reply-To: Matt Emmerton <matt@gsicomp.on.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: static-ize some functions in sys/net/zlib.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         43616
>Category:       kern
>Synopsis:       [zlib] [patch] static-ize some functions in sys/net/zlib.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 02 21:30:02 PDT 2002
>Closed-Date:    
>Last-Modified:  Tue Oct 25 23:49:12 GMT 2005
>Originator:     Matt Emmerton
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
GSI Computer Services
>Environment:
System: FreeBSD laptop.gsicomp.on.ca 5.0-CURRENT FreeBSD 5.0-CURRENT #5: Mon Sep 23 21:24:44 EDT 2002 root@laptop.gsicomp.on.ca:/usr/obj/usr/src/sys/LAPTOP.20020914.01 i386

>Description:

	PHK's JKH TODO List - kernel orphan symbol review

	This patch makes some symbols in net/zlib.c static as they
	don't need to be visible outside of this module.

>How-To-Repeat:
>Fix:

--- sys/net/zlib.c.orig	Wed Oct  2 23:39:58 2002
+++ sys/net/zlib.c	Thu Oct  3 00:21:45 2002
@@ -528,14 +528,14 @@
  */
 
         /* in trees.c */
-void _tr_init         OF((deflate_state *s));
-int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
-ulg  _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
+static void _tr_init         OF((deflate_state *s));
+static int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
+static ulg  _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
 			  int eof));
-void _tr_align        OF((deflate_state *s));
-void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+static void _tr_align        OF((deflate_state *s));
+static void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
                           int eof));
-void _tr_stored_type_only OF((deflate_state *));
+static void _tr_stored_type_only OF((deflate_state *));
 
 #endif
 /* --- deflate.h */
>Release-Note:
>Audit-Trail:

From: Giorgos Keramidas <keramida@freebsd.org>
To: Matt Emmerton <matt@gsicomp.on.ca>
Cc: bug-followup@freebsd.org
Subject: Re: kern/43616: static-ize some functions in sys/net/zlib.c
Date: Thu, 3 Oct 2002 14:19:53 +0300

 On 2002-10-03 00:28, Matt Emmerton <matt@gsicomp.on.ca> wrote:
 >
 > PHK's JKH TODO List - kernel orphan symbol review
 >
 > This patch makes some symbols in net/zlib.c static as they
 > don't need to be visible outside of this module.
 
 The answer is probably to ignore zlib and replace it with something
 better.  The zlib code (both the one in the kernel, and the one
 distributed as zlib-1.0.4, where the kernel version comes from) is
 fugly in too many places to be listed in a single mail followup.
 
 For the past few days, I've been trying to read through the tangle of
 C source that is zlib-1.0.4.tar.gz and keep notes for the following
 things:
 
   - Generic z-library interface.
   - Code that implements various compression formats.
 
 The best thing to do in zlib code, imho, would be to kill the dreaded
 library by replacing it with another, BSD licensed, replacement.  I'm
 already started towards trying to make something like this.  There are
 many evil things in the source of zlib, but the most notable one is
 the fact that the liberal style of writing has caused errors like the
 following to appear in crucial places, like the zlib.h header (which
 is used by almost *all* the other headers):
 
 : ZEXTERN const char * ZEXPORT zlibVersion OF((void));
 : /* The application can compare zlibVersion and ZLIB_VERSION for
 :  * consistency.
 :  ...
 :  */
 : 
 : /*
 : ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
 : 
 :      Initializes the internal stream state for compression. The fields
 : ...
 : */
 
 Note how the second function is not prototyped, because it's prototype
 is commented out.  This bug is present in today's -current, along with
 many other nearby silliness caused by zlib.h and friends :(
 
 Giorgos.
>Unformatted:
