Re: [Python-Dev] ssize_t branch merged

2006-02-18 Thread Martin v. Löwis
Travis E. Oliphant wrote: > Why not just > > #if SIZEOF_SIZE_T == 2 > #define PY_SSIZE_T_MAX 0x7fff > #elif SIZEOF_SIZE_T == 4 > #define PY_SSIZE_T_MAX 0x7fff > #elif SIZEOF_SIZE_T == 8 > #define PY_SSIZE_T_MAX 0x7fff > #elif SIZEOF_SIZE_T == 16 > #define PY_SSIZE_T_MAX 0x7

Re: [Python-Dev] ssize_t branch merged

2006-02-18 Thread Travis E. Oliphant
Martin v. Löwis wrote: > Neal Norwitz wrote: > >>I suppose that might be nice, but would require configure magic. I'm >>not sure how it could be done on Windows. > > > Contributions are welcome. On Windows, it can be hard-coded. > > Actually, something like > > #if SIZEOF_SIZE_T == SIZEOF_INT

Re: [Python-Dev] ssize_t branch merged

2006-02-18 Thread Martin v. Löwis
Neal Norwitz wrote: > I suppose that might be nice, but would require configure magic. I'm > not sure how it could be done on Windows. Contributions are welcome. On Windows, it can be hard-coded. Actually, something like #if SIZEOF_SIZE_T == SIZEOF_INT #define PY_SSIZE_T_MAX INT_MAX #elif SIZEO

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Neal Norwitz
On 2/17/06, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > > I'm very sorry for my silliness. I do see the problem I was having now. >Thank you for helping me out. I was assuming that PY_SSIZE_T_MAX > could be used in a pre-processor statement like LONG_MAX and INT_MAX. > > In other words >

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Travis E. Oliphant
Tim Peters wrote: > [Travis Oliphant] > >>Maybe I have the wrong version of code. In my pyport.h (checked out >>from svn trunk) I have. >> >>#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) >> >>What is size_t? > > > size_t is an unsigned integral type defined by, required by, and used >

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Tim Peters
[Travis Oliphant] > Maybe I have the wrong version of code. In my pyport.h (checked out > from svn trunk) I have. > > #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1)) > > What is size_t? size_t is an unsigned integral type defined by, required by, and used all over the place in standard C.

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Travis Oliphant
Thomas Wouters wrote: > On Fri, Feb 17, 2006 at 04:40:08PM -0700, Travis Oliphant wrote: > > >>What is PY_SSIZE_T_MAX supposed to be? The definition in pyport.h >>doesn't compile. > Maybe I have the wrong version of code. In my pyport.h (checked out from svn trunk) I have. #define PY_SSIZE_

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Thomas Wouters
On Fri, Feb 17, 2006 at 04:40:08PM -0700, Travis Oliphant wrote: > What is PY_SSIZE_T_MAX supposed to be? The definition in pyport.h > doesn't compile. Why not? Does it give an error for your particular platform? What platform is that? What are HAVE_SSIZE_T, SIZEOF_VOID_P and SIZEOF_SIZE_T defi

Re: [Python-Dev] ssize_t branch merged

2006-02-17 Thread Travis Oliphant
Martin v. Löwis wrote: > Just in case you haven't noticed, I just merged > the ssize_t branch (PEP 353). > > If you have any corrections to the code to make which > you would consider bug fixes, just go ahead. > > If you are uncertain how specific problems should be resolved, > feel free to ask.

Re: [Python-Dev] ssize_t branch merged

2006-02-15 Thread Guido van Rossum
Great! I'll mark the PEP as accepted. (Which doesn't mean you can't update it if changes are found necessary.) --Guido On 2/15/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Just in case you haven't noticed, I just merged > the ssize_t branch (PEP 353). > > If you have any corrections to the