www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/22/13:51:30

Message-ID: <35B5276B.6447@teleline.es>
Date: Wed, 22 Jul 1998 01:42:35 +0200
From: Mariano Alvarez Fernández <malfer AT teleline DOT es>
Reply-To: malfer AT teleline DOT es
Organization: teleline.es
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp AT delorie DOT com
Subject: Re: About DJGPP v2.02, more results
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980721112221 DOT 6992L-100000 AT is>

Eli Zaretskii wrote:
> 
> I think this should be faster:
> 
> int strcopnb( char *dest, char *org, int max )
> {
>   int i;
> 
>   memcpy( dest,org,max );
>   dest[max] = '\0';
>   /* max = strlen( dest ); redundant: we just put '\0' at dest[max] */
>   for( i=max-1; i >= 0 && dest[i] == ' '; i-- );
>   dest[i+1] = '\0';
>   return 0;
> }
>

Yes, but it's buggy when strlen(org) is less than max.

> This thread is quickly degenerating into a C optimization class ;-).

I apreciate a lot your advices and I like write about, but I think the
very important thing is the big perfomance of DJGPP v2.02 whith lan
data-base applications. I encourage any people whit a data-base app to
test 2.02.

Regards, M.Alvarez

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019