Re: Zone limits

From: Herbert Kremser (kremser@flinux.tu-graz.ac.at)
Date: 11/23/95


On Thu, 23 Nov 1995, William Karp wrote:

> > Now a question for you guys that have been coding Circle for a while.
> > I would like to change this value to a signed int which would be a 32
> > bit value. 
> 
> Well, your on the right track, a signed int will give you a little over 
> 32000 above and below zero.  if you change it to an unsigned int, then 
> you can go up to a little over 65000 (positive only).  but as long as the 
> compiler and such will handle it, (and as long as your doing the work) 
> why not change it to something like a long (+-)2 billion, 147 million, or 
> if ou wanted to get really crazy, a unsigned long(+) 4 billion 294 million.

> Just to let you know, an int, and unsigned int is both 16 bit 
> and the long is the 32bit number you were referring to.

This, of course, is not true. These values, which you give here, are the
minimal values for these types, which the standard forces for any ANSI-C
compiler.
So if you want to write real ANSI-C programs, you should not expect
more than what you said. But when writing a mud, it can't be only ANSI-C
anyway, since you need several systemdependant library function.
By thinking of int's as 16bit, and longs as 32bit, you wouldn't do anything
wrong, but maybe waste some memory.
Afaik, there's no circle mud running in an 16bit environment, so it's
rather safe to assume int's as 32bit. Even if you port circle to DOS by
use of gcc (DJGPP) this would be still a 32bit environment, only some
native DOS 16bit compilers could cause trouble.

As a rule of thumb you can expect:

Most muds run on 32bit machines which usually have set:
MAXSHORT: 32767
MAXINT: 2147483647
MAXLONG: 2147483647

Expect more and more muds to run on 64bit, alphas etc, which usually have:
MAXSHORT: 32767
MAXINT: 2147483647
MAXLONG: 9223372036854775807

Check values.h, for your machine's settings.

So i think the best way is to use rather int, than long, if you need more
than 65534 rooms.


Herbert
__
[on public request 12 lines of signature deleted]  *snip* ;)



This archive was generated by hypermail 2b30 : 12/07/00 PST