Re: Problems with write_to_output and buf (sprintf)

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 07/31/02


On Wed, 31 Jul 2002, Mathew Earle Reuther wrote:

> Question on bool, since I don't have any c99 reference stuff handy: Is
> it simply a 1 or 0 return?  Should I convert anything that is using int
> for a yes/no or true/false to bool instead?

CircleMUD typedefs bool to be a byte.  C99 has a boolean type named _Bool
with a supporting header, stdbool.h that does:

  #define bool    _Bool
  #define true    1
  #define false   0

or something similar.  You don't need to go through all of the code and
change any int returns to bool/_Bool unless you really want to.  There may
be a very slight difference in memory usage, but certainly nothing that
you'd ordinarily notice.  The main benefit of bool is to the programmer.
It documents how a value is going to be used.


> Other than my own lack of skill that is! :)

Lack of skill just increases the amount of work needed to accomplish
something.  Keep up the good effort.


-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT