comparison dmd/root.c @ 1103:b30fe7e1dbb9

- Updated to DMD frontend 1.041. - Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 12 Mar 2009 20:37:27 +0100
parents aa953cc960b6
children fd631764eaac
comparison
equal deleted inserted replaced
1102:ae950bd712d3 1103:b30fe7e1dbb9
1 1
2 // Copyright (c) 1999-2006 by Digital Mars 2 // Copyright (c) 1999-2009 by Digital Mars
3 // All Rights Reserved 3 // All Rights Reserved
4 // written by Walter Bright 4 // written by Walter Bright
5 // www.digitalmars.com 5 // www.digitalmars.com
6 // License for redistribution is by either the Artistic License 6 // License for redistribution is by either the Artistic License
7 // in artistic.txt, or the GNU General Public License in gnu.txt. 7 // in artistic.txt, or the GNU General Public License in gnu.txt.
38 #endif 38 #endif
39 39
40 #include "port.h" 40 #include "port.h"
41 #include "root.h" 41 #include "root.h"
42 #include "dchar.h" 42 #include "dchar.h"
43 #include "mem.h" 43 #include "rmem.h"
44 #include "mars.h" 44 #include "mars.h"
45 45
46 #if 0 //__SC__ //def DEBUG 46 #if 0 //__SC__ //def DEBUG
47 extern "C" void __cdecl _assert(void *e, void *f, unsigned line) 47 extern "C" void __cdecl _assert(void *e, void *f, unsigned line)
48 { 48 {
374 { 374 {
375 case '"': 375 case '"':
376 instring ^= 1; // toggle inside/outside of string 376 instring ^= 1; // toggle inside/outside of string
377 continue; 377 continue;
378 378
379 #if MACINTOSH
380 case ',':
381 #endif
379 #if _WIN32 382 #if _WIN32
380 case ';': 383 case ';':
381 #endif 384 #endif
382 #if POSIX 385 #if POSIX
383 case ':': 386 case ':':
1342 } 1345 }
1343 1346
1344 void File::checkoffset(size_t offset, size_t nbytes) 1347 void File::checkoffset(size_t offset, size_t nbytes)
1345 { 1348 {
1346 if (offset > len || offset + nbytes > len) 1349 if (offset > len || offset + nbytes > len)
1347 error("Corrupt file '%s': offset x%"PRIxSIZE" off end of file",toChars(),offset); 1350 error("Corrupt file '%s': offset x%zx off end of file",toChars(),offset);
1348 } 1351 }
1349 1352
1350 char *File::toChars() 1353 char *File::toChars()
1351 { 1354 {
1352 return name->toChars(); 1355 return name->toChars();
1383 mem.mark(data); 1386 mem.mark(data);
1384 } 1387 }
1385 1388
1386 void OutBuffer::reserve(unsigned nbytes) 1389 void OutBuffer::reserve(unsigned nbytes)
1387 { 1390 {
1388 //printf("OutBuffer::reserve: size = %d, offset = %d, nbytes = %d\n", size, offset, nbytes); 1391 //printf("OutBuffer::reserve: size = %d, offset = %d, nbytes = %d\n", size, offset, nbytes);
1389 if (size - offset < nbytes) 1392 if (size - offset < nbytes)
1390 { 1393 {
1391 #if defined (__x86_64__)
1392 size = (offset + nbytes) * 2+2;
1393 #else
1394 size = (offset + nbytes) * 2; 1394 size = (offset + nbytes) * 2;
1395 #endif
1396 data = (unsigned char *)mem.realloc(data, size); 1395 data = (unsigned char *)mem.realloc(data, size);
1397 } 1396 }
1398 } 1397 }
1399 1398
1400 void OutBuffer::reset() 1399 void OutBuffer::reset()