[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: COLS should be type size_t

From: William McBrine
Subject: Re: COLS should be type size_t
Date: Wed, 26 Jul 2006 10:38:03 -0400

On 7/25/06, Gurganus, Brant L <address@hidden> wrote:

Currently COLS is an int which can default to being signed or unsigned on
different machines.

Eh? You might be thinking of char. An int is signed by definition.
(Specifically, it must be able to represent values from -32767 to

In any case, all plausible values for COLS are well within the
positive part of the minimum range for int.

As far as I can tell, though I don't have significant experience with
ncurses, there shouldn't be a reason for these to be negative and
since they are size of something, they should use size_t which,
on most machines, should be unsigned.

It's not the size of something _in bytes_, which is what size_t is
for, and which is the only appropriate use of size_t. Counting screen
columns in size_t would be a gross misuse of size_t, IMHO.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]