unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Booleans
Date: Sun, 15 Dec 2013 19:40:16 +0200	[thread overview]
Message-ID: <83vbyqdncv.fsf@gnu.org> (raw)

Paul, I'm not sure I understand why we want such a wholesale
replacement of 0/1 with false/true.  It's okay to make such changes as
part of other development, same as we do with whitespace, but why is
it a good idea to convert everything, including bitfields (which
required introduction of a new non-standard typedef), into booleans?

In any case, this part:

  -   If CCL_PROG is nil, we just reset the structure pointed by CCL.  */
  -int
  +   If CCL_PROG is nil, just reset the structure pointed by CCL.  */
  +bool
   setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
   {
     int i;
  @@ -1933,7 +1931,7 @@ setup_ccl_program (struct ccl_program *c

	 ccl_prog = ccl_get_compiled_code (ccl_prog, &ccl->idx);
	 if (! VECTORP (ccl_prog))
  -       return -1;
  +       return false;
	 vp = XVECTOR (ccl_prog);
	 ccl->size = vp->header.size;
	 ccl->prog = vp->contents;
  @@ -1950,14 +1948,11 @@ setup_ccl_program (struct ccl_program *c
     ccl->ic = CCL_HEADER_MAIN;
     for (i = 0; i < 8; i++)
       ccl->reg[i] = 0;
  -  ccl->last_block = 0;
  -  ccl->private_state = 0;
  +  ccl->last_block = false;
     ccl->status = 0;
     ccl->stack_idx = 0;
  -  ccl->suppress_error = 0;
  -  ccl->eight_bit_control = 0;
  -  ccl->quit_silently = 0;
  -  return 0;
  +  ccl->quit_silently = false;
  +  return true;
   }

as well as related changes, IMO should have been a separate commit, as
it is not a mechanical replacement, far from it.

And if changes like this:

  -#if 0
  +#if false

are intentional, then I'm afraid I don't see the point; please
explain.

Thanks.



             reply	other threads:[~2013-12-15 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-15 17:40 Eli Zaretskii [this message]
2013-12-15 23:03 ` Booleans Paul Eggert
2013-12-16  3:43   ` Booleans Stefan Monnier
2013-12-16  3:44   ` Booleans Eli Zaretskii
2013-12-16  7:39   ` Booleans Jarek Czekalski
2013-12-16 17:28     ` Booleans Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vbyqdncv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).