From p.dalgaard at biostat.ku.dk  Thu Nov 18 22:31:48 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Thu Nov 18 22:33:36 2004
Subject: [Rd] Declaration of RuleThickness() in src/main/plotmath.c
	(PR#7380)
In-Reply-To: <20041118204946.AB3B4F6DA@slim.kubism.ku.dk>
References: <20041118204946.AB3B4F6DA@slim.kubism.ku.dk>
Message-ID: <x23bz6sv23.fsf@biostat.ku.dk>

huber@ebi.ac.uk writes:

> Full_Name: Wolfgang Huber
> Version: R-2.0.1
> OS: HP-UX B.11.23 ia64
> Submission from: (NULL) (81.104.215.6)
> 
> 
> Hi, 
> 
> I hope I am not missing something basic... I am using a somewhat exotic compiler
> and OS, but if I understand what I am seeing the problem is more general:
> 
> In src/main/plotmath.c, the following function is defined
> 
> /* Thickness of rules */
> static double RuleThickness()
> {
>     return 0.015;
> }
> 
> but later it is called in expressions like
> 
>   RuleThickness(gc, dd)
> 
> This leads to a compiler error:
> 
> cc +DD64 -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre 
> -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H
>   -O +e -c plotmath.c -o plotmath.o
> Error 181: "plotmath.c", line 255 # Expected 0 argument(s) for "double
> RuleThickness()"; had 2 instead.
>                 + 3.51 * RuleThickness(gc, dd)
>  
> 
> It would appear that the function definition should include the argument
> (R_GE_gcontext *gc, GEDevDesc *dd), like in the other functions that are defined
> around there.

It appears like that to me too, but why, oh why, hasn't any of the
other compilers been complaining about it???? (Perhaps this is
actually legal ANSI C, and compilers are only supposed to barf if you
declare statid double RuleThickness(void)?)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Declaration of RuleThickness() in src/main/plotmath.c (PR#7380)
Peter Dalgaard