[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[TSVN] Antwort: Re: [TSVN] very bad code rewrite !!!

From: <Stefan.Fuhrmann_at_etas.de>
Date: 2005-08-24 13:54:51 CEST

Simon Large <simon@skirridsystems.co.uk> wrote:
> Юрий Першин wrote:
> > How did you made this ???
> What is wrong with the original? We are comparing string lengths, not
> string addresses. strlen() returns size_t not ptrdiff_t.

> Am I missing something?

Juri is right. When I made the patch (I'm not sure,
if that has actually been mine), I was not aware that
pointer differences have their own type. ptrdiff_t is
signed, size_t is not.

Since this difference is important only when comparing
expressions (like "if (diff < 0)" ) they should be
interchangeable in most places.

I think the proper use is
* size_t for absolute addressing (maily indices)
* ptrdiff_t for relative addressing (mainly pointer arithmetics)

Just my 0.02€.

Received on Wed Aug 24 13:55:13 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.