Skip to content

Commit

Permalink
Merge pull request #4700 from WalterBright/rmINTSIZE
Browse files Browse the repository at this point in the history
Remove __INTSIZE
  • Loading branch information
yebblies committed May 31, 2015
2 parents 1857799 + 6c691d1 commit 9feea47
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 37 deletions.
4 changes: 0 additions & 4 deletions src/backend/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ enum LANG
#define LARGECODE 0
#endif

#ifndef __INTSIZE
#define __INTSIZE 4 // host ints are 4 bytes
#endif

#if SPP || SCPP
#include "msgs2.h"
#endif
Expand Down
1 change: 0 additions & 1 deletion src/backend/cdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
_M_AMD64 AMD 64 processor
Hosts no longer supported:
__INTSIZE==2 16 bit compilations
__OS2__ IBM OS/2
DOS386 32 bit DOS extended executable
DOS16RM Rational Systems 286 DOS extender
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cgcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ STATIC void addhcstab(elem *e,int hash)
{
assert(h == hcsmax);
// With 32 bit compiles, we've got memory to burn
hcsmax += (__INTSIZE == 4) ? (hcsmax + 128) : 100;
hcsmax += hcsmax + 128;
assert(h < hcsmax);
#if TX86
hcstab = (hcs *) util_realloc(hcstab,hcsmax,sizeof(hcs));
Expand Down
2 changes: 0 additions & 2 deletions src/backend/cgcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,12 @@ idx_t cv_debtyp(debtyp_t *d)
debtypmax += 10;
#else
debtypmax += debtypmax + 16;
#if __INTSIZE == 4
if (debtypmax > 0xE000)
debtypmax = 0xE000;
#if SCPP
if (debtyptop >= debtypmax)
err_fatal(EM_2manytypes,debtypmax); // too many types
#endif
#endif
#endif
// Don't use MEM here because we can allocate pretty big
// arrays with this, and we don't want to overflow the PH
Expand Down
13 changes: 1 addition & 12 deletions src/backend/cgobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void too_many_symbols()
#endif
}

#if !DEBUG && TX86 && __INTSIZE == 4 && !defined(_MSC_VER)
#if !DEBUG && TX86 && !defined(_MSC_VER)
__declspec(naked) int __pascal insidx(char *p,unsigned index)
{
#undef AL
Expand Down Expand Up @@ -936,19 +936,8 @@ void Obj::linnum(Srcpos srcpos,targ_size_t offset)
obj.linvec = vec_realloc(obj.linvec,linnum + 1000);
if (offset >= vec_numbits(obj.offvec))
{
#if __INTSIZE == 2
unsigned newsize = (unsigned)offset * 2;

if (offset >= 0x8000)
{ newsize = 0xFF00;
assert(offset < newsize);
}
if (newsize != vec_numbits(obj.offvec))
obj.offvec = vec_realloc(obj.offvec,newsize);
#else
if (offset < 0xFF00) // otherwise we overflow ph_malloc()
obj.offvec = vec_realloc(obj.offvec,offset * 2);
#endif
}
if (
#if 1 // disallow multiple offsets per line
Expand Down
2 changes: 0 additions & 2 deletions src/backend/outbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,13 @@ void Outbuffer::write32(int v)
* Writes a 64 bit long.
*/

#if __INTSIZE == 4
void Outbuffer::write64(long long v)
{
if (pend - p < 8)
reserve(8);
*(long long *)p = v;
p += 8;
}
#endif

/**
* Writes a 32 bit float.
Expand Down
2 changes: 0 additions & 2 deletions src/backend/outbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ struct Outbuffer
/**
* Writes a 64 bit long.
*/
#if __INTSIZE == 4
void write64(long long v);
#endif

/**
* Writes a 32 bit float.
Expand Down
8 changes: 1 addition & 7 deletions src/backend/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ symbol * lookupsym(const char *p)

symbol * findsy(const char *p,symbol *rover)
{
#if __INTSIZE == 4 && TX86 && __DMC__
#if TX86 && __DMC__
volatile int len;
__asm
{
Expand Down Expand Up @@ -2171,12 +2171,6 @@ void symboltable_balance(symbol **ps)
count_symbols(*ps);
//dbg_printf("Number of global symbols = %d\n",balance.nsyms);

#if __INTSIZE == 2
// Don't balance tree if we get 16 bit overflow
if (balance.nsyms >= (unsigned)(0x10000 / sizeof(symbol *)))
goto Lret;
#endif

// Use malloc instead of mem because of pagesize limits
balance.array = (symbol **) malloc(balance.nsyms * sizeof(symbol *));
if (!balance.array)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/util2.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void util_progress(int linnum)
* else -1
*/

#if TX86 && __INTSIZE == 4 && __DMC__ && !_DEBUG_TRACE
#if TX86 && __DMC__ && !_DEBUG_TRACE

int binary(const char *p, const char **table,int high)
{
Expand Down
6 changes: 1 addition & 5 deletions src/backend/var.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 1985-1998 by Symantec
// Copyright (C) 2000-2010 by Digital Mars
// Copyright (C) 2000-2015 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
Expand Down Expand Up @@ -29,11 +29,7 @@
#include "tytab.c"

#if __SC__ && _MSDOS
#if __INTSIZE == 4
unsigned __cdecl _stack = 100000; // set default stack size
#else
unsigned __cdecl _stack = 60000; // set default stack size
#endif
#endif

/* Global flags:
Expand Down

0 comments on commit 9feea47

Please sign in to comment.