Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jan 2006 12:39:26 +1030
From:      "Aluminium Oxide" <orac000@internet-mail.org>
To:        freebsd-net@freebsd.org
Subject:   /usr/src/lib/libc/net/res_debug.c: compile problem fixed
Message-ID:  <1136167766.17477.250884723@webmail.messagingengine.com>

next in thread | raw e-mail | index | archive | help
I've fixed a problem with res_debug.c, which, during a make buildworld
on a 6.0 RELEASE i386 system cvsupped yesterday, was stopping with 
these errors :

============================================================
.....
In file included from /usr/src/lib/libc/net/res_debug.c:733:

/usr/src/lib/libc/net/res_debug.c: in function '__loc_aton' :
/usr/src/lib/libc/net/res_debug.c:733: warning: passing arg 1 of
'latlon2ul' from incompatible pointer type
/usr/src/lib/libc/net/res_debug.c:735: warning: passing arg 1 of
'latlon2ul' from incompatible pointer type
/usr/src/lib/libc/net/res_debug.c:786: warning: passing arg 1 of
'latlon2ul' from incompatible pointer type
/usr/src/lib/libc/net/res_debug.c:797: warning: passing arg 1 of
'latlon2ul' from incompatible pointer type
/usr/src/lib/libc/net/res_debug.c:808: warning: passing arg 1 of
'latlon2ul' from incompatible pointer type

*** Error code 1
Stop in /usr/src/lib/libc/
......
Stop in /usr/src.
============================================================

I have fixed this and would like to either create a patch for the code
in question, or if you prefer simply replacing the code (26Kb) with the
attached code. Either way, I am not the most experienced C programmer
and would like my changes checked.

Below is the output of `diff res_debug.org.c res_debug.c`

I've also attached this.
=====================================================
574,575c574,575
< precsize_aton(strptr)
<       char **strptr;
---
> precsize_aton(char **strptr)
> /*	char **strptr; */
616,618c616,618
< latlon2ul(latlonstrptr,which)
<       char **latlonstrptr; 
<       int *which; 
---
> latlon2ul(char *latlonstrptr,int *which)
> /*	char **latlonstrptr; */
> /*	int *which; */
624c624
<       cp = *latlonstrptr;
---
> 	cp = latlonstrptr;
707c707
<       *latlonstrptr = cp;
---
> 	latlonstrptr = cp;
719c719,720
<       const char *cp, *maxcp;
---
> 	char *cp;
> 	char *maxcp;
730,731c731,732
<       cp = ascii;
<       maxcp = cp + strlen(ascii);
---
> 	*cp = *ascii;
> 	*maxcp = *cp + strlen(ascii);
733c734
<       lltemp1 = latlon2ul(&cp, which1);
---
> 	lltemp1 = latlon2ul(cp, which1);
735c736
<       lltemp2 = latlon2ul(&cp, which2);
---
> 	lltemp2 = latlon2ul(cp, which2);
737c738
<       switch (which1 + which2) {
---
> 	switch (*which1 + *which2) {
739c740
<               if ((which1 == 1) && (which2 == 2)) { /* normal case */
---
> 		if ((*which1 == 1) && (*which2 == 2)) { /* normal case */
742c743,744
<               } else if ((which1 == 2) && (which2 == 1)) { /* reversed
*/
---
> 		} else if ((*which1 == 2) && (*which2 == 1)) { /* reversed 
> */

=====================================================
-- 
  Aluminium Oxide
  orac000@internet-mail.org

-- 
http://www.fastmail.fm - A fast, anti-spam email service.




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