From edwin@mavetju.org  Wed Oct  2 17:48:12 2002
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 59D8337B401; Wed,  2 Oct 2002 17:48:12 -0700 (PDT)
Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id BA8F843E81; Wed,  2 Oct 2002 17:48:11 -0700 (PDT)
	(envelope-from edwin@mavetju.org)
Received: from k7.mavetju (topaz.mdcc.cx [212.204.230.141])
	by topaz.mdcc.cx (Postfix) with ESMTP
	id 0D6BC2B739; Thu,  3 Oct 2002 02:48:08 +0200 (CEST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id 63DA76A712E; Thu,  3 Oct 2002 10:48:05 +1000 (EST)
Message-Id: <20021003004805.63DA76A712E@k7.mavetju>
Date: Thu,  3 Oct 2002 10:48:05 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: des@FreeBSD.org
Subject: [patch] unbreak math/snns
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         43606
>Category:       ports
>Synopsis:       [patch] unbreak math/snns
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 02 17:50:04 PDT 2002
>Closed-Date:    Wed Oct 30 17:08:58 PST 2002
>Last-Modified:  Wed Oct 30 17:08:58 PST 2002
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.5-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 4.5-RELEASE FreeBSD 4.5-RELEASE #4: Sat Sep 14 10:41:50 EST 2002 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386

$FreeBSD: ports/math/snns/Makefile,v 1.9 2001/11/22 18:02:29 des Exp $

>Description:

math/snns doesn't want to compile anymore due to changes in values.h/limits.h
See also http://bento.freebsd.org/errorlogs/4-full/snns-4.2.log

>How-To-Repeat:

See http://bento.freebsd.org/errorlogs/4-full/snns-4.2.log

>Fix:

This is only a patch. This is not a fix. This patch should be brought
back to the people who manage SNNS. That's a request for the
maintainer.

This is a patch for math/snns/files/patch-ab:
--- old-patch-ab	Thu Oct  3 10:15:54 2002
+++ patch-ab	Thu Oct  3 10:16:08 2002
@@ -1,14 +1,5 @@
 --- kernel/sources/Makefile.orig	Thu Sep  3 06:38:00 1998
 +++ kernel/sources/Makefile	Sat Dec  4 12:52:06 1999
-@@ -27,7 +27,7 @@
- # Define final C-preprocessor options for the kernel
- # Additional definitions like -I... and -D... go here
- CPPFLAGS           = -I../.. \
--                     $(ENZOFLAGS)
-+                     $(ENZOFLAGS) -DHAVE_VALUES_H
- 
- # Here you may change the default C-compiler flags as set in
- # ../../Makefile.def (not recommended)
 @@ -100,7 +100,7 @@
  all: $(LIBKERNEL) $(LIBFUNCS)
  
This is a new file called math/snns/files/patch-kernel::sources::kr_mem.c

--- kernel/sources/kr_mem.c.old	Thu Oct  3 10:35:01 2002
+++ kernel/sources/kr_mem.c	Thu Oct  3 10:35:51 2002
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <memory.h>
+#include <limits.h>
 #ifdef HAVE_VALUES_H
 #include <values.h>
 #else
@@ -1023,7 +1024,7 @@
 
   if ( (n_ptr = krm_NTableSymbolSearch( symbol_name, symbol_type ) ) != NULL)
     {   /*  symbol is already in the name table  */
-    if ((n_ptr->ref_count) < ((unsigned short) MAXSHORT)) {
+    if ((n_ptr->ref_count) < ((unsigned short) SHRT_MAX)) {
         n_ptr->ref_count++;
     }
     return( n_ptr->Entry.symbol );
@@ -1052,7 +1053,7 @@
   if (symbol_name == NULL)  return;
   if ( (n_ptr = krm_NTableSymbolSearch( symbol_name, symbol_type ) ) != NULL)
     {   /*  symbol is in the name table  */
-    if ((n_ptr->ref_count) < ((unsigned short) MAXSHORT))
+    if ((n_ptr->ref_count) < ((unsigned short) SHRT_MAX))
       {   /*    No. of references to this symbol don't exceed the max. reference
                 count. This means it is possible to delete the symbol if the
                 reference count is zero.

This is a new file called math/snns/files/patch-kernel::sources::learn_f.c

--- kernel/sources/learn_f.c.old	Thu Oct  3 10:37:10 2002
+++ kernel/sources/learn_f.c	Thu Oct  3 10:37:50 2002
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
+#include <limits.h>
 #ifdef HAVE_VALUES_H
 #include <values.h>
 #endif
@@ -3896,8 +3897,8 @@
 
   /* NULL before first  unit */
   topo_ptr = topo_ptr_array;
-  xmin_in = ymin_in =  MAXINT;
-  xmax_in = ymax_in = -MAXINT;
+  xmin_in = ymin_in =  INT_MAX;
+  xmax_in = ymax_in = -INT_MAX;
 
   while ( (input_unit_ptr = * ++topo_ptr ) != NULL)
     {
@@ -3967,8 +3968,8 @@
 
   /* topo_ptr points now to the NULL before first output unit */
 
-  xmin_out = ymin_out =  MAXINT;
-  xmax_out = ymax_out = -MAXINT;
+  xmin_out = ymin_out =  INT_MAX;
+  xmax_out = ymax_out = -INT_MAX;
 
   while ( (output_unit_ptr = * ++topo_ptr ) != NULL)
     {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->des 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Fri Oct 11 18:54:13 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43606 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Wed Oct 30 17:08:27 PST 2002 
State-Changed-Why:  
Seems that kris@ already fixed the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43606 
>Unformatted:
