A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026926.html below:

[Python-Dev] PEP 296 - The Buffer Problem

[Python-Dev] PEP 296 - The Buffer Problem [Python-Dev] PEP 296 - The Buffer ProblemOren Tirosh oren-py-d@hishome.net
Thu, 25 Jul 2002 06:01:58 -0400
On Thu, Jul 25, 2002 at 09:45:44AM +0200, Thomas Heller wrote:
> > >> Can you index these byte arrays by longs?
> > 
> > > You could index it via a long, but using a LONG_LONG is safer.  My
> > > understanding is that on Win64 a long will only be 32 bits even though
> > > void* is 64 bits.
> > 
> > Right.
> 
> So isn't the conclusion that sizeof(size_t) == sizeof(void *) on
> any platform, and so the index should be of type size_t instead of
> int, long, or LONG_LONG (aka __int64 in some places)?

The obvious type to index byte arrays would be ptrdiff_t.

If (char*)-(char*)==ptrdiff_t then (char*)+ptrdiff_t==(char*)

	Oren



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4