[Patches] [ python-Patches-680146 ] _iconv_module type casting and spelling errors

SourceForge.net noreply@sourceforge.net
Tue, 04 Feb 2003 09:58:38 -0800


Patches item #680146, was opened at 2003-02-04 13:09
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=680146&group_id=5470

Category: Modules
Group: Python 2.3
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Christos Georgiou (tzot)
Assigned to: Walter Dörwald (doerwalter)
Summary: _iconv_module type casting and spelling errors

Initial Comment:
Compiling under SGI Irix and MIPSPro, I corrected two 
type casts which under gcc are plain warnings.  They 
are both related to size_t and int comparisons, since 
size_t is unsigned.

I also corrected the spelling mistake of "choosen" 
instead of "chosen"

----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2003-02-04 18:58

Message:
Logged In: YES 
user_id=89016

Argl, Neal was faster! ;)

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-04 18:58

Message:
Logged In: YES 
user_id=33168

Attaching a patch with more changes.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2003-02-04 18:54

Message:
Logged In: YES 
user_id=89016

OK, I checked in a slightly different version. Can you check
whether the warnings are still gone?

----------------------------------------------------------------------

Comment By: Christos Georgiou (tzot)
Date: 2003-02-04 18:51

Message:
Logged In: YES 
user_id=539787

Yes, it makes sense (and no compilation errors or warnings).  
Now, if only I could manage to ignore completely iconv, 
because Irix iconv has no ASCII encoding and there are 
problems with the big-endianess (see my notes to patch 
670715).
I need to delve into the problem with big-endian architecture, 
but first I would like to compile ignoring completely the 
_iconv_codec module; I do not know how to do that, though. 
(I'm messing with setup.py now).
We can close this patch here, thank you.

----------------------------------------------------------------------

Comment By: Christos Georgiou (tzot)
Date: 2003-02-04 18:32

Message:
Logged In: YES 
user_id=539787

The code is:

res = iconv(hdl, &inptr, &insize, &outptr, (size_t *)&outsize);
    if (res == (size_t)-1)

MIPSPro compiler 7.3 unfortunately throws an error instead of 
a warning, even if res is int, because iconv returns size_t, 
which is unsigned.  This is erroneous on MIPSPro's behalf, 
but it's harmless.

I'm gonna check your patch in a quarter.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-04 18:26

Message:
Logged In: YES 
user_id=33168

I'm not sure why you've case res == (size_t)-1.  All other
changes make sense.  I've modified the patch a bit so that
insize and outsize are size_t instead of int.  Does this
make sense and work for you?

----------------------------------------------------------------------

Comment By: Christos Georgiou (tzot)
Date: 2003-02-04 13:28

Message:
Logged In: YES 
user_id=539787

Third attempt: the checkbox is checked

----------------------------------------------------------------------

Comment By: Christos Georgiou (tzot)
Date: 2003-02-04 13:12

Message:
Logged In: YES 
user_id=539787

For some reason the attachment was not uploaded the first 
time.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=680146&group_id=5470