comparison src/tooltalk.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 308d34e9f07d
children
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
289 289
290 290
291 static int 291 static int
292 tooltalk_constant_value (Lisp_Object s) 292 tooltalk_constant_value (Lisp_Object s)
293 { 293 {
294 if (INTP (s)) 294 if (FIXNUMP (s))
295 return XINT (s); 295 return XFIXNUM (s);
296 else if (SYMBOLP (s)) 296 else if (SYMBOLP (s))
297 return XINT (XSYMBOL (s)->value); 297 return XFIXNUM (XSYMBOL (s)->value);
298 else 298 else
299 return 0; /* should never occur */ 299 return 0; /* should never occur */
300 } 300 }
301 301
302 static void 302 static void
584 EQ (attribute, (Qtt_arg_ival)) || 584 EQ (attribute, (Qtt_arg_ival)) ||
585 EQ (attribute, (Qtt_arg_mode)) || 585 EQ (attribute, (Qtt_arg_mode)) ||
586 EQ (attribute, (Qtt_arg_type)) || 586 EQ (attribute, (Qtt_arg_type)) ||
587 EQ (attribute, (Qtt_arg_val))) 587 EQ (attribute, (Qtt_arg_val)))
588 { 588 {
589 CHECK_INT (argn); 589 CHECK_FIXNUM (argn);
590 n = XINT (argn); 590 n = XFIXNUM (argn);
591 } 591 }
592 592
593 if (!VALID_TOOLTALK_MESSAGEP (m)) 593 if (!VALID_TOOLTALK_MESSAGEP (m))
594 return Qnil; 594 return Qnil;
595 595
607 607
608 else if (EQ (attribute, Qtt_arg_val)) 608 else if (EQ (attribute, Qtt_arg_val))
609 return tt_message_arg_bval_vector (m, n); 609 return tt_message_arg_bval_vector (m, n);
610 610
611 else if (EQ (attribute, Qtt_args_count)) 611 else if (EQ (attribute, Qtt_args_count))
612 return make_int (tt_message_args_count (m)); 612 return make_fixnum (tt_message_args_count (m));
613 613
614 else if (EQ (attribute, Qtt_address)) 614 else if (EQ (attribute, Qtt_address))
615 return tt_address_symbol (tt_message_address (m)); 615 return tt_address_symbol (tt_message_address (m));
616 616
617 else if (EQ (attribute, Qtt_class)) 617 else if (EQ (attribute, Qtt_class))
618 return tt_class_symbol (tt_message_class (m)); 618 return tt_class_symbol (tt_message_class (m));
619 619
620 else if (EQ (attribute, Qtt_disposition)) 620 else if (EQ (attribute, Qtt_disposition))
621 return make_int (tt_message_disposition (m)); 621 return make_fixnum (tt_message_disposition (m));
622 622
623 else if (EQ (attribute, Qtt_file)) 623 else if (EQ (attribute, Qtt_file))
624 return tt_build_c_string (tt_message_file (m)); 624 return tt_build_c_string (tt_message_file (m));
625 625
626 else if (EQ (attribute, Qtt_gid)) 626 else if (EQ (attribute, Qtt_gid))
627 return make_int (tt_message_gid (m)); 627 return make_fixnum (tt_message_gid (m));
628 628
629 else if (EQ (attribute, Qtt_handler)) 629 else if (EQ (attribute, Qtt_handler))
630 return tt_build_c_string (tt_message_handler (m)); 630 return tt_build_c_string (tt_message_handler (m));
631 631
632 else if (EQ (attribute, Qtt_handler_ptype)) 632 else if (EQ (attribute, Qtt_handler_ptype))
658 658
659 else if (EQ (attribute, Qtt_state)) 659 else if (EQ (attribute, Qtt_state))
660 return tt_state_symbol (tt_message_state (m)); 660 return tt_state_symbol (tt_message_state (m));
661 661
662 else if (EQ (attribute, Qtt_status)) 662 else if (EQ (attribute, Qtt_status))
663 return make_int (tt_message_status (m)); 663 return make_fixnum (tt_message_status (m));
664 664
665 else if (EQ (attribute, Qtt_status_string)) 665 else if (EQ (attribute, Qtt_status_string))
666 return tt_build_c_string (tt_message_status_string (m)); 666 return tt_build_c_string (tt_message_status_string (m));
667 667
668 else if (EQ (attribute, Qtt_uid)) 668 else if (EQ (attribute, Qtt_uid))
669 return make_int (tt_message_uid (m)); 669 return make_fixnum (tt_message_uid (m));
670 670
671 else if (EQ (attribute, Qtt_callback)) 671 else if (EQ (attribute, Qtt_callback))
672 return XTOOLTALK_MESSAGE (message_)->callback; 672 return XTOOLTALK_MESSAGE (message_)->callback;
673 673
674 else if (EQ (attribute, Qtt_prop)) 674 else if (EQ (attribute, Qtt_prop))
714 714
715 if (EQ (attribute, (Qtt_arg_bval)) || 715 if (EQ (attribute, (Qtt_arg_bval)) ||
716 EQ (attribute, (Qtt_arg_ival)) || 716 EQ (attribute, (Qtt_arg_ival)) ||
717 EQ (attribute, (Qtt_arg_val))) 717 EQ (attribute, (Qtt_arg_val)))
718 { 718 {
719 CHECK_INT (argn); 719 CHECK_FIXNUM (argn);
720 n = XINT (argn); 720 n = XFIXNUM (argn);
721 } 721 }
722 722
723 if (!VALID_TOOLTALK_MESSAGEP (m)) 723 if (!VALID_TOOLTALK_MESSAGEP (m))
724 return Qnil; 724 return Qnil;
725 725
771 Qtooltalk_encoding); 771 Qtooltalk_encoding);
772 tt_message_arg_bval_set (m, n, (unsigned char *) value_ext, value_ext_len); 772 tt_message_arg_bval_set (m, n, (unsigned char *) value_ext, value_ext_len);
773 } 773 }
774 else if (EQ (attribute, Qtt_arg_ival)) 774 else if (EQ (attribute, Qtt_arg_ival))
775 { 775 {
776 CHECK_INT (value); 776 CHECK_FIXNUM (value);
777 tt_message_arg_ival_set (m, n, XINT (value)); 777 tt_message_arg_ival_set (m, n, XFIXNUM (value));
778 } 778 }
779 else if (EQ (attribute, Qtt_arg_val)) 779 else if (EQ (attribute, Qtt_arg_val))
780 { 780 {
781 const char *value_ext; 781 const char *value_ext;
782 CHECK_STRING (value); 782 CHECK_STRING (value);
783 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding); 783 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
784 tt_message_arg_val_set (m, n, value_ext); 784 tt_message_arg_val_set (m, n, value_ext);
785 } 785 }
786 else if (EQ (attribute, Qtt_status)) 786 else if (EQ (attribute, Qtt_status))
787 { 787 {
788 CHECK_INT (value); 788 CHECK_FIXNUM (value);
789 tt_message_status_set (m, XINT (value)); 789 tt_message_status_set (m, XFIXNUM (value));
790 } 790 }
791 else if (EQ (attribute, Qtt_callback)) 791 else if (EQ (attribute, Qtt_callback))
792 { 792 {
793 CHECK_SYMBOL (value); 793 CHECK_SYMBOL (value);
794 XTOOLTALK_MESSAGE (message_)->callback = value; 794 XTOOLTALK_MESSAGE (message_)->callback = value;
928 { 928 {
929 const char *value_ext; 929 const char *value_ext;
930 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding); 930 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
931 tt_message_arg_add (m, n, vtype_ext, value_ext); 931 tt_message_arg_add (m, n, vtype_ext, value_ext);
932 } 932 }
933 else if (INTP (value)) 933 else if (FIXNUMP (value))
934 tt_message_iarg_add (m, n, vtype_ext, XINT (value)); 934 tt_message_iarg_add (m, n, vtype_ext, XFIXNUM (value));
935 } 935 }
936 936
937 return Qnil; 937 return Qnil;
938 } 938 }
939 939
1127 { 1127 {
1128 const char *value_ext; 1128 const char *value_ext;
1129 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding); 1129 value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
1130 tt_pattern_arg_add (p, n, vtype_ext, value_ext); 1130 tt_pattern_arg_add (p, n, vtype_ext, value_ext);
1131 } 1131 }
1132 else if (INTP (value)) 1132 else if (FIXNUMP (value))
1133 tt_pattern_iarg_add (p, n, vtype_ext, XINT (value)); 1133 tt_pattern_iarg_add (p, n, vtype_ext, XFIXNUM (value));
1134 } 1134 }
1135 1135
1136 return Qnil; 1136 return Qnil;
1137 } 1137 }
1138 1138
1252 1252
1253 1253
1254 if (tt_ptr_error (retval) != TT_OK) 1254 if (tt_ptr_error (retval) != TT_OK)
1255 return; 1255 return;
1256 1256
1257 Vtooltalk_fd = make_int (tt_fd ()); 1257 Vtooltalk_fd = make_fixnum (tt_fd ());
1258 1258
1259 tt_session_join (tt_default_session ()); 1259 tt_session_join (tt_default_session ());
1260 1260
1261 lp = connect_to_file_descriptor (build_ascstring ("tooltalk"), Qnil, 1261 lp = connect_to_file_descriptor (build_ascstring ("tooltalk"), Qnil,
1262 Vtooltalk_fd, Vtooltalk_fd); 1262 Vtooltalk_fd, Vtooltalk_fd);
1420 staticpro(&Tooltalk_Message_plist_str); 1420 staticpro(&Tooltalk_Message_plist_str);
1421 staticpro(&Tooltalk_Pattern_plist_str); 1421 staticpro(&Tooltalk_Pattern_plist_str);
1422 1422
1423 #define MAKE_CONSTANT(name) do { \ 1423 #define MAKE_CONSTANT(name) do { \
1424 defsymbol (&Q_ ## name, #name); \ 1424 defsymbol (&Q_ ## name, #name); \
1425 Fset (Q_ ## name, make_int (name)); \ 1425 Fset (Q_ ## name, make_fixnum (name)); \
1426 } while (0) 1426 } while (0)
1427 1427
1428 MAKE_CONSTANT (TT_MODE_UNDEFINED); 1428 MAKE_CONSTANT (TT_MODE_UNDEFINED);
1429 MAKE_CONSTANT (TT_IN); 1429 MAKE_CONSTANT (TT_IN);
1430 MAKE_CONSTANT (TT_OUT); 1430 MAKE_CONSTANT (TT_OUT);