Commit Graph

62 Commits

Author SHA1 Message Date
Sam Lantinga
7052036491 Fixed bug #926
Updated copyright to LGPL version 2.1 and year 2010
2010-01-24 21:10:53 +00:00
Ryan C. Gordon
4b5c236a0d Merged r4710:4711 from branches/SDL-1.2: Mac OS X SDL_stdlib qsort build fixes. 2010-01-06 20:17:35 +00:00
Sam Lantinga
ab09986ef7 Updated test code to use SDL_setenv() 2009-12-17 07:46:13 +00:00
Sam Lantinga
438cca0d46 Allocate memory only if we're going to overwrite an environment variable 2009-12-16 16:08:17 +00:00
Ryan C. Gordon
f644ae86a9 Implemented SDL_setenv(), moved SDL_putenv() to compat.
Fixes Bugzilla #779.
2009-12-16 10:59:51 +00:00
Sam Lantinga
e053affd71 Fixed bug #896
John Popplewell      2009-12-08 23:05:50 PST

Originally reported by AKFoerster on the mailing list.

Error decoding UTF8 Russian text to UTF-16LE on Windows, but specifically on
platforms without iconv support (the default on Windows).

Valid UTF8 characters are flagged as being overlong and then substituted by the
UNKNOWN_UNICODE character.

