Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  3 Oct 2002 10:48:05 +1000 (EST)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        des@FreeBSD.org
Subject:   ports/43606: [patch] unbreak math/snns
Message-ID:  <20021003004805.63DA76A712E@k7.mavetju>

next in thread | raw e-mail | index | archive | help

>Number:         43606
>Category:       ports
>Synopsis:       [patch] unbreak math/snns
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 02 17:50:04 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021003004805.63DA76A712E>