Mail Archives: djgpp/1997/09/23/05:57:57
On 22 Sep 1997, Herman Schoenfeld wrote:
> >In fact, altough ANSI C permits it, I'd advise against declaring *any* 
> >functions (even with constant argument lists) with shorts or floats as 
> >one of the arguments; I suggest to always use ints and doubles instead.
> 
> Why not shorts?
> 
> ie, if you wanted a memcpy routine word writes then 
> 
> void memcpy(char *to, char *from, int len)
> {
>   len /=sizeof(short);
>   char *t = (short *) to;
>   char *f = (short *) from; 
>   while(len--) {
>    *t++=*f++
>    };
> };
Unless I miss something, this is totally unrelated both to the
question asked by Brett Porter (the originator of this thread) and to
my reply.  I don't advise against *any* use of shorts, I just say that
you should IMHO avoid using shorts in function *prototypes*.
- Raw text -