in reply to Re^26: Interleaving bytes in a string quickly
in thread Interleaving bytes in a string quickly
Sorry, but I'm still gonna disagree with you.
An overflow isn't a change in meaning, it's a change in value.
No. The value (bitpattern) hasn't changed one iota. Only the meaning assigned to that value:
#! perl -slw use 5.010; use strict; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'END_C', NAME => '_junk', CLEAN_AFTER_BUILD => 0; void doit( SV *dummy ) { int i = -1; unsigned int j = i; printf( "i: %d : %4x\n", i, i ); printf( "j: %u : %4x\n", j, j ); } END_C doit( 1 ); __END__ C:\test>junk ... i: -1 : ffffffff j: 4294967295 : ffffffff
And there is no "overflow" involved, as the full build log below dmonstrates. No warnings. Which makes it the perfect analogy for two identical strings of bytes, with differing setting of the SVf_UTF8 flag. Same value, different meaning. To Perl.
something I have agreed with.
Where? I've looked at the whole thread again and this:
It doesn't actually do the encoding,.
is the first time I can see.
but it's the only way you'll get the encoded version implicitly.
I've been pointing out right from the very beginning, that I'm not interested in getting "the encoded version", because there will never be an encoded version. Because I'm never going to call encode() on binary data that can never be safely or logically treated as any form of unicode.
C:\test>junk Starting Build Preprocess Stage Finished Build Preprocess Stage Starting Build Parse Stage Finished Build Parse Stage Starting Build Glue 1 Stage Finished Build Glue 1 Stage Starting Build Glue 2 Stage Finished Build Glue 2 Stage Starting Build Glue 3 Stage Finished Build Glue 3 Stage Starting Build Compile Stage Starting "perl Makefile.PL" Stage Writing Makefile for _junk Finished "perl Makefile.PL" Stage Starting "make" Stage Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl64\bin\perl.exe C:\Perl64\lib\ExtUtils\xsubpp -typemap + C:\Perl64\lib\ExtUtils\typemap _junk cl -c -IC:/test -nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -Wp +64 -fp:precise -DWIN32 -D_CONSOLE -DNO cl : Command line warning D9035 : option 'Wp64' has been deprecated an +d will be removed in a future release cl : Command line warning D9035 : option 'Wp64' has been deprecated an +d will be removed in a future release _junk.c Running Mkbootstrap for _junk () C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 _ +junk.bs C:\Perl64\bin\perl.exe -MExtUtils::Mksymlists -e "Mksymlists( +'NAME'=>\"_junk\", 'DLBASE' => '_junk' link -out:blib\arch\auto\_junk\_junk.dll -dll -nologo -nodefau +ltlib -debug -opt:ref,icf -ltcg -libp Creating library blib\arch\auto\_junk\_junk.lib and object blib\arc +h\auto\_junk\_junk.exp Generating code Finished generating code if exist blib\arch\auto\_junk\_junk.dll.manifest mt -nologo -m +anifest blib\arch\auto\_junk\_junk.dll if exist blib\arch\auto\_junk\_junk.dll.manifest del blib\arch +\auto\_junk\_junk.dll.manifest C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 b +lib\arch\auto\_junk\_junk.dll C:\Perl64\bin\perl.exe -MExtUtils::Command -e "cp" -- _junk.bs + blib\arch\auto\_junk\_junk.bs C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 b +lib\arch\auto\_junk\_junk.bs Finished "make" Stage Starting "make install" Stage Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Installing C:\test\_Inline\lib\auto\_junk\_junk.dll Installing C:\test\_Inline\lib\auto\_junk\_junk.exp Installing C:\test\_Inline\lib\auto\_junk\_junk.lib Installing C:\test\_Inline\lib\auto\_junk\_junk.pdb Finished "make install" Stage Starting Cleaning Up Stage Finished Cleaning Up Stage Finished Build Compile Stage i: -1 : ffffffff j: 4294967295 : ffffffff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^28: Interleaving bytes in a string quickly
by ikegami (Patriarch) on Mar 01, 2010 at 17:14 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 17:23 UTC | |
by ikegami (Patriarch) on Mar 01, 2010 at 17:31 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 17:37 UTC | |
by ikegami (Patriarch) on Mar 01, 2010 at 17:39 UTC | |
|