🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #16621

C warning

#16621
From: Ares Lagae
Date: Wed, 26 Apr 2000 00:00
40 lines
1566 bytes
Ik krijg volgende warning als ik mijn proggie compileer:

bash-2.03$ gcc main2.c
/xxxxxx/tmi/dppdoorloop.c: In function `dppdoorloop':
In file included from main2.c:5:
/xxxxxx/tmi/dppdoorloop.c:31: warning: passing arg 4 of `qsort' from
incompatible pointer type	

code vd quicksort:
qsort(p, (size_t) num_p, (size_t) sizeof(point), point_compare);


compare functie:
int point_compare(point *p1, point *p2)     //compare 2 points
{
 	if ((*p1).x < (*p2).x) {
   		return -1;
	} else if ((*p1).x == (*p2).x) {
   		if ((*p1).y < (*p2).y) {
   			return -1;
		} else if ((*p1).y == (*p2).y) {
   			return 0;
		} else {
   			return 1;
		}
	} else {
   		return 1;
	}
}

point:
typedef struct point		// structure to hold a point
{
 	double	x;
 	double	y;
 } point;


-- 
Ares Lagae
Technical Details
Message-ID: <3906B643.438814CD@student.kulak.ac.be>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcea4,c99c916367dfb9ec,start
X-Google-Attributes: gidfcea4,public
From: Ares Lagae <ares.lagae@student.kulak.ac.be>
Subject: C warning
Date: 2000/04/26
Message-ID: <3906B643.438814CD@student.kulak.ac.be>
X-Deja-AN: 615832383
Cache-Post-Path: marvin!root@pc-10-1-0-089.kulak.ac.be
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@belnet.be
X-Trace: naxos.belnet.be 956740966 16667 134.58.127.3 (26 Apr 2000 09:22:46 GMT)
Organization: KULeuvenNet
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
Mime-Version: 1.0
NNTP-Posting-Date: 26 Apr 2000 09:22:46 GMT
Newsgroups: be.comp.programming