After studying the testiconv.c example program, reading the RFCs and putting
some printf statements in SDL_iconv.c the problem is in a test for 'Maximum
overlong sequences', specifically 4.2.1, which is carried out by the following
code:

      } else if ( p[0] >= 0xC0 ) {
        if ( (p[0] & 0xE0) != 0xC0 ) {
          /* Skip illegal sequences
            return SDL_ICONV_EILSEQ;
          */
          ch = UNKNOWN_UNICODE;
        } else {
          if ( (p[0] & 0xCE) == 0xC0 ) {    <<<<<<<< here
            overlong = SDL_TRUE;
          }
          ch = (Uint32)(p[0] & 0x1F);
          left = 1;
        }
      } else {

Here is the 2-byte encoding of a character in range 00000080 - 000007FF
    110xxxxx 10xxxxxx

The line in question is supposed to be checking for an overlong sequence which
would be less than
    11000001 10111111

which should be represented as a single byte.

BUT, the mask value (0xCE) is wrong, it isn't checking the top-most bit:
    11000001     value
    11001110     mask (incorrect)
       ^
and should be (0xDE):
    11000001     value
    11011110     mask (correct)

making the above code:

      } else if ( p[0] >= 0xC0 ) {
        if ( (p[0] & 0xE0) != 0xC0 ) {
          /* Skip illegal sequences
            return SDL_ICONV_EILSEQ;
          */
          ch = UNKNOWN_UNICODE;
        } else {
          if ( (p[0] & 0xDE) == 0xC0 ) {    <<<<<<<< here
            overlong = SDL_TRUE;
          }
          ch = (Uint32)(p[0] & 0x1F);
          left = 1;
        }
      } else {

I can supply a test program and/or a patch if required,

best regards,
John Popplewell
2009-12-11 08:03:43 +00:00
Sam Lantinga
9134eb02ab Fixed bug #797
Ryan C. Gordon      2009-09-19 08:25:21 PDT

This line in SDL_iconv_string (src/stdlib/SDL_iconv.c) ...

        if (!fromcode || !*fromcode) {
            tocode = "UTF-8";
        }

Is probably supposed to assign to "fromcode" and not "tocode".
2009-09-26 10:36:55 +00:00
Sam Lantinga
b6ec478790 Fixed compiling on 64-bit Windows 2009-09-06 04:40:54 +00:00
Sam Lantinga
b856e71f8d Fixed issues building 64-bit Windows binary 2009-09-05 23:37:35 +00:00
Sam Lantinga
306f1dc431 Von: Thomas Zimmermann
Betreff: [SDL] [PATCH] Make static variables const
Datum: Tue, 19 May 2009 19:45:37 +0200

Hi,

this is a set of simple changes which make some of SDL's internal static
arrays constant. The purpose is to shrink the number of write-able
static bytes and thus increase the number of memory pages shared between
SDL applications.

The patch set is against trunk@4513. Each of the attached patch files is
specific to a sub-system. The set is completed by a second mail, because
of the list's 40 KiB limit.

The files readelf-r4513.txt and readelf-const-patch.txt where made by
calling 'readelf -S libSDL.so'. They show the difference in ELF sections
without and with the patch. Some numbers measured on my x86-64:

Before

 [13] .rodata           PROGBITS         00000000000eaaa0  000eaaa0
      0000000000008170  0000000000000000   A       0     0     32
 [19] .data.rel.ro      PROGBITS         00000000003045e0  001045e0
      00000000000023d0  0000000000000000  WA       0     0     32
 [23] .data             PROGBITS         00000000003076e0  001076e0
      0000000000004988  0000000000000000  WA       0     0     32

After

 [13] .rodata           PROGBITS         00000000000eaaa0  000eaaa0
      0000000000009a50  0000000000000000   A       0     0     32
 [19] .data.rel.ro      PROGBITS         0000000000306040  00106040
      0000000000002608  0000000000000000  WA       0     0     32
 [23] .data             PROGBITS         0000000000309360  00109360
      0000000000002e88  0000000000000000  WA       0     0     32

The size of the write-able data section decreased considerably. Some
entries became const-after-relocation, while most of its content went
straight into the read-only data section.

Best regards, Thomas
2009-06-03 04:37:27 +00:00
Sam Lantinga
befb0f7f42 Updated copyright date 2008-12-08 00:27:32 +00:00
Sam Lantinga
6a2047e7ea Added software fallback for YUV overlay code when YUV textures aren't available. 2008-11-24 23:25:36 +00:00
Sam Lantinga
e6e45a547d Updated Visual C++ build 2008-09-15 07:34:36 +00:00
Sam Lantinga
9c4b835e49 Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga
2008-08-27 15:10:03 +00:00
Sam Lantinga
958f927c3d indent 2007-07-23 01:17:38 +00:00
Sam Lantinga
9ab551b38c Fixed bug #428
This fix is overkill, but approved by Doug Lea, and he'll be releasing a
new version of his malloc.c sometime next month.
2007-07-16 00:08:35 +00:00
Ryan C. Gordon
dbfdef0054 Reverted r3255:3256. Don't actually need it unless the build is broken. :) 2007-07-14 07:05:19 +00:00
Ryan C. Gordon
34c08ae1e9 Merged r3255:3256 from branches/SDL-1.2: stdlib problem with SDL_memcpy macro. 2007-07-14 06:46:33 +00:00
Sam Lantinga
08ab0f198f Merged Ryan's patch from revision 3238 in SDL 1.2 2007-07-12 08:07:30 +00:00
Sam Lantinga
691d57d9df Whoops, needed to remove the other version of getlocale() 2007-07-12 07:55:18 +00:00
Sam Lantinga
46a6657c71 Fixed bug #455
If passed "" for the character set, let iconv_open() interpret it as
locale.

This was merged from revision 3234,3235 from SDL 1.2
2007-07-12 07:52:50 +00:00
Sam Lantinga
bdab6824fd Fix for bug #447 merged from SDL 1.2 2007-07-04 08:01:04 +00:00
Sam Lantinga
c123a18337 Fixed bug #349
Solaris doesn't support the LATIN1 character set alias.

Merged from 1.2 svn revision 3133f
2007-07-04 07:08:16 +00:00
Sam Lantinga
34f8946d43 iconv() doesn't write to the data, just make compilers happy 2007-06-28 08:35:35 +00:00
Sam Lantinga
9822c65fd8 Merge iconv const changes from 1.2
I'm not entirely happy with them.  Maybe the right way to go is to leave
SDL_iconv() taking a non-const inbuf?  How often are we converting const
strings anyway?
2007-06-28 06:57:08 +00:00
Sam Lantinga
b6ab6bf6d5 make indent 2007-06-14 13:21:29 +00:00
Ryan C. Gordon
15db051b10 Merged r3047:3048 from branches/SDL-1.2: SDL_revcpy() off-by-one fix. 2007-06-04 11:45:10 +00:00
Ryan C. Gordon
7a0fd00cf4 Merged r2979:2980 from branches/SDL-1.2: unsigned char in ctype funcs. 2007-02-15 11:14:24 +00:00
Sam Lantinga
6bdc957609 Implemented blend modes in the D3D renderer 2006-07-19 05:03:21 +00:00
Sam Lantinga
0c86ca7a06 More of the Direct3D renderer is implemented, I'm not sure why it's not showing texture copies yet... 2006-07-14 06:40:53 +00:00
Sam Lantinga
f3567e6d90 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Fixed performance problem with testsprite2 on the D3D driver.
2006-07-13 08:13:02 +00:00
Sam Lantinga
6bc598ea61 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head. 2006-07-10 21:04:37 +00:00
Sam Lantinga
9a48decd81 Fixed bug #251 2006-06-20 05:55:23 +00:00
Sam Lantinga
b03120aa73 Fixed uninitialized variable warnings 2006-05-17 15:08:46 +00:00
Sam Lantinga
5400b91864 Fixed some bugs in string handling
Cleaned up error message code, UTF-8 is used instead of UCS2
Added detection for MPEG Layer 3 audio for more informative errors.
2006-05-11 21:03:23 +00:00
Sam Lantinga
e1ae9a0b81 Fixed bug #175
Removed obsolete .cvsignore files... whee!
2006-03-23 21:39:58 +00:00
Sam Lantinga
b6313a8a66 RFC 3629 restricted the range of characters encoded with UTF-8 to 0000-10FFFF (the UTF-16 accessible range) 2006-03-13 17:25:44 +00:00
Sam Lantinga
2650f98d04 *** empty log message *** 2006-03-13 02:26:47 +00:00
Sam Lantinga
3227f8dde8 Added _strnicmp support 2006-03-13 02:12:39 +00:00
Sam Lantinga
2b03f1c722 Win32 fixes 2006-03-13 02:06:33 +00:00
Sam Lantinga
80b5071de2 props yo 2006-03-13 01:17:22 +00:00
Sam Lantinga
992d5b4402 UTF-32 by definition can't handle characters higher than 0x10FFFF 2006-03-13 01:16:16 +00:00
Sam Lantinga
48c546dc44 Added UTF-8 <-> UTF-16 <-> UTF-32 <-> UCS-2 <-> UCS-4 conversion capability 2006-03-13 01:08:00 +00:00
Sam Lantinga
e007ca640c Fixed more Win64 portability issues 2006-03-06 08:11:10 +00:00
Sam Lantinga
223544e90d Updated WinCE support by Dmitry (with some tweaks)
Converted the disk audio driver to SDL_RWops for portability
2006-03-04 08:24:35 +00:00
Sam Lantinga
62c5e3a5d5 Fixed a bunch of 64-bit compatibility problems 2006-03-01 09:43:47 +00:00
Sam Lantinga
2861771aa5 SDL_windows.h is no longer necessary 2006-02-25 22:18:25 +00:00
Sam Lantinga
190b425364 Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
2006-02-21 08:46:50 +00:00
Sam Lantinga
0ef73d9eae Use only safe string functions 2006-02-19 23:46:34 +00:00
Sam Lantinga
f05187e232 New configure-based build system. Still work in progress, but much improved 2006-02-16 10:11:48 +00:00