unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Booleans
@ 2013-12-15 17:40 Eli Zaretskii
  2013-12-15 23:03 ` Booleans Paul Eggert
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2013-12-15 17:40 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-16 17:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-15 17:40 Booleans Eli Zaretskii
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

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).