aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/data.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/src/data.c b/src/data.c
index 2aa27e65d77..b23bcbe15b3 100644
--- a/src/data.c
+++ b/src/data.c
@@ -83,12 +83,12 @@ Lisp_Object Qoverflow_error, Qunderflow_error;
83Lisp_Object Qfloatp; 83Lisp_Object Qfloatp;
84Lisp_Object Qnumberp, Qnumber_or_marker_p; 84Lisp_Object Qnumberp, Qnumber_or_marker_p;
85 85
86Lisp_Object Qinteger; 86Lisp_Object Qinteger, Qinterval, Qfloat, Qvector;
87static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay; 87Lisp_Object Qsymbol, Qstring, Qcons, Qmisc;
88Lisp_Object Qwindow; 88Lisp_Object Qwindow;
89static Lisp_Object Qfloat, Qwindow_configuration; 89static Lisp_Object Qoverlay, Qwindow_configuration;
90static Lisp_Object Qprocess; 90static Lisp_Object Qprocess, Qmarker;
91static Lisp_Object Qcompiled_function, Qframe, Qvector; 91static Lisp_Object Qcompiled_function, Qframe;
92Lisp_Object Qbuffer; 92Lisp_Object Qbuffer;
93static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; 93static Lisp_Object Qchar_table, Qbool_vector, Qhash_table;
94static Lisp_Object Qsubrp, Qmany, Qunevalled; 94static Lisp_Object Qsubrp, Qmany, Qunevalled;
@@ -517,7 +517,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
517 return newcdr; 517 return newcdr;
518} 518}
519 519
520/* Extract and set components of symbols */ 520/* Extract and set components of symbols. */
521 521
522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, 522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
523 doc: /* Return t if SYMBOL's value is not void. */) 523 doc: /* Return t if SYMBOL's value is not void. */)
@@ -761,7 +761,7 @@ Value, if non-nil, is a list \(interactive SPEC). */)
761 { 761 {
762 struct gcpro gcpro1; 762 struct gcpro gcpro1;
763 GCPRO1 (cmd); 763 GCPRO1 (cmd);
764 do_autoload (fun, cmd); 764 Fautoload_do_load (fun, cmd, Qnil);
765 UNGCPRO; 765 UNGCPRO;
766 return Finteractive_form (cmd); 766 return Finteractive_form (cmd);
767 } 767 }
@@ -1401,7 +1401,7 @@ for this variable. */)
1401 { 1401 {
1402 struct buffer *b; 1402 struct buffer *b;
1403 1403
1404 for (b = all_buffers; b; b = b->header.next.buffer) 1404 FOR_EACH_BUFFER (b)
1405 if (!PER_BUFFER_VALUE_P (b, idx)) 1405 if (!PER_BUFFER_VALUE_P (b, idx))
1406 PER_BUFFER_VALUE (b, offset) = value; 1406 PER_BUFFER_VALUE (b, offset) = value;
1407 } 1407 }
@@ -1463,8 +1463,7 @@ union Lisp_Val_Fwd
1463static struct Lisp_Buffer_Local_Value * 1463static struct Lisp_Buffer_Local_Value *
1464make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) 1464make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents)
1465{ 1465{
1466 struct Lisp_Buffer_Local_Value *blv 1466 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv);
1467 = xmalloc (sizeof (struct Lisp_Buffer_Local_Value));
1468 Lisp_Object symbol; 1467 Lisp_Object symbol;
1469 Lisp_Object tem; 1468 Lisp_Object tem;
1470 1469
@@ -2060,7 +2059,7 @@ function chain of symbols. */)
2060 return Qnil; 2059 return Qnil;
2061} 2060}
2062 2061
2063/* Extract and set vector and string elements */ 2062/* Extract and set vector and string elements. */
2064 2063
2065DEFUN ("aref", Faref, Saref, 2, 2, 0, 2064DEFUN ("aref", Faref, Saref, 2, 2, 0,
2066 doc: /* Return the element of ARRAY at index IDX. 2065 doc: /* Return the element of ARRAY at index IDX.
@@ -2134,7 +2133,7 @@ bool-vector. IDX starts at 0. */)
2134 { 2133 {
2135 if (idxval < 0 || idxval >= ASIZE (array)) 2134 if (idxval < 0 || idxval >= ASIZE (array))
2136 args_out_of_range (array, idx); 2135 args_out_of_range (array, idx);
2137 XVECTOR (array)->contents[idxval] = newelt; 2136 ASET (array, idxval, newelt);
2138 } 2137 }
2139 else if (BOOL_VECTOR_P (array)) 2138 else if (BOOL_VECTOR_P (array))
2140 { 2139 {
@@ -2449,20 +2448,17 @@ Uses a minus sign if negative.
2449NUMBER may be an integer or a floating point number. */) 2448NUMBER may be an integer or a floating point number. */)
2450 (Lisp_Object number) 2449 (Lisp_Object number)
2451{ 2450{
2452 char buffer[VALBITS]; 2451 char buffer[max (FLOAT_TO_STRING_BUFSIZE, INT_BUFSIZE_BOUND (EMACS_INT))];
2452 int len;
2453 2453
2454 CHECK_NUMBER_OR_FLOAT (number); 2454 CHECK_NUMBER_OR_FLOAT (number);
2455 2455
2456 if (FLOATP (number)) 2456 if (FLOATP (number))
2457 { 2457 len = float_to_string (buffer, XFLOAT_DATA (number));
2458 char pigbuf[FLOAT_TO_STRING_BUFSIZE]; 2458 else
2459 2459 len = sprintf (buffer, "%"pI"d", XINT (number));
2460 float_to_string (pigbuf, XFLOAT_DATA (number));
2461 return build_string (pigbuf);
2462 }
2463 2460
2464 sprintf (buffer, "%"pI"d", XINT (number)); 2461 return make_unibyte_string (buffer, len);
2465 return build_string (buffer);
2466} 2462}
2467 2463
2468DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0, 2464DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
@@ -3015,11 +3011,11 @@ syms_of_data (void)
3015 Fput (Qerror, Qerror_conditions, 3011 Fput (Qerror, Qerror_conditions,
3016 error_tail); 3012 error_tail);
3017 Fput (Qerror, Qerror_message, 3013 Fput (Qerror, Qerror_message,
3018 make_pure_c_string ("error")); 3014 build_pure_c_string ("error"));
3019 3015
3020#define PUT_ERROR(sym, tail, msg) \ 3016#define PUT_ERROR(sym, tail, msg) \
3021 Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ 3017 Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \
3022 Fput (sym, Qerror_message, make_pure_c_string (msg)) 3018 Fput (sym, Qerror_message, build_pure_c_string (msg))
3023 3019
3024 PUT_ERROR (Qquit, Qnil, "Quit"); 3020 PUT_ERROR (Qquit, Qnil, "Quit");
3025 3021
@@ -3046,7 +3042,7 @@ syms_of_data (void)
3046 3042
3047 arith_tail = pure_cons (Qarith_error, error_tail); 3043 arith_tail = pure_cons (Qarith_error, error_tail);
3048 Fput (Qarith_error, Qerror_conditions, arith_tail); 3044 Fput (Qarith_error, Qerror_conditions, arith_tail);
3049 Fput (Qarith_error, Qerror_message, make_pure_c_string ("Arithmetic error")); 3045 Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error"));
3050 3046
3051 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); 3047 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer");
3052 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); 3048 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer");
@@ -3087,7 +3083,6 @@ syms_of_data (void)
3087 DEFSYM (Qwindow_configuration, "window-configuration"); 3083 DEFSYM (Qwindow_configuration, "window-configuration");
3088 DEFSYM (Qprocess, "process"); 3084 DEFSYM (Qprocess, "process");
3089 DEFSYM (Qwindow, "window"); 3085 DEFSYM (Qwindow, "window");
3090 /* DEFSYM (Qsubr, "subr"); */
3091 DEFSYM (Qcompiled_function, "compiled-function"); 3086 DEFSYM (Qcompiled_function, "compiled-function");
3092 DEFSYM (Qbuffer, "buffer"); 3087 DEFSYM (Qbuffer, "buffer");
3093 DEFSYM (Qframe, "frame"); 3088 DEFSYM (Qframe, "frame");
@@ -3095,6 +3090,9 @@ syms_of_data (void)
3095 DEFSYM (Qchar_table, "char-table"); 3090 DEFSYM (Qchar_table, "char-table");
3096 DEFSYM (Qbool_vector, "bool-vector"); 3091 DEFSYM (Qbool_vector, "bool-vector");
3097 DEFSYM (Qhash_table, "hash-table"); 3092 DEFSYM (Qhash_table, "hash-table");
3093 /* Used by Fgarbage_collect. */
3094 DEFSYM (Qinterval, "interval");
3095 DEFSYM (Qmisc, "misc");
3098 3096
3099 DEFSYM (Qdefun, "defun"); 3097 DEFSYM (Qdefun, "defun");
3100 3098
@@ -3213,9 +3211,8 @@ syms_of_data (void)
3213} 3211}
3214 3212
3215#ifndef FORWARD_SIGNAL_TO_MAIN_THREAD 3213#ifndef FORWARD_SIGNAL_TO_MAIN_THREAD
3216static void arith_error (int) NO_RETURN; 3214_Noreturn
3217#endif 3215#endif
3218
3219static void 3216static void
3220arith_error (int signo) 3217arith_error (int signo)
3221{ 3218{