]> git.pond.sub.org Git - empserver/commit
(sctstr, shpstr, lndstr): Use `short' instead of `unsigned short' for
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 5 Mar 2004 07:56:50 +0000 (07:56 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 5 Mar 2004 07:56:50 +0000 (07:56 +0000)
commit9989c5b3ec8898aee7a486ec883de51d8b6a7a2d
treef3895e60f4e4ac30c1d34edc58d3b27daee51898
parent58e93c0ea316e88f3bb8196f41d8c07a873b7472
(sctstr, shpstr, lndstr): Use `short' instead of `unsigned short' for
item storage.  Rationale: Permitted values are 0..M, where M depends
on the container.  The largest M is ITEM_MAX (9999).  Benign
overflow/underflow occurs at those limits.  Catastrophic
overflow/underflow occurs at the limits of the underlying data type.
For `unsigned short', any underflow is catastrophic.  For `short',
benign undeflow happens long before catastrophic underflow.  Moreover,
unsigned arithmetic tends to trip up unwary programmers.
include/land.h
include/sect.h
include/ship.h