Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103176. ------------------------------------------------------------ revno: 103176 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 22:18:55 -0800 message: Merge: * image.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 06:15:32 +0000 +++ src/ChangeLog 2011-02-07 06:18:23 +0000 @@ -28,6 +28,7 @@ * indent.c (compute_motion): Likewise. * xfont.c (xfont_decode_coding_xlfd): Likewise. * ralloc.c (resize_bloc): Likewise. + * image.c (tiff_load): Likewise. * xml.c (make_dom, parse_region): Likewise. * character.c (strwidth): Make its argument const char *, not const unsigned char *, since more callers prefer it that way. All callers === modified file 'src/image.c' --- src/image.c 2011-02-06 08:51:35 +0000 +++ src/image.c 2011-02-07 06:18:23 +0000 @@ -6778,7 +6778,7 @@ } /* Try to open the image file. */ - tiff = fn_TIFFOpen (SDATA (file), "r"); + tiff = fn_TIFFOpen (SSDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); ------------------------------------------------------------ revno: 103175 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 22:16:13 -0800 message: Merge: * xml.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 05:47:56 +0000 +++ src/ChangeLog 2011-02-07 06:15:32 +0000 @@ -28,6 +28,7 @@ * indent.c (compute_motion): Likewise. * xfont.c (xfont_decode_coding_xlfd): Likewise. * ralloc.c (resize_bloc): Likewise. + * xml.c (make_dom, parse_region): Likewise. * character.c (strwidth): Make its argument const char *, not const unsigned char *, since more callers prefer it that way. All callers changed. === modified file 'src/xml.c' --- src/xml.c 2011-01-30 22:17:44 +0000 +++ src/xml.c 2011-02-07 06:15:32 +0000 @@ -32,7 +32,7 @@ { if (node->type == XML_ELEMENT_NODE) { - Lisp_Object result = Fcons (intern (node->name), Qnil); + Lisp_Object result = Fcons (intern ((char *) node->name), Qnil); xmlNode *child; xmlAttr *property; Lisp_Object plist = Qnil; @@ -44,8 +44,9 @@ if (property->children && property->children->content) { - plist = Fcons (Fcons (intern (property->name), - build_string (property->children->content)), + char *content = (char *) property->children->content; + plist = Fcons (Fcons (intern ((char *) property->name), + build_string (content)), plist); } property = property->next; @@ -65,7 +66,7 @@ else if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE) { if (node->content) - return build_string (node->content); + return build_string ((char *) node->content); else return Qnil; } @@ -102,13 +103,13 @@ bytes = CHAR_TO_BYTE (iend) - CHAR_TO_BYTE (istart); if (htmlp) - doc = htmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), + doc = htmlReadMemory ((char *) BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), bytes, burl, "utf-8", HTML_PARSE_RECOVER|HTML_PARSE_NONET| HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR| HTML_PARSE_NOBLANKS); else - doc = xmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), + doc = xmlReadMemory ((char *) BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), bytes, burl, "utf-8", XML_PARSE_NONET|XML_PARSE_NOWARNING| XML_PARSE_NOERROR); ------------------------------------------------------------ revno: 103174 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 21:48:19 -0800 message: Merge: * ralloc.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 05:44:50 +0000 +++ src/ChangeLog 2011-02-07 05:47:56 +0000 @@ -27,6 +27,7 @@ * doprnt.c (doprnt): Likewise. * indent.c (compute_motion): Likewise. * xfont.c (xfont_decode_coding_xlfd): Likewise. + * ralloc.c (resize_bloc): Likewise. * character.c (strwidth): Make its argument const char *, not const unsigned char *, since more callers prefer it that way. All callers changed. === modified file 'src/ralloc.c' --- src/ralloc.c 2011-01-25 04:08:28 +0000 +++ src/ralloc.c 2011-02-07 05:47:56 +0000 @@ -648,7 +648,7 @@ else { memmove (bloc->new_data, bloc->data, old_size); - memset (bloc->new_data + old_size, 0, size - old_size); + memset ((char *) bloc->new_data + old_size, 0, size - old_size); *bloc->variable = bloc->data = bloc->new_data; } } @@ -1259,4 +1259,3 @@ use_relocatable_buffers = 1; } - ------------------------------------------------------------ revno: 103173 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 21:45:11 -0800 message: Merge: * xfont.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 05:42:15 +0000 +++ src/ChangeLog 2011-02-07 05:44:50 +0000 @@ -26,6 +26,7 @@ * callproc.c (Fcall_process): Likewise. * doprnt.c (doprnt): Likewise. * indent.c (compute_motion): Likewise. + * xfont.c (xfont_decode_coding_xlfd): Likewise. * character.c (strwidth): Make its argument const char *, not const unsigned char *, since more callers prefer it that way. All callers changed. === modified file 'src/xfont.c' --- src/xfont.c 2011-02-05 10:20:15 +0000 +++ src/xfont.c 2011-02-07 05:44:50 +0000 @@ -182,7 +182,7 @@ while (*p0) { c = *(unsigned char *) p0++; - p1 += CHAR_STRING (c, p1); + p1 += CHAR_STRING (c, (unsigned char *) p1); if (--len == 0) break; } ------------------------------------------------------------ revno: 103172 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 21:42:51 -0800 message: Merge: * doprnt.c, indent.c, character.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 05:06:59 +0000 +++ src/ChangeLog 2011-02-07 05:42:15 +0000 @@ -24,6 +24,11 @@ * process.c (read_process_output, send_process, Fprocess_send_region): Likewise. * callproc.c (Fcall_process): Likewise. + * doprnt.c (doprnt): Likewise. + * indent.c (compute_motion): Likewise. + * character.c (strwidth): Make its argument const char *, not const + unsigned char *, since more callers prefer it that way. All callers + changed. 2011-02-06 Paul Eggert === modified file 'src/character.c' --- src/character.c 2011-01-25 04:08:28 +0000 +++ src/character.c 2011-02-07 05:42:15 +0000 @@ -395,9 +395,9 @@ occupies on the screen. */ EMACS_INT -strwidth (const unsigned char *str, EMACS_INT len) +strwidth (const char *str, EMACS_INT len) { - return c_string_width (str, len, -1, NULL, NULL); + return c_string_width ((const unsigned char *) str, len, -1, NULL, NULL); } /* Return width of Lisp string STRING when displayed in the current === modified file 'src/character.h' --- src/character.h 2011-01-18 20:45:37 +0000 +++ src/character.h 2011-02-07 05:42:15 +0000 @@ -612,7 +612,7 @@ extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, EMACS_INT, int); -extern EMACS_INT strwidth (const unsigned char *, EMACS_INT); +extern EMACS_INT strwidth (const char *, EMACS_INT); extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, EMACS_INT *, EMACS_INT *); extern EMACS_INT lisp_string_width (Lisp_Object, int, @@ -630,4 +630,3 @@ do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0) #endif /* EMACS_CHARACTER_H */ - === modified file 'src/doprnt.c' --- src/doprnt.c 2011-01-25 04:08:28 +0000 +++ src/doprnt.c 2011-02-07 05:42:15 +0000 @@ -71,11 +71,11 @@ char *big_buffer = 0; register int tem; - unsigned char *string; + char *string; char fixed_buffer[20]; /* Default buffer for small formatting. */ char *fmtcpy; int minlen; - unsigned char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ + char charbuf[MAX_MULTIBYTE_LENGTH + 1]; /* Used for %c. */ if (format_end == 0) format_end = format + strlen (format); @@ -97,7 +97,7 @@ fmt++; /* Copy this one %-spec into fmtcpy. */ - string = (unsigned char *) fmtcpy; + string = fmtcpy; *string++ = '%'; while (1) { @@ -166,7 +166,7 @@ abort (); sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *)); /* Now copy into final output, truncating as nec. */ - string = (unsigned char *) sprintf_buffer; + string = sprintf_buffer; goto doit; case 'f': @@ -176,7 +176,7 @@ double d = va_arg(ap, double); sprintf (sprintf_buffer, fmtcpy, d); /* Now copy into final output, truncating as nec. */ - string = (unsigned char *) sprintf_buffer; + string = sprintf_buffer; goto doit; } @@ -185,7 +185,7 @@ case 's': if (fmtcpy[1] != 's') minlen = atoi (&fmtcpy[1]); - string = va_arg(ap, unsigned char *); + string = va_arg (ap, char *); tem = strlen (string); width = strwidth (string, tem); goto doit1; @@ -242,7 +242,7 @@ both are passed the same way, otherwise we'll need to rewrite callers. */ EMACS_INT chr = va_arg(ap, EMACS_INT); - tem = CHAR_STRING ((int) chr, charbuf); + tem = CHAR_STRING ((int) chr, (unsigned char *) charbuf); string = charbuf; string[tem] = 0; width = strwidth (string, tem); @@ -277,4 +277,3 @@ *bufptr = 0; /* Make sure our string end with a '\0' */ return bufptr - buffer; } - === modified file 'src/indent.c' --- src/indent.c 2011-01-30 22:17:44 +0000 +++ src/indent.c 2011-02-07 05:42:15 +0000 @@ -1250,7 +1250,7 @@ unsigned char *ovstr; EMACS_INT ovlen = overlay_strings (pos, win, &ovstr); hpos += ((multibyte && ovlen > 0) - ? strwidth (ovstr, ovlen) : ovlen); + ? strwidth ((char *) ovstr, ovlen) : ovlen); } did_motion = 0; ------------------------------------------------------------ revno: 103171 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 21:07:22 -0800 message: Merge: * callproc.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 05:02:02 +0000 +++ src/ChangeLog 2011-02-07 05:06:59 +0000 @@ -23,6 +23,7 @@ * lread.c (read1, hash_string): Likewise. * process.c (read_process_output, send_process, Fprocess_send_region): Likewise. + * callproc.c (Fcall_process): Likewise. 2011-02-06 Paul Eggert === modified file 'src/callproc.c' --- src/callproc.c 2011-01-30 22:17:44 +0000 +++ src/callproc.c 2011-02-07 05:06:59 +0000 @@ -696,8 +696,8 @@ faithfully reflect inserted text until we TEMP_SET_PT_BOTH below. */ specbind (Qinhibit_modification_hooks, Qt); - decode_coding_c_string (&process_coding, buf, nread, - curbuf); + decode_coding_c_string (&process_coding, (unsigned char *) buf, + nread, curbuf); unbind_to (count1, Qnil); if (display_on_the_fly && CODING_REQUIRE_DETECTION (&saved_coding) ------------------------------------------------------------ revno: 103170 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 21:02:40 -0800 message: Merge: * process.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 04:48:38 +0000 +++ src/ChangeLog 2011-02-07 05:02:02 +0000 @@ -21,6 +21,8 @@ (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5): Likewise. * lread.c (read1, hash_string): Likewise. + * process.c (read_process_output, send_process, Fprocess_send_region): + Likewise. 2011-02-06 Paul Eggert === modified file 'src/process.c' --- src/process.c 2011-02-05 10:20:15 +0000 +++ src/process.c 2011-02-07 05:02:02 +0000 @@ -5287,7 +5287,7 @@ save the match data in a special nonrecursive fashion. */ running_asynch_code = 1; - decode_coding_c_string (coding, chars, nbytes, Qt); + decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt); text = coding->dst_object; Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. */ @@ -5391,7 +5391,7 @@ if (! (BEGV <= PT && PT <= ZV)) Fwiden (); - decode_coding_c_string (coding, chars, nbytes, Qt); + decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt); text = coding->dst_object; Vlast_coding_system_used = CODING_ID_NAME (coding->id); /* A new coding system might be found. See the comment in the @@ -5495,7 +5495,7 @@ This function can evaluate Lisp code and can garbage collect. */ static void -send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, +send_process (volatile Lisp_Object proc, const char *volatile buf, volatile EMACS_INT len, volatile Lisp_Object object) { /* Use volatile to protect variables from being clobbered by longjmp. */ @@ -5573,7 +5573,7 @@ set_buffer_internal (XBUFFER (object)); save_pt = PT, save_pt_byte = PT_BYTE; - from_byte = PTR_BYTE_POS (buf); + from_byte = PTR_BYTE_POS ((unsigned char *) buf); from = BYTE_TO_CHAR (from_byte); to = BYTE_TO_CHAR (from_byte + len); TEMP_SET_PT_BOTH (from, from_byte); @@ -5595,7 +5595,7 @@ len = coding->produced; object = coding->dst_object; - buf = SDATA (object); + buf = SSDATA (object); } if (pty_max_bytes == 0) @@ -5629,7 +5629,7 @@ #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CHAN_P (outfd)) { - rv = sendto (outfd, (char *) buf, this, + rv = sendto (outfd, buf, this, 0, datagram_address[outfd].sa, datagram_address[outfd].len); if (rv < 0 && errno == EMSGSIZE) @@ -5646,10 +5646,10 @@ if (XPROCESS (proc)->gnutls_p) rv = emacs_gnutls_write (outfd, XPROCESS (proc), - (char *) buf, this); + buf, this); else #endif - rv = emacs_write (outfd, (char *) buf, this); + rv = emacs_write (outfd, buf, this); #ifdef ADAPTIVE_READ_BUFFERING if (p->read_output_delay > 0 && p->adaptive_read_buffering == 1) @@ -5706,9 +5706,10 @@ /* Running filters might relocate buffers or strings. Arrange to relocate BUF. */ if (BUFFERP (object)) - offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); + offset = BUF_PTR_BYTE_POS (XBUFFER (object), + (unsigned char *) buf); else if (STRINGP (object)) - offset = buf - SDATA (object); + offset = buf - SSDATA (object); #ifdef EMACS_HAS_USECS wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0); @@ -5717,9 +5718,10 @@ #endif if (BUFFERP (object)) - buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); + buf = (char *) BUF_BYTE_ADDRESS (XBUFFER (object), + offset); else if (STRINGP (object)) - buf = offset + SDATA (object); + buf = offset + SSDATA (object); rv = 0; } @@ -5770,7 +5772,7 @@ start1 = CHAR_TO_BYTE (XINT (start)); end1 = CHAR_TO_BYTE (XINT (end)); - send_process (proc, BYTE_POS_ADDR (start1), end1 - start1, + send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1, Fcurrent_buffer ()); return Qnil; @@ -5789,7 +5791,7 @@ Lisp_Object proc; CHECK_STRING (string); proc = get_process (process); - send_process (proc, SDATA (string), + send_process (proc, SSDATA (string), SBYTES (string), string); return Qnil; } ------------------------------------------------------------ revno: 103169 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 20:49:09 -0800 message: Merge: * lread.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 04:43:35 +0000 +++ src/ChangeLog 2011-02-07 04:48:38 +0000 @@ -20,6 +20,7 @@ (string_make_unibyte, Fstring_as_unibyte, Fstring_to_unibyte): (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5): Likewise. + * lread.c (read1, hash_string): Likewise. 2011-02-06 Paul Eggert === modified file 'src/lread.c' --- src/lread.c 2011-01-30 22:17:44 +0000 +++ src/lread.c 2011-02-07 04:48:38 +0000 @@ -2771,7 +2771,8 @@ ; else if (force_singlebyte) { - nchars = str_as_unibyte (read_buffer, p - read_buffer); + nchars = str_as_unibyte ((unsigned char *) read_buffer, + p - read_buffer); p = read_buffer + nchars; } else @@ -2841,7 +2842,7 @@ } if (multibyte) - p += CHAR_STRING (c, p); + p += CHAR_STRING (c, (unsigned char *) p); else *p++ = c; c = READCHAR; @@ -2950,7 +2951,9 @@ Lisp_Object name, result; EMACS_INT nbytes = p - read_buffer; EMACS_INT nchars - = (multibyte ? multibyte_chars_in_text (read_buffer, nbytes) + = (multibyte + ? multibyte_chars_in_text ((unsigned char *) read_buffer, + nbytes) : nbytes); if (uninterned_symbol && ! NILP (Vpurify_flag)) @@ -3442,7 +3445,7 @@ int oblookup_last_bucket_number; -static int hash_string (const unsigned char *ptr, int len); +static int hash_string (const char *ptr, int len); /* Get an error if OBARRAY is not an obarray. If it is one, return it. */ @@ -3700,10 +3703,10 @@ } static int -hash_string (const unsigned char *ptr, int len) +hash_string (const char *ptr, int len) { - register const unsigned char *p = ptr; - register const unsigned char *end = p + len; + register const char *p = ptr; + register const char *end = p + len; register unsigned char c; register int hash = 0; ------------------------------------------------------------ revno: 103168 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 20:44:05 -0800 message: Merge: * fns.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 03:09:32 +0000 +++ src/ChangeLog 2011-02-07 04:43:35 +0000 @@ -16,6 +16,10 @@ (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal): (Fformat): Likewise. * callint.c (Fcall_interactively): Likewise. + * fns.c (string_make_multibyte, string_to_multibyte): + (string_make_unibyte, Fstring_as_unibyte, Fstring_to_unibyte): + (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5): + Likewise. 2011-02-06 Paul Eggert === modified file 'src/fns.c' --- src/fns.c 2011-01-30 22:17:44 +0000 +++ src/fns.c 2011-02-07 04:43:35 +0000 @@ -882,7 +882,7 @@ copy_text (SDATA (string), buf, SBYTES (string), 0, 1); - ret = make_multibyte_string (buf, SCHARS (string), nbytes); + ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes); SAFE_FREE (); return ret; @@ -914,7 +914,7 @@ memcpy (buf, SDATA (string), SBYTES (string)); str_to_multibyte (buf, nbytes, SBYTES (string)); - ret = make_multibyte_string (buf, SCHARS (string), nbytes); + ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes); SAFE_FREE (); return ret; @@ -940,7 +940,7 @@ copy_text (SDATA (string), buf, SBYTES (string), 1, 0); - ret = make_unibyte_string (buf, nchars); + ret = make_unibyte_string ((char *) buf, nchars); SAFE_FREE (); return ret; @@ -996,7 +996,7 @@ memcpy (str, SDATA (string), bytes); bytes = str_as_unibyte (str, bytes); - string = make_unibyte_string (str, bytes); + string = make_unibyte_string ((char *) str, bytes); xfree (str); } return string; @@ -1079,7 +1079,7 @@ if (converted < chars) error ("Can't convert the %dth character to unibyte", converted); - string = make_unibyte_string (str, chars); + string = make_unibyte_string ((char *) str, chars); xfree (str); } return string; @@ -2982,8 +2982,8 @@ allength += allength / MIME_LINE_LENGTH + 1 + 6; SAFE_ALLOCA (encoded, char *, allength); - encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length, - NILP (no_line_break), + encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), + encoded, length, NILP (no_line_break), !NILP (current_buffer->enable_multibyte_characters)); if (encoded_length > allength) abort (); @@ -3072,7 +3072,7 @@ { if (multibyte) { - c = STRING_CHAR_AND_LENGTH (from + i, bytes); + c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); if (CHAR_BYTE8_P (c)) c = CHAR_TO_BYTE8 (c); else if (c >= 256) @@ -3112,7 +3112,7 @@ if (multibyte) { - c = STRING_CHAR_AND_LENGTH (from + i, bytes); + c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); if (CHAR_BYTE8_P (c)) c = CHAR_TO_BYTE8 (c); else if (c >= 256) @@ -3136,7 +3136,7 @@ if (multibyte) { - c = STRING_CHAR_AND_LENGTH (from + i, bytes); + c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); if (CHAR_BYTE8_P (c)) c = CHAR_TO_BYTE8 (c); else if (c >= 256) @@ -3183,7 +3183,8 @@ SAFE_ALLOCA (decoded, char *, allength); move_gap_both (XFASTINT (beg), ibeg); - decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length, + decoded_length = base64_decode_1 ((char *) BYTE_POS_ADDR (ibeg), + decoded, length, multibyte, &inserted_chars); if (decoded_length > allength) abort (); @@ -4566,7 +4567,7 @@ (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) { unsigned char digest[16]; - unsigned char value[33]; + char value[33]; int i; EMACS_INT size; EMACS_INT size_byte = 0; ------------------------------------------------------------ revno: 103167 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 19:11:47 -0800 message: Merge: * callint.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 02:51:10 +0000 +++ src/ChangeLog 2011-02-07 03:09:32 +0000 @@ -15,6 +15,7 @@ * editfns.c (init_editfns, Fchar_to_string, Fbyte_to_string): (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal): (Fformat): Likewise. + * callint.c (Fcall_interactively): Likewise. 2011-02-06 Paul Eggert === modified file 'src/callint.c' --- src/callint.c 2011-01-25 04:08:28 +0000 +++ src/callint.c 2011-02-07 03:09:32 +0000 @@ -257,8 +257,8 @@ int next_event; Lisp_Object prefix_arg; - unsigned char *string; - unsigned char *tem; + char *string; + char *tem; /* If varies[i] > 0, the i'th argument shouldn't just have its value in this call quoted in the command history. It should be @@ -325,8 +325,8 @@ { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (unsigned char *) alloca (SBYTES (specs) + 1); - memcpy (string, SDATA (specs), SBYTES (specs) + 1); + string = (char *) alloca (SBYTES (specs) + 1); + memcpy (string, SSDATA (specs), SBYTES (specs) + 1); } else { @@ -389,7 +389,7 @@ { if (!NILP (record_flag)) { - unsigned char *p = string; + char *p = string; while (*p) { if (! (*p == 'r' || *p == 'p' || *p == 'P' @@ -449,7 +449,7 @@ j += 2; else j++; - tem = (unsigned char *) strchr (tem, '\n'); + tem = strchr (tem, '\n'); if (tem) ++tem; else @@ -780,7 +780,7 @@ case '+': default: error ("Invalid control letter `%c' (%03o) in interactive calling string", - *tem, *tem); + *tem, (unsigned char) *tem); } if (varies[i] == 0) @@ -789,9 +789,9 @@ if (NILP (visargs[i]) && STRINGP (args[i])) visargs[i] = args[i]; - tem = (unsigned char *) strchr (tem, '\n'); + tem = strchr (tem, '\n'); if (tem) tem++; - else tem = (unsigned char *) ""; + else tem = ""; } unbind_to (speccount, Qnil); ------------------------------------------------------------ revno: 103166 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 18:51:50 -0800 message: Merge: * editfns.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 02:26:14 +0000 +++ src/ChangeLog 2011-02-07 02:51:10 +0000 @@ -12,6 +12,9 @@ * data.c (Fstring_to_number): Likewise. * print.c (float_to_string, PRINTFINISH, printchar, strout): (print_object): Likewise. + * editfns.c (init_editfns, Fchar_to_string, Fbyte_to_string): + (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal): + (Fformat): Likewise. 2011-02-06 Paul Eggert === modified file 'src/editfns.c' --- src/editfns.c 2011-02-06 19:44:36 +0000 +++ src/editfns.c 2011-02-07 02:51:10 +0000 @@ -120,7 +120,7 @@ init_editfns (void) { char *user_name; - register unsigned char *p; + register char *p; struct passwd *pw; /* password entry for the current user */ Lisp_Object tem; @@ -165,7 +165,7 @@ Vuser_full_name = Fuser_full_name (NILP (tem)? make_number (geteuid()) : Vuser_login_name); - p = (unsigned char *) getenv ("NAME"); + p = getenv ("NAME"); if (p) Vuser_full_name = build_string (p); else if (NILP (Vuser_full_name)) @@ -193,7 +193,7 @@ CHECK_CHARACTER (character); len = CHAR_STRING (XFASTINT (character), str); - return make_string_from_bytes (str, 1, len); + return make_string_from_bytes ((char *) str, 1, len); } DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, @@ -205,7 +205,7 @@ if (XINT (byte) < 0 || XINT (byte) > 255) error ("Invalid byte"); b = XINT (byte); - return make_string_from_bytes (&b, 1, 1); + return make_string_from_bytes ((char *) &b, 1, 1); } DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0, @@ -1329,7 +1329,7 @@ (Lisp_Object uid) { struct passwd *pw; - register unsigned char *p, *q; + register char *p, *q; Lisp_Object full; if (NILP (uid)) @@ -1352,26 +1352,26 @@ if (!pw) return Qnil; - p = (unsigned char *) USER_FULL_NAME; + p = USER_FULL_NAME; /* Chop off everything after the first comma. */ - q = (unsigned char *) strchr (p, ','); + q = strchr (p, ','); full = make_string (p, q ? q - p : strlen (p)); #ifdef AMPERSAND_FULL_NAME - p = SDATA (full); - q = (unsigned char *) strchr (p, '&'); + p = SSDATA (full); + q = strchr (p, '&'); /* Substitute the login name for the &, upcasing the first character. */ if (q) { - register unsigned char *r; + register char *r; Lisp_Object login; login = Fuser_login_name (make_number (pw->pw_uid)); - r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1); + r = (char *) alloca (strlen (p) + SCHARS (login) + 1); memcpy (r, p, q - p); r[q - p] = 0; strcat (r, SSDATA (login)); - r[q - p] = UPCASE (r[q - p]); + r[q - p] = UPCASE ((unsigned char) r[q - p]); strcat (r, q + 1); full = build_string (r); } @@ -2828,7 +2828,7 @@ GCPRO1 (tem); /* Make a multibyte string containing this single character. */ - string = make_multibyte_string (tostr, 1, len); + string = make_multibyte_string ((char *) tostr, 1, len); /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, @@ -3042,7 +3042,7 @@ /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ - string = make_multibyte_string (str, 1, str_len); + string = make_multibyte_string ((char *) str, 1, str_len); replace_range (pos, pos + 1, string, 1, 0, 1); len = str_len; } @@ -3511,7 +3511,7 @@ register int n; /* The number of the next arg to substitute */ register EMACS_INT total; /* An estimate of the final length */ char *buf, *p; - register unsigned char *format, *end, *format_start; + register char *format, *end, *format_start; int nchars; /* Nonzero if the output should be a multibyte string, which is true if any of the inputs is one. */ @@ -3521,7 +3521,7 @@ multibyte character of the previous string. This flag tells if we must consider such a situation or not. */ int maybe_combine_byte; - unsigned char *this_format; + char *this_format; /* Precision for each spec, or -1, a flag value meaning no precision was given in that spec. Element 0, corresonding to the format string itself, will not be used. Element NARGS, corresponding to @@ -3575,7 +3575,7 @@ That can only happen from the first large while loop below. */ retry: - format = SDATA (args[0]); + format = SSDATA (args[0]); format_start = format; end = format + SBYTES (args[0]); longest_format = 0; @@ -3605,7 +3605,7 @@ { EMACS_INT thissize = 0; EMACS_INT actual_width = 0; - unsigned char *this_format_start = format - 1; + char *this_format_start = format - 1; int field_width = 0; /* General format specifications look like @@ -3785,7 +3785,7 @@ /* Now we can no longer jump to retry. TOTAL and LONGEST_FORMAT are known for certain. */ - this_format = (unsigned char *) alloca (longest_format + 1); + this_format = (char *) alloca (longest_format + 1); /* Allocate the space for the result. Note that TOTAL is an overestimate. */ @@ -3796,7 +3796,7 @@ n = 0; /* Scan the format and store result in BUF. */ - format = SDATA (args[0]); + format = SSDATA (args[0]); format_start = format; end = format + SBYTES (args[0]); maybe_combine_byte = 0; @@ -3806,7 +3806,7 @@ { int minlen; int negative = 0; - unsigned char *this_format_start = format; + char *this_format_start = format; discarded[format - format_start] = 1; format++; @@ -3887,7 +3887,7 @@ && !CHAR_HEAD_P (SREF (args[n], 0))) maybe_combine_byte = 1; - p += copy_text (SDATA (args[n]), p, + p += copy_text (SDATA (args[n]), (unsigned char *) p, nbytes, STRING_MULTIBYTE (args[n]), multibyte); @@ -3955,7 +3955,8 @@ maybe_combine_byte = 1; this_nchars = strlen (p); if (multibyte) - p += str_to_multibyte (p, buf + total - 1 - p, this_nchars); + p += str_to_multibyte ((unsigned char *) p, + buf + total - 1 - p, this_nchars); else p += this_nchars; nchars += this_nchars; @@ -3982,7 +3983,8 @@ else if (multibyte) { /* Convert a single-byte character to multibyte. */ - int len = copy_text (format, p, 1, 0, 1); + int len = copy_text ((unsigned char *) format, (unsigned char *) p, + 1, 0, 1); p += len; format++; @@ -3996,7 +3998,7 @@ abort (); if (maybe_combine_byte) - nchars = multibyte_chars_in_text (buf, p - buf); + nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf); val = make_specified_string (buf, nchars, p - buf, multibyte); /* If we allocated BUF with malloc, free it too. */ ------------------------------------------------------------ revno: 103165 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 18:27:27 -0800 message: Merge: * print.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 02:18:35 +0000 +++ src/ChangeLog 2011-02-07 02:26:14 +0000 @@ -10,7 +10,8 @@ * alloc.c (make_string, make_specified_string, make_pure_string): Likewise. * data.c (Fstring_to_number): Likewise. - * print.c (float_to_string): Likewise. + * print.c (float_to_string, PRINTFINISH, printchar, strout): + (print_object): Likewise. 2011-02-06 Paul Eggert === modified file 'src/print.c' --- src/print.c 2011-02-07 02:18:35 +0000 +++ src/print.c 2011-02-07 02:26:14 +0000 @@ -177,8 +177,8 @@ { \ unsigned char *temp \ = (unsigned char *) alloca (print_buffer_pos + 1); \ - copy_text (print_buffer, temp, print_buffer_pos_byte, \ - 1, 0); \ + copy_text ((unsigned char *) print_buffer, temp, \ + print_buffer_pos_byte, 1, 0); \ insert_1_both ((char *) temp, print_buffer_pos, \ print_buffer_pos, 0, 1, 0); \ } \ @@ -254,7 +254,7 @@ setup_echo_area_for_printing (multibyte_p); insert_char (ch); - message_dolog (str, len, 0, multibyte_p); + message_dolog ((char *) str, len, 0, multibyte_p); } } } @@ -317,7 +317,8 @@ int len; for (i = 0; i < size_byte; i += len) { - int ch = STRING_CHAR_AND_LENGTH (ptr + i, len); + int ch = STRING_CHAR_AND_LENGTH ((const unsigned char *) ptr + i, + len); insert_char (ch); } } @@ -343,7 +344,8 @@ corresponding character code before handing it to PRINTCHAR. */ int len; - int ch = STRING_CHAR_AND_LENGTH (ptr + i, len); + int ch = STRING_CHAR_AND_LENGTH ((const unsigned char *) ptr + i, + len); PRINTCHAR (ch); i += len; } @@ -1519,7 +1521,7 @@ For a char code that could be in a unibyte string, when found in a multibyte string, always use a hex escape so it reads back as multibyte. */ - unsigned char outbuf[50]; + char outbuf[50]; if (CHAR_BYTE8_P (c)) sprintf (outbuf, "\\%03o", CHAR_TO_BYTE8 (c)); @@ -1538,7 +1540,7 @@ or when explicitly requested, print single-byte non-ASCII string chars using octal escapes. */ - unsigned char outbuf[5]; + char outbuf[5]; sprintf (outbuf, "\\%03o", c); strout (outbuf, -1, -1, printcharfun, 0); } ------------------------------------------------------------ revno: 103164 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 18:19:13 -0800 message: Merge: * data.c etc: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 02:05:30 +0000 +++ src/ChangeLog 2011-02-07 02:18:35 +0000 @@ -9,6 +9,8 @@ * search.c (Freplace_match, Fregexp_quote): Likewise. * alloc.c (make_string, make_specified_string, make_pure_string): Likewise. + * data.c (Fstring_to_number): Likewise. + * print.c (float_to_string): Likewise. 2011-02-06 Paul Eggert === modified file 'src/data.c' --- src/data.c 2011-01-25 04:08:28 +0000 +++ src/data.c 2011-02-07 02:18:35 +0000 @@ -2417,7 +2417,7 @@ If the base used is not 10, STRING is always parsed as integer. */) (register Lisp_Object string, Lisp_Object base) { - register unsigned char *p; + register char *p; register int b; int sign = 1; Lisp_Object val; @@ -2436,7 +2436,7 @@ /* Skip any whitespace at the front of the number. Some versions of atoi do this anyway, so we might as well make Emacs lisp consistent. */ - p = SDATA (string); + p = SSDATA (string); while (*p == ' ' || *p == '\t') p++; @@ -3334,4 +3334,3 @@ signal (SIGEMT, arith_error); #endif /* uts */ } - === modified file 'src/lisp.h' --- src/lisp.h 2011-02-06 19:44:36 +0000 +++ src/lisp.h 2011-02-07 02:18:35 +0000 @@ -2787,7 +2787,7 @@ extern Lisp_Object internal_with_output_to_temp_buffer (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); #define FLOAT_TO_STRING_BUFSIZE 350 -extern void float_to_string (unsigned char *, double); +extern void float_to_string (char *, double); extern void syms_of_print (void); /* Defined in doprnt.c */ === modified file 'src/print.c' --- src/print.c 2011-02-06 19:44:36 +0000 +++ src/print.c 2011-02-07 02:18:35 +0000 @@ -1016,9 +1016,9 @@ */ void -float_to_string (unsigned char *buf, double data) +float_to_string (char *buf, double data) { - unsigned char *cp; + char *cp; int width; /* Check for plus infinity in a way that won't lose @@ -1067,7 +1067,7 @@ /* Check that the spec we have is fully valid. This means not only valid for printf, but meant for floats, and reasonable. */ - cp = SDATA (Vfloat_output_format); + cp = SSDATA (Vfloat_output_format); if (cp[0] != '%') goto lose; ------------------------------------------------------------ revno: 103163 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 18:06:16 -0800 message: Merge: * alloc.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 01:31:29 +0000 +++ src/ChangeLog 2011-02-07 02:05:30 +0000 @@ -7,6 +7,8 @@ rules about pointer type compatibility. * casefiddle.c (casify_object, casify_region): Likewise. * search.c (Freplace_match, Fregexp_quote): Likewise. + * alloc.c (make_string, make_specified_string, make_pure_string): + Likewise. 2011-02-06 Paul Eggert === modified file 'src/alloc.c' --- src/alloc.c 2011-01-30 22:17:44 +0000 +++ src/alloc.c 2011-02-07 02:05:30 +0000 @@ -2281,7 +2281,8 @@ register Lisp_Object val; EMACS_INT nchars, multibyte_nbytes; - parse_str_as_multibyte (contents, nbytes, &nchars, &multibyte_nbytes); + parse_str_as_multibyte ((const unsigned char *) contents, nbytes, + &nchars, &multibyte_nbytes); if (nbytes == nchars || nbytes != multibyte_nbytes) /* CONTENTS contains no multibyte sequences or contains an invalid multibyte sequence. We must make unibyte string. */ @@ -2349,7 +2350,8 @@ if (nchars < 0) { if (multibyte) - nchars = multibyte_chars_in_text (contents, nbytes); + nchars = multibyte_chars_in_text ((const unsigned char *) contents, + nbytes); else nchars = nbytes; } @@ -4650,7 +4652,7 @@ struct Lisp_String *s; s = (struct Lisp_String *) pure_alloc (sizeof *s, Lisp_String); - s->data = find_string_data_in_pure (data, nbytes); + s->data = (unsigned char *) find_string_data_in_pure (data, nbytes); if (s->data == NULL) { s->data = (unsigned char *) pure_alloc (nbytes + 1, -1); ------------------------------------------------------------ revno: 103162 committer: Jay Belanger branch nick: trunk timestamp: Sun 2011-02-06 19:40:47 -0600 message: Eliminate newline diff: === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2011-02-07 01:35:09 +0000 +++ doc/misc/calc.texi 2011-02-07 01:40:47 +0000 @@ -28140,8 +28140,7 @@ @texline @math{20 \mu{\rm Pa}} (the threshhold of human hearing) is @infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB}, -@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = -20 \log_{10}(3) {\rm dB}}, +@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}}, which is about @infoline @math{9.54 dB}. @texline @math{9.54 {\rm dB}}. ------------------------------------------------------------ revno: 103161 committer: Jay Belanger branch nick: trunk timestamp: Sun 2011-02-06 19:35:09 -0600 message: calc.texi (Logarithmic Units): New section diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-02-06 00:25:41 +0000 +++ doc/misc/ChangeLog 2011-02-07 01:35:09 +0000 @@ -1,3 +1,7 @@ +2011-02-07 Jay Belanger + + * calc.texi (Logarithmic Units): New section. + 2011-02-05 Teodor Zlatanov * gnus-overrides.texi: Renamed from overrides.texi and all the relevant === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2011-01-25 04:08:28 +0000 +++ doc/misc/calc.texi 2011-02-07 01:35:09 +0000 @@ -27675,6 +27675,7 @@ * The Units Table:: * Predefined Units:: * User-Defined Units:: +* Logarithmic Units:: @end menu @node Basic Operations on Units, The Units Table, Units, Units @@ -28036,7 +28037,7 @@ @c Describe angular units, luminosity vs. steradians problem. -@node User-Defined Units, , Predefined Units, Units +@node User-Defined Units, Logarithmic Units, Predefined Units, Units @section User-Defined Units @noindent @@ -28120,6 +28121,249 @@ is replaced by the new set. (@xref{General Mode Commands}, for a way to tell Calc to use a different file for the Calc init file.) +@node Logarithmic Units, , User-Defined Units, Units +@section Logarithmic Units + +The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic +units which are typically manipulated differently than standard units. +Calc provides commands to work with these logarithmic units. + +Decibels and nepers are used to measure power quantities as well as +field quantities (quantities whose squares are proportional to power). +The decibel and neper values of a quantity are relative to +a reference quantity; for example, the decibel value of a sound +pressure level of +@infoline @math{60 uPa} +@texline @math{60 \mu{\rm Pa}} +relative to +@infoline @math{20 uPa} +@texline @math{20 \mu{\rm Pa}} +(the threshhold of human hearing) is +@infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB}, +@texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = +20 \log_{10}(3) {\rm dB}}, +which is about +@infoline @math{9.54 dB}. +@texline @math{9.54 {\rm dB}}. +Note that in taking the ratio, the original units cancel and so these +logarithmic units are dimensionless. + +@vindex calc-logunits-power-reference +@vindex calc-logunits-field-reference +The Calc commands for the logarithmic units assume that power quantities +are being used unless the @kbd{H} prefix is used, in which case they assume that +field quantities are being used. For power quantities, Calc uses +@infoline @math{1 mW} +@texline @math{1 {\rm mW}} +as the default reference quantity; this default can be changed by changing +the value of the customizable variable +@code{calc-logunits-power-reference} (@pxref{Customizing Calc}). +For field quantities, Calc uses +@infoline @math{20 uPa} +@texline @math{20 \mu{\rm Pa}} +as the default reference quantity; this is the value used in acoustics +which is where decibels are commonly encountered. This default can be +changed by changing the value of the customizable variable +@code{calc-logunits-field-reference} (@pxref{Customizing Calc}). A +non-default reference quantity will be read from the stack if the +capital @kbd{O} prefix is used. + +The decibel level of a power +@infoline @math{P1}, +@texline @math{P_1}, +relative to a reference power +@infoline @math{P0}, +@texline @math{P_0}, +is defined to be +@infoline @math{10 log10(P1/P0) dB}. +@texline @math{10 \log_{10}(P_{1}/P_{0}) {\rm dB}}. +(The factor of 10 is because a decibel, as its name implies, is +one-tenth of a bel. The bel, named after Alexander Graham Bell, was +considered to be too large of a unit and was effectively replaced by +the decibel.) If @math{F} is a field quantity with power +@math{P=k F^2}, then a reference quantity of +@infoline @math{F0} +@texline @math{F_0} +would correspond to a power of +@infoline @math{P0=k F0^2}. +@texline @math{P_{0}=kF_{0}^2}. +If +@infoline @math{P1=k F1^2}, +@texline @math{P_{1}=kF_{1}^2}, +then + +@ifnottex +@example +10 log10(P1/P0) = 10 log10(F1^2/F0^2) = 20 log10(F1/F0). +@end example +@end ifnottex +@tex +$$ 10 \log_{10}(P_1/P_0) = 10 \log_{10}(F_1^2/F_0^2) = 20 +\log_{10}(F_1/F_0)$$ +@end tex + +@noindent +In order to get the same decibel level regardless of whether a field +quantity or the corresponding power quantity is used, the decibel +level of a field quantity +@infoline @math{F1}, +@texline @math{F_1}, +relative to a reference +@infoline @math{F0}, +@texline @math{F_0}, +is defined as +@infoline @math{20 log10(F1/F0) dB}. +@texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}. + +Nepers (named after John Napier, who is credited with inventing the +logarithm) are similar to bels except they use natural logarithms instead +of common logarithms. The neper level of a power +@infoline @math{P1}, +@texline @math{P_1}, +relative to a reference power +@infoline @math{P0}, +@texline @math{P_0}, +is +@infoline @math{(1/2) ln(P1/P0) Np}. +@texline @math{(1/2) \ln(P_1/P_0) {\rm Np}}. +The neper level of a field +@infoline @math{F1}, +@texline @math{F_1}, +relative to a reference field +@infoline @math{F0}, +@texline @math{F_0}, +is +@infoline @math{ln(F1/F0) Np}. +@texline @math{\ln(F_1/F_0) {\rm Np}}. + +@kindex l q +@pindex calc-logunits-quantity +@tindex powerquant +@tindex fieldquant +The @kbd{l q} (@code{calc-logunits-quantity}) [@code{powerquant}] +command computes the power quantity corresponding to a given number of +logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the +reference level will be read from the top of the stack. (In an +algebraic formula, @code{powerquant} can be given an optional second +argument which will be used for the reference level.) For example, +@code{20 dB @key{RET} l q} will return @code{100 mW}; +@code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}. +The @kbd{H l q} [@code{fieldquant}] command behaves like @kbd{l q} but +computes field quantities instead of power quantities. + +@kindex l d +@pindex calc-logunits-dblevel +@tindex dbpowerlevel +@tindex dbfieldlevel +@kindex l n +@pindex calc-logunits-nplevel +@tindex nppowerlevel +@tindex npfieldlevel +The @kbd{l d} (@code{calc-logunits-dblevel}) [@code{dbpowerlevel}] +command will compute the decibel level of a power quantity using the +default reference level; @kbd{H l d} [@code{dbfieldlevel}] will +compute the decibel level of a field quantity. The commands @kbd{l n} +(@code{calc-logunits-nplevel}) [@code{nppowerlevel}] and @kbd{H l n} +[@code{npfieldlevel}] will similarly compute neper levels. With the +capital @kbd{O} prefix these commands will read a reference level +from the stack; in an algebraic formula the reference level can be +given as an optional second argument. + +@kindex l + +@pindex calc-logunits-add +@tindex lupoweradd +@tindex lufieldadd +@kindex l - +@pindex calc-logunits-sub +@tindex lupowersub +@tindex lufieldsub +@kindex l * +@pindex calc-logunits-mul +@tindex lupowermul +@tindex lufieldmul +@kindex l / +@pindex calc-logunits-div +@tindex lupowerdiv +@tindex lufielddiv +The sum of two power or field quantities doesn't correspond to the sum +of the corresponding decibel or neper levels. If the powers +corresponding to decibel levels +@infoline @math{D1} +@texline @math{D_1} +and +@infoline @math{D2} +@texline @math{D_2} +are added, the corresponding decibel level ``sum'' will be + +@ifnottex +@example + 10 log10(10^(D1/10) + 10^(D2/10)) dB. +@end example +@end ifnottex +@tex +$$ 10 \log_{10}(10^{D_1/10} + 10^{D_2/10}) {\rm dB}.$$ +@end tex + +@noindent +When field quantities are combined, it often means the +corresponding powers are added and so the above formula might be used. +In acoustics, for example, the decibel sound pressure level is defined +using the field formula but the sound pressure levels are combined +as the sound power levels, and so the above formula should be used. If +two field quantities themselves are added, the new decibel level will be + + +@ifnottex +@example + 20 log10(10^(D1/20) + 10^(D2/20)) dB. +@end example +@end ifnottex +@tex +$$ 20 \log_{10}(10^{D_1/20} + 10^{D_2/20}) {\rm dB}.$$ +@end tex + +@noindent +If the power corresponding to @math{D} dB is multiplied by a number @math{N}, +then the corresponding decibel level will be + +@ifnottex +@example + D + 10 log10(N) dB, +@end example +@end ifnottex +@tex +$$ D + 10 \log_{10}(N) {\rm dB},$$ +@end tex + +@noindent +if a field quantity is multiplied by @math{N} the corresponding decibel level +will be + +@ifnottex +@example + D + 20 log10(N) dB. +@end example +@end ifnottex +@tex +$$ D + 20 \log_{10}(N) {\rm dB}.$$ +@end tex + +@noindent +There are similar formulas for combining nepers. +The @kbd{l +} (@code{calc-logunits-add}) [@code{lupoweradd}] command +will ``add'' two logarithmic unit power levels this way; with the +@kbd{H} prefix, @kbd{H l +} [@code{lufieldadd}] will add logarithmic +unit field levels. Similarly, logarithmic units can be +``subtracted'' with @kbd{l -} (@code{calc-logunits-sub}) +[@code{lupowersub}] or @kbd{H l -} [@code{lufieldsub}]. +The @kbd{l *} (@code{calc-logunits-mul}) [@code{lupowermul}] +and @kbd{H l *} [@code{lufieldmul}] commands will ``multiply'' +a logarithmic unit by a number; the @kbd{l /} +(@code{calc-logunits-divide}) [@code{lupowerdiv}] and +@kbd{H l /} [@code{lufielddiv}] commands will ``divide'' a +logarithmic unit by a number. Note that the reference quantities don't +play a role in this arithmetic. + @node Store and Recall, Graphics, Units, Top @chapter Storing and Recalling @@ -35225,6 +35469,19 @@ and @code{calc-embedded-open-close-plain-alist}. @end defvar +@defvar calc-logunits-power-reference +@defvarx calc-logunits-field-reference +See @ref{Logarithmic Units}.@* +The variables @code{calc-logunits-power-reference} and +@code{calc-logunits-field-reference} are unit expressions (written as +strings) which Calc will use as reference quantities for logarithmic +units. + +The default value of @code{calc-logunits-power-reference} is @code{"mW"} +and the default value of @code{calc-logunits-field-reference} is +@code{"20 uPa"}. +@end defvar + @defvar calc-highlight-selections-with-faces @defvarx calc-selected-face @defvarx calc-nonselected-face @@ -35873,6 +36130,28 @@ @r{ v x@: I k T @: @: @:ltpt@:(x,v)} @c +@r{ a b@: l + @: @: 2 @:lupoweradd@:(a,b)} +@r{ a b@: H l + @: @: 2 @:lufieldadd@:(a,b)} +@r{ a b@: l - @: @: 2 @:lupowersub@:(a,b)} +@r{ a b@: H l - @: @: 2 @:lufieldsub@:(a,b)} +@r{ a b@: l * @: @: 2 @:lupowermul@:(a,b)} +@r{ a b@: H l * @: @: 2 @:lufieldmul@:(a,b)} +@r{ a b@: l / @: @: 2 @:lupowerdiv@:(a,b)} +@r{ a b@: H l / @: @: 2 @:lufielddiv@:(a,b)} +@r{ a@: l d @: @: 1 @:dbpowerlevel@:(a)} +@r{ a b@: O l d @: @: 2 @:dbpowerlevel@:(a,b)} +@r{ a@: H l d @: @: 1 @:dbfieldlevel@:(a)} +@r{ a b@: O H l d @: @: 2 @:dbfieldlevel@:(a,b)} +@r{ a@: l n @: @: 1 @:nppowerlevel@:(a)} +@r{ a b@: O l n @: @: 2 @:nppowerlevel@:(a,b)} +@r{ a@: H l n @: @: 1 @:npfieldlevel@:(a)} +@r{ a b@: O H l n @: @: 2 @:npfieldlevel@:(a,b)} +@r{ a@: l q @: @: 1 @:powerquant@:(a)} +@r{ a b@: O l q @: @: 2 @:powerquant@:(a,b)} +@r{ a@: H l q @: @: 1 @:fieldquant@:(a)} +@r{ a b@: O H l q @: @: 2 @:fieldquant@:(a,b)} + +@c @r{ @: m a @: @: 12,13 @:calc-algebraic-mode@:} @r{ @: m d @: @: @:calc-degrees-mode@:} @r{ @: m e @: @: @:calc-embedded-preserve-modes@:} ------------------------------------------------------------ revno: 103160 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 17:32:09 -0800 message: Merge: * search.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 01:24:53 +0000 +++ src/ChangeLog 2011-02-07 01:31:29 +0000 @@ -6,6 +6,7 @@ Change types between char * and unsigned char *, to satisfy C89 rules about pointer type compatibility. * casefiddle.c (casify_object, casify_region): Likewise. + * search.c (Freplace_match, Fregexp_quote): Likewise. 2011-02-06 Paul Eggert === modified file 'src/search.c' --- src/search.c 2011-01-30 22:17:44 +0000 +++ src/search.c 2011-02-07 01:31:29 +0000 @@ -2705,7 +2705,7 @@ idx = c - '0'; } else if (c == '\\') - add_len = 1, add_stuff = "\\"; + add_len = 1, add_stuff = (unsigned char *) "\\"; else { xfree (substed); @@ -2755,10 +2755,11 @@ EMACS_INT nchars = multibyte_chars_in_text (substed, substed_len); - newtext = make_multibyte_string (substed, nchars, substed_len); + newtext = make_multibyte_string ((char *) substed, nchars, + substed_len); } else - newtext = make_unibyte_string (substed, substed_len); + newtext = make_unibyte_string ((char *) substed, substed_len); } xfree (substed); } @@ -3145,17 +3146,17 @@ doc: /* Return a regexp string which matches exactly STRING and nothing else. */) (Lisp_Object string) { - register unsigned char *in, *out, *end; - register unsigned char *temp; + register char *in, *out, *end; + register char *temp; int backslashes_added = 0; CHECK_STRING (string); - temp = (unsigned char *) alloca (SBYTES (string) * 2); + temp = (char *) alloca (SBYTES (string) * 2); /* Now copy the data into the new string, inserting escapes. */ - in = SDATA (string); + in = SSDATA (string); end = in + SBYTES (string); out = temp; ------------------------------------------------------------ revno: 103159 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 17:25:30 -0800 message: Merge: * casefiddle.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-07 01:18:31 +0000 +++ src/ChangeLog 2011-02-07 01:24:53 +0000 @@ -5,6 +5,7 @@ * dired.c (scmp, file_name_completion): Change types between char * and unsigned char *, to satisfy C89 rules about pointer type compatibility. + * casefiddle.c (casify_object, casify_region): Likewise. 2011-02-06 Paul Eggert === modified file 'src/casefiddle.c' --- src/casefiddle.c 2011-01-26 08:36:39 +0000 +++ src/casefiddle.c 2011-02-07 01:24:53 +0000 @@ -142,7 +142,7 @@ o += CHAR_STRING (c, o); } eassert (o - dst <= o_size); - obj = make_multibyte_string (dst, size, o - dst); + obj = make_multibyte_string ((char *) dst, size, o - dst); SAFE_FREE (); return obj; } @@ -279,7 +279,7 @@ keeping text properties the same. */ replace_range_2 (start, start_byte, start + 1, start_byte + len, - str, 1, tolen, + (char *) str, 1, tolen, 0); len = tolen; } @@ -442,4 +442,3 @@ initial_define_key (meta_map, 'l', "downcase-word"); initial_define_key (meta_map, 'c', "capitalize-word"); } - ------------------------------------------------------------ revno: 103158 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 17:19:18 -0800 message: Merge: * dired.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 22:02:50 +0000 +++ src/ChangeLog 2011-02-07 01:18:31 +0000 @@ -1,3 +1,11 @@ +2011-02-07 Paul Eggert + + conform to C89 pointer rules + + * dired.c (scmp, file_name_completion): + Change types between char * and unsigned char *, to satisfy C89 + rules about pointer type compatibility. + 2011-02-06 Paul Eggert * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. === modified file 'src/dired.c' --- src/dired.c 2011-01-30 22:17:44 +0000 +++ src/dired.c 2011-02-07 01:18:31 +0000 @@ -99,7 +99,7 @@ Lisp_Object Qfile_attributes; Lisp_Object Qfile_attributes_lessp; -static int scmp (const unsigned char *, const unsigned char *, int); +static int scmp (const char *, const char *, int); #ifdef WINDOWSNT Lisp_Object @@ -533,7 +533,7 @@ QUIT; if (! DIRENTRY_NONEMPTY (dp) || len < SCHARS (encoded_file) - || 0 <= scmp (dp->d_name, SDATA (encoded_file), + || 0 <= scmp (dp->d_name, SSDATA (encoded_file), SCHARS (encoded_file))) continue; @@ -558,7 +558,7 @@ && matchcount > 1 && !includeall /* This match may allow includeall to 0. */ && len >= bestmatchsize - && 0 > scmp (dp->d_name, SDATA (bestmatch), bestmatchsize)) + && 0 > scmp (dp->d_name, SSDATA (bestmatch), bestmatchsize)) continue; #endif @@ -578,7 +578,7 @@ CONSP (tem); tem = XCDR (tem)) { int elt_len; - unsigned char *p1; + char *p1; elt = XCAR (tem); if (!STRINGP (elt)) @@ -589,7 +589,7 @@ elt_len = SCHARS (elt) - 1; /* -1 for trailing / */ if (elt_len <= 0) continue; - p1 = SDATA (elt); + p1 = SSDATA (elt); if (p1[elt_len] != '/') continue; skip = len - elt_len; @@ -619,7 +619,7 @@ if (skip < 0) continue; if (0 <= scmp (dp->d_name + skip, - SDATA (elt), + SSDATA (elt), SCHARS (elt))) continue; break; @@ -796,13 +796,15 @@ else number of chars that match at the beginning. */ static int -scmp (const unsigned char *s1, const unsigned char *s2, int len) +scmp (const char *s1, const char *s2, int len) { register int l = len; if (completion_ignore_case) { - while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++)) + while (l + && (DOWNCASE ((unsigned char) *s1++) + == DOWNCASE ((unsigned char) *s2++))) l--; } else ------------------------------------------------------------ revno: 103157 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 17:03:27 -0800 message: Merge: gnulib: allow multiple gnulib generated replacements to coexist diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-06 22:13:03 +0000 +++ ChangeLog 2011-02-07 01:01:26 +0000 @@ -1,5 +1,10 @@ 2011-02-06 Paul Eggert + gnulib: allow multiple gnulib generated replacements to coexist + This defines a few preprocessor symbols that should not affect Emacs. + * lib/getopt.in.h, lib/time.in.h, lib/unistd.in.h: Regenerate + via "make sync-from-gnulib". + gnulib: undo previous change The upstream _HEADERS change was backed out of gnulib (see the same thread). Stay in sync with gnulib. === modified file 'lib/getopt.in.h' --- lib/getopt.in.h 2011-02-06 22:13:03 +0000 +++ lib/getopt.in.h 2011-02-07 01:01:26 +0000 @@ -181,6 +181,7 @@ one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ +# if !GNULIB_defined_struct_option struct option { const char *name; @@ -190,6 +191,8 @@ int *flag; int val; }; +# define GNULIB_defined_struct_option 1 +# endif /* Names for the values of the `has_arg' field of `struct option'. */ === modified file 'lib/time.in.h' --- lib/time.in.h 2011-02-06 22:13:03 +0000 +++ lib/time.in.h 2011-02-07 01:01:26 +0000 @@ -69,13 +69,16 @@ extern "C" { # endif -# undef timespec -# define timespec rpl_timespec +# if !GNULIB_defined_struct_timespec +# undef timespec +# define timespec rpl_timespec struct timespec { time_t tv_sec; long int tv_nsec; }; +# define GNULIB_defined_struct_timespec 1 +# endif # ifdef __cplusplus } @@ -84,6 +87,7 @@ # endif # endif +# if !GNULIB_defined_struct_time_t_must_be_integral /* Per http://austingroupbugs.net/view.php?id=327, POSIX requires time_t to be an integer type, even though C99 permits floating point. We don't know of any implementation that uses floating @@ -92,6 +96,8 @@ struct __time_t_must_be_integral { unsigned int __floating_time_t_unsupported : (time_t) 1; }; +# define GNULIB_defined_struct_time_t_must_be_integral 1 +# endif /* Sleep for at least RQTP seconds unless interrupted, If interrupted, return -1 and store the remaining time into RMTP. See === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2011-02-06 22:13:03 +0000 +++ lib/unistd.in.h 2011-02-07 01:01:26 +0000 @@ -796,11 +796,14 @@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getpagesize() _gl_getpagesize () # else +# if !GNULIB_defined_getpagesize_function static inline int getpagesize () { return _gl_getpagesize (); } +# define GNULIB_defined_getpagesize_function 1 +# endif # endif # endif # endif ------------------------------------------------------------ revno: 103156 committer: Jay Belanger branch nick: trunk timestamp: Sun 2011-02-06 18:54:23 -0600 message: calc/README: Add mention of logarithmic units. calc/calc-help.el (calc-logunits-add): Rename from `calc-logunits-plus'. (calc-logunits-sub): Rename from `calc-logunits-minus'. (calc-logunits-mul): Rename from `calc-logunits-times'. (calcFunc-lupoweradd): Rename from `calcFunc-lupowerplus'. (calcFunc-lupowersub): Rename from `calcFunc-lupowerminus'. (calcFunc-lupowermul): Rename from `calcFunc-lupowertimes'. calc/calc-ext.el (calc-init-extensions): Change names of logarithmic unit functions in autoloads. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-07 00:12:17 +0000 +++ lisp/ChangeLog 2011-02-07 00:54:23 +0000 @@ -13,16 +13,16 @@ `math-logunits-level' (math-logunits-plus): Renamed from math-logcombine. (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove. - (calcFunc-lufieldplus, calcFunc-lupowerplus, calcFunc-lufieldminus) - (calcFunc-lufieldminus,calc-logunits-plus calc-logunits-minus): + (calcFunc-lufieldadd, calcFunc-lupoweradd, calcFunc-lufieldsub) + (calcFunc-lufieldsub,calc-logunits-add calc-logunits-sub): New functions. (calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'. (calcFunc-powerquant): Renamed from `calcFunc-powerlevel'. (calc-logunits-quantity): Renamed from `calc-level'. (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel) (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel) - (math-logunits-times, calcFunc-lufieldtimes, calcFunc-lupowertimes) - (calc-logunits-times, math-logunits-divide, calcFunc-lufielddiv) + (math-logunits-mul, calcFunc-lufieldmul, calcFunc-lupowermul) + (calc-logunits-mul, math-logunits-divide, calcFunc-lufielddiv) (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level): New functions. @@ -33,6 +33,8 @@ * calc/calc-ext.el (calc-init-extensions): Update autoloads. + * calc/README: Mention logarithmic units. + 2011-02-06 Chong Yidong * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for === modified file 'lisp/calc/README' --- lisp/calc/README 2011-01-26 08:36:39 +0000 +++ lisp/calc/README 2011-02-07 00:54:23 +0000 @@ -72,6 +72,8 @@ Emacs 24.1 +* Support for logarithmic units added. + * Calc no longer uses the tex prefix for TeX specific unit names when using TeX or LaTeX mode. === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-02-06 22:42:14 +0000 +++ lisp/calc/calc-ext.el 2011-02-07 00:54:23 +0000 @@ -425,9 +425,9 @@ (define-key calc-mode-map "lq" 'calc-logunits-quantity) (define-key calc-mode-map "ld" 'calc-logunits-dblevel) (define-key calc-mode-map "ln" 'calc-logunits-nplevel) - (define-key calc-mode-map "l+" 'calc-logunits-plus) - (define-key calc-mode-map "l-" 'calc-logunits-minus) - (define-key calc-mode-map "l*" 'calc-logunits-times) + (define-key calc-mode-map "l+" 'calc-logunits-add) + (define-key calc-mode-map "l-" 'calc-logunits-sub) + (define-key calc-mode-map "l*" 'calc-logunits-mul) (define-key calc-mode-map "l/" 'calc-logunits-divide) (define-key calc-mode-map "l?" 'calc-l-prefix-help) @@ -939,9 +939,9 @@ ("calc-stuff" calc-explain-why calcFunc-clean calcFunc-pclean calcFunc-pfloat calcFunc-pfrac) - ("calc-units" calcFunc-usimplify calcFunc-lufieldplus -calcFunc-lupowerplus calcFunc-lufieldminus calcFunc-lupowerminus -calcFunc-lufieldtimes calcFunc-lupowertimes calcFunc-lufielddiv + ("calc-units" calcFunc-usimplify calcFunc-lufieldadd +calcFunc-lupoweradd calcFunc-lufieldsub calcFunc-lupowersub +calcFunc-lufieldmul calcFunc-lupowermul calcFunc-lufielddiv calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel calcFunc-nppowerlevel @@ -1177,8 +1177,8 @@ calc-get-unit-definition calc-permanent-units calc-quick-units calc-remove-units calc-simplify-units calc-undefine-unit calc-view-units-table calc-logunits-quantity calc-logunits-dblevel -calc-logunits-nplevel calc-logunits-plus calc-logunits-minus -calc-logunits-times calc-logunits-divide) +calc-logunits-nplevel calc-logunits-add calc-logunits-sub +calc-logunits-mul calc-logunits-divide) ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm calc-conj-transpose calc-cons calc-cross calc-kron calc-diag === modified file 'lisp/calc/calc-units.el' --- lisp/calc/calc-units.el 2011-02-06 22:42:14 +0000 +++ lisp/calc/calc-units.el 2011-02-07 00:54:23 +0000 @@ -1567,7 +1567,7 @@ (list '^ (math-extract-logunits (nth 1 expr)) (nth 2 expr)) (if (member expr math-logunits) expr 1)))) -(defun math-logunits-plus (a b neg power) +(defun math-logunits-add (a b neg power) (let ((aunit (math-simplify (math-extract-logunits a)))) (if (not (eq (car-safe aunit) 'var)) (calc-record-why "*Improper logarithmic unit" aunit) @@ -1607,18 +1607,18 @@ units))))))) (defun calcFunc-lufieldplus (a b) - (math-logunits-plus a b nil nil)) + (math-logunits-add a b nil nil)) (defun calcFunc-lupowerplus (a b) - (math-logunits-plus a b nil t)) + (math-logunits-add a b nil t)) (defun calcFunc-lufieldminus (a b) - (math-logunits-plus a b t nil)) + (math-logunits-add a b t nil)) (defun calcFunc-lupowerminus (a b) - (math-logunits-plus a b t t)) + (math-logunits-add a b t t)) -(defun calc-logunits-plus (arg) +(defun calc-logunits-add (arg) (interactive "P") (calc-slow-wrapper (if (calc-is-inverse) @@ -1629,7 +1629,7 @@ (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) (calc-binary-op "lu+" 'calcFunc-lupowerplus arg))))) -(defun calc-logunits-minus (arg) +(defun calc-logunits-sub (arg) (interactive "P") (calc-slow-wrapper (if (calc-is-inverse) @@ -1640,7 +1640,7 @@ (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) (calc-binary-op "lu-" 'calcFunc-lupowerminus arg))))) -(defun math-logunits-times (a b power) +(defun math-logunits-mul (a b power) (let (logunit coef units number) (cond ((and @@ -1703,12 +1703,12 @@ units))))))))) (defun calcFunc-lufieldtimes (a b) - (math-logunits-times a b nil)) + (math-logunits-mul a b nil)) (defun calcFunc-lupowertimes (a b) - (math-logunits-times a b t)) + (math-logunits-mul a b t)) -(defun calc-logunits-times (arg) +(defun calc-logunits-mul (arg) (interactive "P") (calc-slow-wrapper (if (calc-is-inverse) ------------------------------------------------------------ revno: 103155 committer: Deniz Dogan branch nick: emacs-trunk timestamp: Mon 2011-02-07 01:12:17 +0100 message: * lisp/net/rcirc.el (rcirc-handler-317): New function. (Bug#6507) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-06 22:44:01 +0000 +++ lisp/ChangeLog 2011-02-07 00:12:17 +0000 @@ -1,3 +1,7 @@ +2011-02-07 Deniz Dogan + + * net/rcirc.el (rcirc-handler-317): New function (Bug#6507). + 2011-02-06 Jay Belanger * calc/calc.el (calc-logunits-field-reference) Renamed from === modified file 'lisp/net/rcirc.el' --- lisp/net/rcirc.el 2011-02-05 21:07:26 +0000 +++ lisp/net/rcirc.el 2011-02-07 00:12:17 +0000 @@ -2592,6 +2592,20 @@ (setq rcirc-nick-away-alist (cons (cons nick away-message) rcirc-nick-away-alist)))))) +(defun rcirc-handler-317 (process sender args text) + "RPL_WHOISIDLE" + (let* ((nick (nth 1 args)) + (idle-secs (string-to-number (nth 2 args))) + (idle-string + (if (< idle-secs most-positive-fixnum) + (format-seconds "%yy %dd %hh %mm %z%ss" idle-secs) + "a very long time")) + (signon-time (seconds-to-time (string-to-number (nth 3 args)))) + (signon-string (format-time-string "%c" signon-time)) + (message (format "%s idle for %s, signed on %s" + nick idle-string signon-string))) + (rcirc-print process sender "317" nil message t))) + (defun rcirc-handler-332 (process sender args text) "RPL_TOPIC" (let ((buffer (or (rcirc-get-buffer process (cadr args)) ------------------------------------------------------------ revno: 103154 committer: Jay Belanger branch nick: trunk timestamp: Sun 2011-02-06 16:44:01 -0600 message: Update ChangeLog diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-06 15:04:31 +0000 +++ lisp/ChangeLog 2011-02-06 22:44:01 +0000 @@ -1,3 +1,34 @@ +2011-02-06 Jay Belanger + + * calc/calc.el (calc-logunits-field-reference) Renamed from + `calc-default-field-reference-level'. + (calc-logunits-power-reference): Renamed from + `calc-default-power-reference-level' + + * calc/calc-units.el (math-logunits-quant): Renamed from + `math-logunits-level' + (math-logunits-plus): Renamed from math-logcombine. + (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove. + (calcFunc-lufieldplus, calcFunc-lupowerplus, calcFunc-lufieldminus) + (calcFunc-lufieldminus,calc-logunits-plus calc-logunits-minus): + New functions. + (calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'. + (calcFunc-powerquant): Renamed from `calcFunc-powerlevel'. + (calc-logunits-quantity): Renamed from `calc-level'. + (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel) + (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel) + (math-logunits-times, calcFunc-lufieldtimes, calcFunc-lupowertimes) + (calc-logunits-times, math-logunits-divide, calcFunc-lufielddiv) + (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level): + New functions. + + * calc/calc-help.el (calc-u-prefix-help): Removed "L" reference. + (calc-ul-prefix-help): Remove. + (calc-l-prefix-help): New function. + (calc-full-help): Add reference to `calc-l-prefix-help'. + + * calc/calc-ext.el (calc-init-extensions): Update autoloads. + 2011-02-06 Chong Yidong * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for ------------------------------------------------------------ revno: 103153 committer: Jay Belanger branch nick: trunk timestamp: Sun 2011-02-06 16:42:14 -0600 message: calc/calc.el (calc-logunits-field-reference) Renamed from `calc-default-field-reference-level'. (calc-logunits-power-reference): Renamed from `calc-default-power-reference-level' calc/calc-units.el (math-logunits-quant): Renamed from `math-logunits-level' (math-logunits-plus): Renamed from math-logcombine. (calcFunc-luplus, calcFunc-luminus calc-luplus, calc-luminus): Remove functions. (calcFunc-lufieldplus, calcFunc-lupowerplus, calcFunc-lufieldminus) (calcFunc-lufieldminus,calc-logunits-plus calc-logunits-minus): New functions. (calcFunc-fieldquant): Renamed from `calcFunc-fieldlevel'. (calcFunc-powerquant): Renamed from `calcFunc-powerlevel'. (calc-logunits-quantity): Renamed from `calc-level'. (calcFunc-dbfieldlevel, calcFunc-dbpowerlevel, calcFunc-npfieldlevel) (calcFunc-nppowerlevel,calc-logunits-dblevel, calc-logunits-nplevel) (math-logunits-times, calcFunc-lufieldtimes, calcFunc-lupowertimes) (calc-logunits-times, math-logunits-divide, calcFunc-lufielddiv) (calcFunc-lupowerdiv,calc-logunits-divide,math-logunits-level): New functions. calc-help.el (calc-u-prefix-help): Removed "L" reference. (calc-ul-prefix-help): Remove. (calc-l-prefix-help): New function. (calc-full-help): Add reference to `calc-l-prefix-help'. calc-ext.el (calc-init-extensions): Update autoloads. diff: === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc-ext.el 2011-02-06 22:42:14 +0000 @@ -421,6 +421,16 @@ (define-key calc-mode-map "kP" 'calc-utpp) (define-key calc-mode-map "kT" 'calc-utpt) + (define-key calc-mode-map "l" nil) + (define-key calc-mode-map "lq" 'calc-logunits-quantity) + (define-key calc-mode-map "ld" 'calc-logunits-dblevel) + (define-key calc-mode-map "ln" 'calc-logunits-nplevel) + (define-key calc-mode-map "l+" 'calc-logunits-plus) + (define-key calc-mode-map "l-" 'calc-logunits-minus) + (define-key calc-mode-map "l*" 'calc-logunits-times) + (define-key calc-mode-map "l/" 'calc-logunits-divide) + (define-key calc-mode-map "l?" 'calc-l-prefix-help) + (define-key calc-mode-map "m" nil) (define-key calc-mode-map "m?" 'calc-m-prefix-help) (define-key calc-mode-map "ma" 'calc-algebraic-mode) @@ -546,10 +556,6 @@ (define-key calc-mode-map "ud" 'calc-define-unit) (define-key calc-mode-map "ue" 'calc-explain-units) (define-key calc-mode-map "ug" 'calc-get-unit-definition) - (define-key calc-mode-map "ul+" 'calc-luplus) - (define-key calc-mode-map "ul-" 'calc-luminus) - (define-key calc-mode-map "ull" 'calc-level) - (define-key calc-mode-map "ul?" 'calc-ul-prefix-help) (define-key calc-mode-map "up" 'calc-permanent-units) (define-key calc-mode-map "ur" 'calc-remove-units) (define-key calc-mode-map "us" 'calc-simplify-units) @@ -933,8 +939,12 @@ ("calc-stuff" calc-explain-why calcFunc-clean calcFunc-pclean calcFunc-pfloat calcFunc-pfrac) - ("calc-units" calcFunc-usimplify calcFunc-luplus -calcFunc-luminus calcFunc-fieldlevel calcFunc-powerlevel + ("calc-units" calcFunc-usimplify calcFunc-lufieldplus +calcFunc-lupowerplus calcFunc-lufieldminus calcFunc-lupowerminus +calcFunc-lufieldtimes calcFunc-lupowertimes calcFunc-lufielddiv +calcFunc-lupowerdiv calcFunc-fieldquant calcFunc-powerquant +calcFunc-dbfieldlevel calcFunc-dbpowerlevel calcFunc-npfieldlevel +calcFunc-nppowerlevel math-build-units-table math-build-units-table-buffer math-check-unit-name math-convert-temperature math-convert-units math-extract-units math-remove-units math-simplify-units @@ -1166,7 +1176,9 @@ calc-enter-units-table calc-explain-units calc-extract-units calc-get-unit-definition calc-permanent-units calc-quick-units calc-remove-units calc-simplify-units calc-undefine-unit -calc-view-units-table calc-luplus calc-luminus calc-level) +calc-view-units-table calc-logunits-quantity calc-logunits-dblevel +calc-logunits-nplevel calc-logunits-plus calc-logunits-minus +calc-logunits-times calc-logunits-divide) ("calc-vec" calc-arrange-vector calc-build-vector calc-cnorm calc-conj-transpose calc-cons calc-cross calc-kron calc-diag === modified file 'lisp/calc/calc-help.el' --- lisp/calc/calc-help.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc-help.el 2011-02-06 22:42:14 +0000 @@ -455,6 +455,7 @@ calc-h-prefix-help calc-j-prefix-help calc-k-prefix-help + calc-l-prefix-help calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help @@ -662,19 +663,18 @@ (calc-do-prefix-help '("Simplify, Convert, Temperature-convert, Base-units" "Autorange; Remove, eXtract; Explain; View-table; 0-9" - "Define, Undefine, Get-defn, Permanent, Logarithmic" + "Define, Undefine, Get-defn, Permanent" "SHIFT + View-table-other-window" "SHIFT + stat: Mean, G-mean, Std-dev, Covar, maX, miN" "SHIFT + stat: + (sum), - (asum), * (prod), # (count)") "units/stat" ?u)) -(defun calc-ul-prefix-help () +(defun calc-l-prefix-help () (interactive) - (if (eq this-command last-command) - (message "ul-") - (message "logarithmic-units: + (logarithmic), - (logarithmic), Level: ul-")) - (push ?l unread-command-events) - (push ?u unread-command-events)) + (calc-do-prefix-help + '("Quantity, DB level, Np level" + "+, -, *, /") + "log units" ?l)) (defun calc-v-prefix-help () (interactive) === modified file 'lisp/calc/calc-units.el' --- lisp/calc/calc-units.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc-units.el 2011-02-06 22:42:14 +0000 @@ -1567,7 +1567,7 @@ (list '^ (math-extract-logunits (nth 1 expr)) (nth 2 expr)) (if (member expr math-logunits) expr 1)))) -(defun math-logcombine (a b neg) +(defun math-logunits-plus (a b neg power) (let ((aunit (math-simplify (math-extract-logunits a)))) (if (not (eq (car-safe aunit) 'var)) (calc-record-why "*Improper logarithmic unit" aunit) @@ -1583,49 +1583,160 @@ (calc-record-why "*Improper coefficients" nil) (math-mul (if (equal aunit '(var dB var-dB)) - (math-mul 10 - (calcFunc-log10 - (if neg - (math-sub - (math-pow 10 (math-div acoeff 10)) - (math-pow 10 (math-div bcoeff 10))) - (math-add - (math-pow 10 (math-div acoeff 10)) - (math-pow 10 (math-div bcoeff 10)))))) - (calcFunc-ln - (if neg - (math-sub - (calcFunc-exp acoeff) - (calcFunc-exp bcoeff)) - (math-add - (calcFunc-exp acoeff) - (calcFunc-exp bcoeff))))) + (let ((coef (if power 10 20))) + (math-mul coef + (calcFunc-log10 + (if neg + (math-sub + (math-pow 10 (math-div acoeff coef)) + (math-pow 10 (math-div bcoeff coef))) + (math-add + (math-pow 10 (math-div acoeff coef)) + (math-pow 10 (math-div bcoeff coef))))))) + (let ((coef (if power 2 1))) + (math-div + (calcFunc-ln + (if neg + (math-sub + (calcFunc-exp (math-mul coef acoeff)) + (calcFunc-exp (math-mul coef bcoeff))) + (math-add + (calcFunc-exp (math-mul coef acoeff)) + (calcFunc-exp (math-mul coef bcoeff))))) + coef))) units))))))) -(defun calcFunc-luplus (a b) - (math-logcombine a b nil)) - -(defun calcFunc-luminus (a b) - (math-logcombine a b t)) - -(defun calc-luplus (arg) - (interactive "P") - (calc-slow-wrapper - (if (calc-is-inverse) - (calc-binary-op "lu-" 'calcFunc-luminus arg) - (calc-binary-op "lu+" 'calcFunc-luplus arg)))) - -(defun calc-luminus (arg) - (interactive "P") - (calc-slow-wrapper - (if (calc-is-inverse) - (calc-binary-op "lu+" 'calcFunc-luplus arg) - (calc-binary-op "lu-" 'calcFunc-luminus arg)))) - -;(defun calcFunc-lmul (a b) - - -(defun math-logunit-level (val ref power) +(defun calcFunc-lufieldplus (a b) + (math-logunits-plus a b nil nil)) + +(defun calcFunc-lupowerplus (a b) + (math-logunits-plus a b nil t)) + +(defun calcFunc-lufieldminus (a b) + (math-logunits-plus a b t nil)) + +(defun calcFunc-lupowerminus (a b) + (math-logunits-plus a b t t)) + +(defun calc-logunits-plus (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-inverse) + (if (calc-is-hyperbolic) + (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) + (calc-binary-op "lu-" 'calcFunc-lupowerminus arg)) + (if (calc-is-hyperbolic) + (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) + (calc-binary-op "lu+" 'calcFunc-lupowerplus arg))))) + +(defun calc-logunits-minus (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-inverse) + (if (calc-is-hyperbolic) + (calc-binary-op "lu+" 'calcFunc-lufieldplus arg) + (calc-binary-op "lu+" 'calcFunc-lupowerplus arg)) + (if (calc-is-hyperbolic) + (calc-binary-op "lu-" 'calcFunc-lufieldminus arg) + (calc-binary-op "lu-" 'calcFunc-lupowerminus arg))))) + +(defun math-logunits-times (a b power) + (let (logunit coef units number) + (cond + ((and + (setq logunit (math-simplify (math-extract-logunits a))) + (eq (car-safe logunit) 'var) + (eq (math-simplify (math-extract-units b)) 1)) + (setq coef (math-simplify (math-remove-units a)) + units (math-extract-units a) + number b)) + ((and + (setq logunit (math-simplify (math-extract-logunits b))) + (eq (car-safe logunit) 'var) + (eq (math-simplify (math-extract-units a)) 1)) + (setq coef (math-simplify (math-remove-units b)) + units (math-extract-units b) + number a)) + (t (setq logunit nil))) + (if logunit + (cond + ((equal logunit '(var dB var-dB)) + (math-simplify + (math-mul + (math-add + coef + (math-mul (if power 10 20) + (calcFunc-log10 number))) + units))) + (t + (math-simplify + (math-mul + (math-add + coef + (math-div (calcFunc-ln number) (if power 2 1))) + units)))) + (calc-record-why "*Improper units" nil)))) + +(defun math-logunits-divide (a b power) + (let ((logunit (math-simplify (math-extract-logunits a)))) + (if (not (eq (car-safe logunit) 'var)) + (calc-record-why "*Improper logarithmic unit" logunit) + (if (math-units-in-expr-p b nil) + (calc-record-why "*Improper units quantity" b) + (let* ((units (math-extract-units a)) + (coef (math-simplify (math-remove-units a)))) + (cond + ((equal logunit '(var dB var-dB)) + (math-simplify + (math-mul + (math-sub + coef + (math-mul (if power 10 20) + (calcFunc-log10 b))) + units))) + (t + (math-simplify + (math-mul + (math-sub + coef + (math-div (calcFunc-ln b) (if power 2 1))) + units))))))))) + +(defun calcFunc-lufieldtimes (a b) + (math-logunits-times a b nil)) + +(defun calcFunc-lupowertimes (a b) + (math-logunits-times a b t)) + +(defun calc-logunits-times (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-inverse) + (if (calc-is-hyperbolic) + (calc-binary-op "lu/" 'calcFunc-lufielddiv arg) + (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg)) + (if (calc-is-hyperbolic) + (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg) + (calc-binary-op "lu*" 'calcFunc-lupowertimes arg))))) + +(defun calcFunc-lufielddiv (a b) + (math-logunits-divide a b nil)) + +(defun calcFunc-lupowerdiv (a b) + (math-logunits-divide a b t)) + +(defun calc-logunits-divide (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-inverse) + (if (calc-is-hyperbolic) + (calc-binary-op "lu*" 'calcFunc-lufieldtimes arg) + (calc-binary-op "lu*" 'calcFunc-lupowertimes arg)) + (if (calc-is-hyperbolic) + (calc-binary-op "lu/" 'calcFunc-lufielddiv arg) + (calc-binary-op "lu/" 'calcFunc-lupowerdiv arg))))) + +(defun math-logunits-quant (val ref power) (let ((lunit (math-simplify (math-extract-logunits val)))) (if (not (eq (car-safe lunit) 'var)) (calc-record-why "*Improper logarithmic unit" lunit) @@ -1647,29 +1758,86 @@ (math-mul 2 coeff) coeff))))))))) -(defvar calc-default-field-reference-level) -(defvar calc-default-power-reference-level) - -(defun calcFunc-fieldlevel (val &optional ref) - (unless ref - (setq ref (math-read-expr calc-default-field-reference-level))) - (math-logunit-level val ref nil)) - -(defun calcFunc-powerlevel (val &optional ref) - (unless ref - (setq ref (math-read-expr calc-default-power-reference-level))) - (math-logunit-level val ref t)) - -(defun calc-level (arg) - (interactive "P") - (calc-slow-wrapper - (if (calc-is-hyperbolic) - (if (calc-is-option) - (calc-binary-op "plvl" 'calcFunc-powerlevel arg) - (calc-unary-op "plvl" 'calcFunc-powerlevel arg)) - (if (calc-is-option) - (calc-binary-op "flvl" 'calcFunc-fieldlevel arg) - (calc-unary-op "flvl" 'calcFunc-fieldlevel arg))))) +(defvar calc-logunits-field-reference) +(defvar calc-logunits-power-reference) + +(defun calcFunc-fieldquant (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-field-reference))) + (math-logunits-quant val ref nil)) + +(defun calcFunc-powerquant (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-power-reference))) + (math-logunits-quant val ref t)) + +(defun calc-logunits-quantity (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-hyperbolic) + (if (calc-is-option) + (calc-binary-op "lupq" 'calcFunc-fieldquant arg) + (calc-unary-op "lupq" 'calcFunc-fieldquant arg)) + (if (calc-is-option) + (calc-binary-op "lufq" 'calcFunc-powerquant arg) + (calc-unary-op "lufq" 'calcFunc-powerquant arg))))) + +(defun math-logunits-level (val ref db power) + "Compute the value of VAL in decibels or nepers." + (let* ((ratio (math-simplify-units (math-div val ref))) + (units (math-simplify (math-extract-units ratio)))) + (math-mul + (if db + (math-mul + (math-mul (if power 10 20) + (calcFunc-log10 ratio)) + '(var dB var-dB)) + (math-mul + (math-div (calcFunc-ln ratio) (if power 2 1)) + '(var Np var-Np))) + units))) + +(defun calcFunc-dbfieldlevel (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-field-reference))) + (math-logunits-level val ref t nil)) + +(defun calcFunc-dbpowerlevel (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-power-reference))) + (math-logunits-level val ref t t)) + +(defun calcFunc-npfieldlevel (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-field-reference))) + (math-logunits-level val ref nil nil)) + +(defun calcFunc-nppowerlevel (val &optional ref) + (unless ref + (setq ref (math-read-expr calc-logunits-power-reference))) + (math-logunits-level val ref nil t)) + +(defun calc-logunits-dblevel (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-hyperbolic) + (if (calc-is-option) + (calc-binary-op "ludb" 'calcFunc-dbfieldlevel arg) + (calc-unary-op "ludb" 'calcFunc-dbfieldlevel arg)) + (if (calc-is-option) + (calc-binary-op "ludb" 'calcFunc-dbpowerlevel arg) + (calc-unary-op "ludb" 'calcFunc-dbpowerlevel arg))))) + +(defun calc-logunits-nplevel (arg) + (interactive "P") + (calc-slow-wrapper + (if (calc-is-hyperbolic) + (if (calc-is-option) + (calc-binary-op "lunp" 'calcFunc-npfieldlevel arg) + (calc-unary-op "lunp" 'calcFunc-npfieldlevel arg)) + (if (calc-is-option) + (calc-binary-op "lunp" 'calcFunc-nppowerlevel arg) + (calc-unary-op "lunp" 'calcFunc-nppowerlevel arg))))) (provide 'calc-units) === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2011-01-25 04:08:28 +0000 +++ lisp/calc/calc.el 2011-02-06 22:42:14 +0000 @@ -434,13 +434,13 @@ :group 'calc :type 'boolean) -(defcustom calc-default-field-reference-level +(defcustom calc-logunits-field-reference "20 uPa" "The default reference level for logarithmic units (field)." :group 'calc :type '(string)) -(defcustom calc-default-power-reference-level +(defcustom calc-logunits-power-reference "mW" "The default reference level for logarithmic units (power)." :group 'calc ------------------------------------------------------------ revno: 103152 author: Lars Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2011-02-06 22:27:28 +0000 message: nntp.el (nntp-finish-retrieve-group-infos): Protect against the first part not returning any data. proto-stream.el (open-protocol-stream): Document the return value. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-06 12:48:19 +0000 +++ lisp/gnus/ChangeLog 2011-02-06 22:27:28 +0000 @@ -1,3 +1,10 @@ +2011-02-06 Lars Ingebrigtsen + + * nntp.el (nntp-finish-retrieve-group-infos): Protect against the first + part not returning any data. + + * proto-stream.el (open-protocol-stream): Document the return value. + 2011-02-06 Julien Danjou * message.el (message-setup-1): Handle message-generate-headers-first === modified file 'lisp/gnus/nntp.el' --- lisp/gnus/nntp.el 2011-01-31 03:35:09 +0000 +++ lisp/gnus/nntp.el 2011-02-06 22:27:28 +0000 @@ -781,7 +781,8 @@ ;; The first time this is run, this variable is `try'. So we ;; try. (when (eq nntp-server-list-active-group 'try) - (nntp-try-list-active (gnus-group-real-name (gnus-info-group (car infos))))) + (nntp-try-list-active + (gnus-group-real-name (gnus-info-group (car infos))))) (with-current-buffer (nntp-find-connection-buffer nntp-server-buffer) (erase-buffer) (let ((nntp-inhibit-erase t) @@ -800,7 +801,8 @@ (car infos))) (received 0) (last-point 1)) - (when buf + (when (and buf + count) (with-current-buffer buf (while (and (gnus-buffer-live-p buf) (progn === modified file 'lisp/gnus/proto-stream.el' --- lisp/gnus/proto-stream.el 2011-01-25 23:51:40 +0000 +++ lisp/gnus/proto-stream.el 2011-02-06 22:27:28 +0000 @@ -94,7 +94,15 @@ :starttls-function -- a function that takes one parameter, which is the response to the capaibility command. It should return nil if it turns out that the server doesn't support STARTTLS, or the -command to switch on STARTTLS otherwise." +command to switch on STARTTLS otherwise. + +The return value from this function is a four-element list, where +the first element is the stream (if connection was successful); +the second element is the \"greeting\", i. e., the string the +server sent over on initial contact; the third element is the +capability string; and the fourth element is either `network' or +`tls', depending on whether the connection ended up being +encrypted or not." (let ((type (or (cadr (memq :type parameters)) 'network))) (cond ((eq type 'starttls) ------------------------------------------------------------ revno: 103151 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 14:13:32 -0800 message: Merge: gnulib: undo previous change diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-06 08:28:30 +0000 +++ ChangeLog 2011-02-06 22:13:03 +0000 @@ -1,5 +1,9 @@ 2011-02-06 Paul Eggert + gnulib: undo previous change + The upstream _HEADERS change was backed out of gnulib (see the + same thread). Stay in sync with gnulib. + gnulib: adjust to upstream _HEADERS change * lib/Makefile.am (EXTRA_HEADERS, nodist_pkginclude_HEADERS): New empty macros, to accommodate recent changes to gnulib. See === modified file 'c++defs.h' --- c++defs.h 2011-02-06 08:28:30 +0000 +++ c++defs.h 2011-02-06 22:13:03 +0000 @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _gl_GL_CXXDEFS_H -#define _gl_GL_CXXDEFS_H +#ifndef _GL_CXXDEFS_H +#define _GL_CXXDEFS_H /* The three most frequent use cases of these macros are: @@ -268,4 +268,4 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif -#endif /* _gl_GL_CXXDEFS_H */ +#endif /* _GL_CXXDEFS_H */ === modified file 'lib/Makefile.am' --- lib/Makefile.am 2011-02-06 08:28:30 +0000 +++ lib/Makefile.am 2011-02-06 22:13:03 +0000 @@ -1,8 +1,6 @@ BUILT_SOURCES = EXTRA_DIST = -EXTRA_HEADERS = MOSTLYCLEANFILES = -nodist_pkginclude_HEADERS = noinst_LIBRARIES = DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src === modified file 'lib/Makefile.in' --- lib/Makefile.in 2011-02-06 08:28:30 +0000 +++ lib/Makefile.in 2011-02-06 22:13:03 +0000 @@ -26,7 +26,6 @@ # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files dtoastr getopt-gnu ignore-value mktime strftime - VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -82,29 +81,6 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pkgincludedir)" -HEADERS = $(nodist_pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -501,13 +477,10 @@ getopt_int.h intprops.h mktime-internal.h mktime.c \ stdbool.in.h stddef.in.h strftime.c strftime.h time.in.h \ time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h -EXTRA_HEADERS = getopt.h stdbool.h stddef.h MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ c++defs.h c++defs.h-t getopt.h getopt.h-t stdbool.h \ stdbool.h-t stddef.h stddef.h-t time.h time.h-t unistd.h \ unistd.h-t warn-on-use.h warn-on-use.h-t -nodist_pkginclude_HEADERS = arg-nonnull.h c++defs.h $(GETOPT_H) \ - $(STDBOOL_H) $(STDDEF_H) time.h unistd.h warn-on-use.h noinst_LIBRARIES = libgnu.a DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src libgnu_a_SOURCES = dtoastr.c gettext.h ignore-value.h @@ -588,26 +561,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" - @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ - done - -uninstall-nodist_pkgincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -694,11 +647,8 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) $(HEADERS) +all-am: Makefile $(LIBRARIES) installdirs: - for dir in "$(DESTDIR)$(pkgincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am @@ -749,7 +699,7 @@ info-am: -install-data-am: install-nodist_pkgincludeHEADERS +install-data-am: install-dvi: install-dvi-am @@ -795,7 +745,7 @@ ps-am: -uninstall-am: uninstall-nodist_pkgincludeHEADERS +uninstall-am: .MAKE: all check install install-am install-strip @@ -805,13 +755,12 @@ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-nodist_pkgincludeHEADERS \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \ - pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-nodist_pkgincludeHEADERS + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \ + uninstall uninstall-am # The arg-nonnull.h that gets inserted into generated .h files is the same as # build-aux/arg-nonnull.h, except that it has the copyright header cut off. === modified file 'lib/ftoastr.h' --- lib/ftoastr.h 2011-02-06 08:28:30 +0000 +++ lib/ftoastr.h 2011-02-06 22:13:03 +0000 @@ -17,7 +17,7 @@ /* Written by Paul Eggert. */ -#ifndef _gl_GL_FTOASTR_H +#ifndef _GL_FTOASTR_H #include "intprops.h" #include @@ -141,4 +141,4 @@ #define DBL_BUFSIZE_BOUND ( DBL_STRLEN_BOUND + 1) #define LDBL_BUFSIZE_BOUND (LDBL_STRLEN_BOUND + 1) -#endif /* _gl_GL_FTOASTR_H */ +#endif /* _GL_FTOASTR_H */ === modified file 'lib/getopt.in.h' --- lib/getopt.in.h 2011-02-06 08:28:30 +0000 +++ lib/getopt.in.h 2011-02-06 22:13:03 +0000 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _gl_GL_GETOPT_H +#ifndef _GL_GETOPT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -32,10 +32,10 @@ # undef _GL_SYSTEM_GETOPT #endif -#ifndef _gl_GL_GETOPT_H +#ifndef _GL_GETOPT_H #ifndef __need_getopt -# define _gl_GL_GETOPT_H 1 +# define _GL_GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-02-06 08:28:30 +0000 +++ lib/gnulib.mk 2011-02-06 22:13:03 +0000 @@ -23,8 +23,6 @@ ## begin gnulib module arg-nonnull -nodist_pkginclude_HEADERS += arg-nonnull.h - # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability @@ -49,8 +47,6 @@ ## begin gnulib module c++defs -nodist_pkginclude_HEADERS += c++defs.h - # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability @@ -85,9 +81,6 @@ ## begin gnulib module getopt-posix -nodist_pkginclude_HEADERS += $(GETOPT_H) -EXTRA_HEADERS += getopt.h - BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system @@ -142,9 +135,6 @@ ## begin gnulib module stdbool -nodist_pkginclude_HEADERS += $(STDBOOL_H) -EXTRA_HEADERS += stdbool.h - BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system @@ -163,9 +153,6 @@ ## begin gnulib module stddef -nodist_pkginclude_HEADERS += $(STDDEF_H) -EXTRA_HEADERS += stddef.h - BUILT_SOURCES += $(STDDEF_H) # We need the following in order to create when the system @@ -199,8 +186,6 @@ ## begin gnulib module time -nodist_pkginclude_HEADERS += time.h - BUILT_SOURCES += time.h # We need the following in order to create when the system @@ -251,8 +236,6 @@ ## begin gnulib module unistd -nodist_pkginclude_HEADERS += unistd.h - BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for @@ -384,8 +367,6 @@ ## begin gnulib module warn-on-use -nodist_pkginclude_HEADERS += warn-on-use.h - BUILT_SOURCES += warn-on-use.h # The warn-on-use.h that gets inserted into generated .h files is the same as # build-aux/warn-on-use.h, except that it has the copyright header cut off. === modified file 'lib/ignore-value.h' --- lib/ignore-value.h 2011-02-06 08:28:30 +0000 +++ lib/ignore-value.h 2011-02-06 22:13:03 +0000 @@ -32,8 +32,8 @@ "copy.c:233: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result". */ -#ifndef _gl_GL_IGNORE_VALUE_H -# define _gl_GL_IGNORE_VALUE_H +#ifndef _GL_IGNORE_VALUE_H +# define _GL_IGNORE_VALUE_H # ifndef ATTRIBUTE_DEPRECATED /* The __attribute__((__deprecated__)) feature === modified file 'lib/stdbool.in.h' --- lib/stdbool.in.h 2011-02-06 08:28:30 +0000 +++ lib/stdbool.in.h 2011-02-06 22:13:03 +0000 @@ -15,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _gl_GL_STDBOOL_H -#define _gl_GL_STDBOOL_H +#ifndef _GL_STDBOOL_H +#define _GL_STDBOOL_H /* ISO C 99 for platforms that lack it. */ @@ -119,4 +119,4 @@ #define true 1 #define __bool_true_false_are_defined 1 -#endif /* _gl_GL_STDBOOL_H */ +#endif /* _GL_STDBOOL_H */ === modified file 'lib/stddef.in.h' --- lib/stddef.in.h 2011-02-06 08:28:30 +0000 +++ lib/stddef.in.h 2011-02-06 22:13:03 +0000 @@ -38,9 +38,9 @@ remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ -# if !(defined _gl_GL_STDDEF_H && defined _GL_STDDEF_WINT_T) +# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _gl_GL_STDDEF_H +# undef _GL_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -49,14 +49,14 @@ #else /* Normal invocation convention. */ -# ifndef _gl_GL_STDDEF_H +# ifndef _GL_STDDEF_H /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _gl_GL_STDDEF_H -# define _gl_GL_STDDEF_H +# ifndef _GL_STDDEF_H +# define _GL_STDDEF_H /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ #if @REPLACE_NULL@ @@ -82,6 +82,6 @@ # define wchar_t int #endif -# endif /* _gl_GL_STDDEF_H */ -# endif /* _gl_GL_STDDEF_H */ +# endif /* _GL_STDDEF_H */ +# endif /* _GL_STDDEF_H */ #endif /* __need_XXX */ === modified file 'lib/time.in.h' --- lib/time.in.h 2011-02-06 08:28:30 +0000 +++ lib/time.in.h 2011-02-06 22:13:03 +0000 @@ -28,13 +28,13 @@ without adding our own declarations. */ #if (defined __need_time_t || defined __need_clock_t \ || defined __need_timespec \ - || defined _gl_GL_TIME_H) + || defined _GL_TIME_H) # @INCLUDE_NEXT@ @NEXT_TIME_H@ #else -# define _gl_GL_TIME_H +# define _GL_TIME_H # @INCLUDE_NEXT@ @NEXT_TIME_H@ === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2011-02-06 08:28:30 +0000 +++ lib/unistd.in.h 2011-02-06 22:13:03 +0000 @@ -25,7 +25,7 @@ but we need to ensure that both the system and are completely included before we replace gethostname. */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ - && !defined _gl_GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H + && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H /* is being indirectly included for the first time from ; avoid declaring any overrides. */ # if @HAVE_UNISTD_H@ @@ -33,10 +33,10 @@ # else # error unexpected; report this to bug-gnulib@gnu.org # endif -# define _gl_GL_WINSOCK2_H_WITNESS +# define _GL_WINSOCK2_H_WITNESS /* Normal invocation. */ -#elif !defined _gl_GL_UNISTD_H +#elif !defined _GL_UNISTD_H /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -45,14 +45,14 @@ /* Get all possible declarations of gethostname(). */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ - && !defined _gl_GL_INCLUDING_WINSOCK2_H -# define _gl_GL_INCLUDING_WINSOCK2_H + && !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H # include -# undef _gl_GL_INCLUDING_WINSOCK2_H +# undef _GL_INCLUDING_WINSOCK2_H #endif -#if !defined _gl_GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H -#define _gl_GL_UNISTD_H +#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _GL_UNISTD_H /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ #include @@ -119,7 +119,7 @@ #if @GNULIB_GETHOSTNAME@ /* Get all possible declarations of gethostname(). */ # if @UNISTD_H_HAVE_WINSOCK2_H@ -# if !defined _gl_GL_SYS_SOCKET_H +# if !defined _GL_SYS_SOCKET_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef socket # define socket socket_used_without_including_sys_socket_h @@ -180,7 +180,7 @@ "shutdown() used without including "); # endif # endif -# if !defined _gl_GL_SYS_SELECT_H +# if !defined _GL_SYS_SELECT_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef select # define select select_used_without_including_sys_select_h @@ -1374,5 +1374,5 @@ #endif -#endif /* _gl_GL_UNISTD_H */ -#endif /* _gl_GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */ ------------------------------------------------------------ revno: 103150 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 14:03:16 -0800 message: Merge: * fileio.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 20:12:53 +0000 +++ src/ChangeLog 2011-02-06 22:02:50 +0000 @@ -19,6 +19,15 @@ Likewise. * keymap.c (Ftext_char_description): Likewise. * minibuf.c (Fread_buffer): Likewise. + * fileio.c (IS_DRIVE) [defined WINDOWSNT]: + (DRIVE_LETTER) [defined DOS_NT]: + (report_file_error, Ffile_name_directory, Ffile_name_nondirectory): + (make_temp_name, Fexpand_file_name, file_name_absolute_p): + (search_embedded_absfilename, Fsubstitute_in_file_name): + (barf_or_query_if_file_exists, Fmake_directory_internal): + (Fdelete_directory_internal, Ffile_name_absolute_p, read_non_regular): + (Finsert_file_contents, Fwrite_region): + Likewise. * insdel.c (insert, insert_and_inherit, insert_before_markers): (insert_before_markers_and_inherit, insert_1, insert_1_both): Likewise. This changes these functions' signatures, which is === modified file 'src/fileio.c' --- src/fileio.c 2011-02-06 19:44:36 +0000 +++ src/fileio.c 2011-02-06 22:02:50 +0000 @@ -79,12 +79,12 @@ #define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z') #endif #ifdef WINDOWSNT -#define IS_DRIVE(x) isalpha (x) +#define IS_DRIVE(x) isalpha ((unsigned char) (x)) #endif /* Need to lower-case the drive letter, or else expanded filenames will sometimes compare inequal, because `expand-file-name' doesn't always down-case the drive letter. */ -#define DRIVE_LETTER(x) (tolower (x)) +#define DRIVE_LETTER(x) (tolower ((unsigned char) (x))) #endif #include "systime.h" @@ -193,7 +193,7 @@ int c; str = SSDATA (errstring); - c = STRING_CHAR (str); + c = STRING_CHAR ((unsigned char *) str); Faset (errstring, make_number (0), make_number (DOWNCASE (c))); } @@ -324,11 +324,11 @@ (Lisp_Object filename) { #ifndef DOS_NT - register const unsigned char *beg; + register const char *beg; #else - register unsigned char *beg; + register char *beg; #endif - register const unsigned char *p; + register const char *p; Lisp_Object handler; CHECK_STRING (filename); @@ -341,10 +341,10 @@ filename = FILE_SYSTEM_CASE (filename); #ifdef DOS_NT - beg = (unsigned char *) alloca (SBYTES (filename) + 1); - memcpy (beg, SDATA (filename), SBYTES (filename) + 1); + beg = (char *) alloca (SBYTES (filename) + 1); + memcpy (beg, SSDATA (filename), SBYTES (filename) + 1); #else - beg = SDATA (filename); + beg = SSDATA (filename); #endif p = beg + SBYTES (filename); @@ -365,8 +365,8 @@ if (p[-1] == ':') { /* MAXPATHLEN+1 is guaranteed to be enough space for getdefdir. */ - unsigned char *res = alloca (MAXPATHLEN + 1); - unsigned char *r = res; + char *res = alloca (MAXPATHLEN + 1); + char *r = res; if (p == beg + 4 && IS_DIRECTORY_SEP (*beg) && beg[1] == ':') { @@ -375,7 +375,7 @@ r += 2; } - if (getdefdir (toupper (*beg) - 'A' + 1, r)) + if (getdefdir (toupper ((unsigned char) *beg) - 'A' + 1, r)) { if (!IS_DIRECTORY_SEP (res[strlen (res) - 1])) strcat (res, "/"); @@ -397,7 +397,7 @@ or the entire name if it contains no slash. */) (Lisp_Object filename) { - register const unsigned char *beg, *p, *end; + register const char *beg, *p, *end; Lisp_Object handler; CHECK_STRING (filename); @@ -408,7 +408,7 @@ if (!NILP (handler)) return call2 (handler, Qfile_name_nondirectory, filename); - beg = SDATA (filename); + beg = SSDATA (filename); end = p = beg + SBYTES (filename); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) @@ -600,7 +600,7 @@ Lisp_Object val; int len, clen; int pid; - unsigned char *p, *data; + char *p, *data; char pidbuf[20]; int pidlen; @@ -637,8 +637,8 @@ val = make_uninit_multibyte_string (clen + 3 + pidlen, len + 3 + pidlen); if (!STRING_MULTIBYTE (prefix)) STRING_SET_UNIBYTE (val); - data = SDATA (val); - memcpy (data, SDATA (prefix), len); + data = SSDATA (val); + memcpy (data, SSDATA (prefix), len); p = data + len; memcpy (p, pidbuf, pidlen); @@ -744,9 +744,9 @@ { /* These point to SDATA and need to be careful with string-relocation during GC (via DECODE_FILE). */ - unsigned char *nm, *newdir; + char *nm, *newdir; /* This should only point to alloca'd data. */ - unsigned char *target; + char *target; int tlen; struct passwd *pw; @@ -796,7 +796,7 @@ } { - unsigned char *o = SDATA (default_directory); + char *o = SSDATA (default_directory); /* Make sure DEFAULT_DIRECTORY is properly expanded. It would be better to do this down below where we actually use @@ -848,8 +848,8 @@ } /* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */ - nm = (unsigned char *) alloca (SBYTES (name) + 1); - memcpy (nm, SDATA (name), SBYTES (name) + 1); + nm = (char *) alloca (SBYTES (name) + 1); + memcpy (nm, SSDATA (name), SBYTES (name) + 1); #ifdef DOS_NT /* Note if special escape prefix is present, but remove for now. */ @@ -864,7 +864,7 @@ drive specifier at the beginning. */ if (IS_DRIVE (nm[0]) && IS_DEVICE_SEP (nm[1])) { - drive = nm[0]; + drive = (unsigned char) nm[0]; nm += 2; } @@ -903,7 +903,7 @@ non-zero value, that means we've discovered that we can't do that cool trick. */ int lose = 0; - unsigned char *p = nm; + char *p = nm; while (*p) { @@ -941,7 +941,7 @@ else #endif /* drive must be set, so this is okay */ - if (strcmp (nm - 2, SDATA (name)) != 0) + if (strcmp (nm - 2, SSDATA (name)) != 0) { char temp[] = " :"; @@ -983,8 +983,8 @@ { Lisp_Object tem; - if (!(newdir = (unsigned char *) egetenv ("HOME"))) - newdir = (unsigned char *) ""; + if (!(newdir = egetenv ("HOME"))) + newdir = ""; nm++; /* egetenv may return a unibyte string, which will bite us since we expect the directory to be multibyte. */ @@ -992,7 +992,7 @@ if (!STRING_MULTIBYTE (tem)) { hdir = DECODE_FILE (tem); - newdir = SDATA (hdir); + newdir = SSDATA (hdir); } #ifdef DOS_NT collapse_newdir = 0; @@ -1000,7 +1000,7 @@ } else /* ~user/filename */ { - unsigned char *o, *p; + char *o, *p; for (p = nm; *p && (!IS_DIRECTORY_SEP (*p)); p++); o = alloca (p - nm + 1); memcpy (o, nm, p - nm); @@ -1011,7 +1011,7 @@ UNBLOCK_INPUT; if (pw) { - newdir = (unsigned char *) pw -> pw_dir; + newdir = pw->pw_dir; nm = p; #ifdef DOS_NT collapse_newdir = 0; @@ -1060,7 +1060,7 @@ #endif && !newdir) { - newdir = SDATA (default_directory); + newdir = SSDATA (default_directory); #ifdef DOS_NT /* Note if special escape prefix is present, but remove for now. */ if (newdir[0] == '/' && newdir[1] == ':') @@ -1093,7 +1093,7 @@ if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1])) { - drive = newdir[0]; + drive = (unsigned char) newdir[0]; newdir += 2; } if (!IS_DIRECTORY_SEP (nm[0])) @@ -1127,7 +1127,7 @@ #ifdef WINDOWSNT if (IS_DIRECTORY_SEP (newdir[0]) && IS_DIRECTORY_SEP (newdir[1])) { - unsigned char *p; + char *p; newdir = strcpy (alloca (strlen (newdir) + 1), newdir); p = newdir + 2; while (*p && !IS_DIRECTORY_SEP (*p)) p++; @@ -1153,7 +1153,7 @@ #endif ) { - unsigned char *temp = (unsigned char *) alloca (length); + char *temp = (char *) alloca (length); memcpy (temp, newdir, length - 1); temp[length - 1] = 0; newdir = temp; @@ -1169,10 +1169,10 @@ /* Reserve space for drive specifier and escape prefix, since either or both may need to be inserted. (The Microsoft x86 compiler produces incorrect code if the following two lines are combined.) */ - target = (unsigned char *) alloca (tlen + 4); + target = (char *) alloca (tlen + 4); target += 4; #else /* not DOS_NT */ - target = (unsigned char *) alloca (tlen); + target = (char *) alloca (tlen); #endif /* not DOS_NT */ *target = 0; @@ -1200,8 +1200,8 @@ /* Now canonicalize by removing `//', `/.' and `/foo/..' if they appear. */ { - unsigned char *p = target; - unsigned char *o = target; + char *p = target; + char *o = target; while (*p) { @@ -1233,7 +1233,7 @@ && (IS_DIRECTORY_SEP (p[3]) || p[3] == 0)) { #ifdef WINDOWSNT - unsigned char *prev_o = o; + char *prev_o = o; #endif while (o != target && (--o) && !IS_DIRECTORY_SEP (*o)) ; @@ -1460,7 +1460,7 @@ /* If /~ or // appears, discard everything through first slash. */ static int -file_name_absolute_p (const unsigned char *filename) +file_name_absolute_p (const char *filename) { return (IS_DIRECTORY_SEP (*filename) || *filename == '~' @@ -1471,10 +1471,10 @@ ); } -static unsigned char * -search_embedded_absfilename (unsigned char *nm, unsigned char *endp) +static char * +search_embedded_absfilename (char *nm, char *endp) { - unsigned char *p, *s; + char *p, *s; for (p = nm + 1; p < endp; p++) { @@ -1491,7 +1491,7 @@ for (s = p; *s && (!IS_DIRECTORY_SEP (*s)); s++); if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */ { - unsigned char *o = alloca (s - p + 1); + char *o = alloca (s - p + 1); struct passwd *pw; memcpy (o, p, s - p); o [s - p] = 0; @@ -1525,14 +1525,14 @@ those `/' is discarded. */) (Lisp_Object filename) { - unsigned char *nm; + char *nm; - register unsigned char *s, *p, *o, *x, *endp; - unsigned char *target = NULL; + register char *s, *p, *o, *x, *endp; + char *target = NULL; int total = 0; int substituted = 0; int multibyte; - unsigned char *xnm; + char *xnm; Lisp_Object handler; CHECK_STRING (filename); @@ -1548,7 +1548,7 @@ /* Always work on a copy of the string, in case GC happens during decode of environment variables, causing the original Lisp_String data to be relocated. */ - nm = (unsigned char *) alloca (SBYTES (filename) + 1); + nm = (char *) alloca (SBYTES (filename) + 1); memcpy (nm, SDATA (filename), SBYTES (filename) + 1); #ifdef DOS_NT @@ -1600,7 +1600,7 @@ } /* Copy out the variable name */ - target = (unsigned char *) alloca (s - o + 1); + target = (char *) alloca (s - o + 1); strncpy (target, o, s - o); target[s - o] = 0; #ifdef DOS_NT @@ -1608,7 +1608,7 @@ #endif /* DOS_NT */ /* Get variable value */ - o = (unsigned char *) egetenv (target); + o = egetenv (target); if (o) { /* Don't try to guess a maximum length - UTF8 can use up to @@ -1631,7 +1631,7 @@ /* If substitution required, recopy the string and do it */ /* Make space in stack frame for the new copy */ - xnm = (unsigned char *) alloca (SBYTES (filename) + total + 1); + xnm = (char *) alloca (SBYTES (filename) + total + 1); x = xnm; /* Copy the rest of the name through, replacing $ constructs with values */ @@ -1663,7 +1663,7 @@ } /* Copy out the variable name */ - target = (unsigned char *) alloca (s - o + 1); + target = (char *) alloca (s - o + 1); strncpy (target, o, s - o); target[s - o] = 0; #ifdef DOS_NT @@ -1671,7 +1671,7 @@ #endif /* DOS_NT */ /* Get variable value */ - o = (unsigned char *) egetenv (target); + o = egetenv (target); if (!o) { *x++ = '$'; @@ -1751,7 +1751,8 @@ If QUICK is nonzero, we ask for y or n, not yes or no. */ void -barf_or_query_if_file_exists (Lisp_Object absname, const unsigned char *querystring, int interactive, struct stat *statptr, int quick) +barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, + int interactive, struct stat *statptr, int quick) { register Lisp_Object tem, encoded_filename; struct stat statbuf; @@ -2027,7 +2028,7 @@ doc: /* Create a new directory named DIRECTORY. */) (Lisp_Object directory) { - const unsigned char *dir; + const char *dir; Lisp_Object handler; Lisp_Object encoded_dir; @@ -2040,7 +2041,7 @@ encoded_dir = ENCODE_FILE (directory); - dir = SDATA (encoded_dir); + dir = SSDATA (encoded_dir); #ifdef WINDOWSNT if (mkdir (dir) != 0) @@ -2057,14 +2058,14 @@ doc: /* Delete the directory named DIRECTORY. Does not follow symlinks. */) (Lisp_Object directory) { - const unsigned char *dir; + const char *dir; Lisp_Object handler; Lisp_Object encoded_dir; CHECK_STRING (directory); directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil)); encoded_dir = ENCODE_FILE (directory); - dir = SDATA (encoded_dir); + dir = SSDATA (encoded_dir); if (rmdir (dir) != 0) report_file_error ("Removing directory", list1 (directory)); @@ -2371,7 +2372,7 @@ (Lisp_Object filename) { CHECK_STRING (filename); - return file_name_absolute_p (SDATA (filename)) ? Qt : Qnil; + return file_name_absolute_p (SSDATA (filename)) ? Qt : Qnil; } /* Return nonzero if file FILENAME exists and can be executed. */ @@ -3142,7 +3143,8 @@ immediate_quit = 1; QUIT; nbytes = emacs_read (non_regular_fd, - BEG_ADDR + PT_BYTE - BEG_BYTE + non_regular_inserted, + ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + + non_regular_inserted), non_regular_nbytes); immediate_quit = 0; return make_number (nbytes); @@ -3196,9 +3198,9 @@ Lisp_Object p; EMACS_INT total = 0; int not_regular = 0; - unsigned char read_buf[READ_BUF_SIZE]; + char read_buf[READ_BUF_SIZE]; struct coding_system coding; - unsigned char buffer[1 << 14]; + char buffer[1 << 14]; int replace_handled = 0; int set_coding_system = 0; Lisp_Object coding_system; @@ -3506,13 +3508,14 @@ nread = emacs_read (fd, buffer, sizeof buffer); if (nread < 0) error ("IO error reading %s: %s", - SDATA (orig_filename), emacs_strerror (errno)); + SSDATA (orig_filename), emacs_strerror (errno)); else if (nread == 0) break; if (CODING_REQUIRE_DETECTION (&coding)) { - coding_system = detect_coding_system (buffer, nread, nread, 1, 0, + coding_system = detect_coding_system ((unsigned char *) buffer, + nread, nread, 1, 0, coding_system); setup_coding_system (coding_system, &coding); } @@ -3714,8 +3717,8 @@ BUF_TEMP_SET_PT (XBUFFER (conversion_buffer), BUF_Z (XBUFFER (conversion_buffer))); - decode_coding_c_string (&coding, read_buf, unprocessed + this, - conversion_buffer); + decode_coding_c_string (&coding, (unsigned char *) read_buf, + unprocessed + this, conversion_buffer); unprocessed = coding.carryover_bytes; if (coding.carryover_bytes > 0) memcpy (read_buf, coding.carryover, unprocessed); @@ -3738,8 +3741,8 @@ if (unprocessed > 0) { coding.mode |= CODING_MODE_LAST_BLOCK; - decode_coding_c_string (&coding, read_buf, unprocessed, - conversion_buffer); + decode_coding_c_string (&coding, (unsigned char *) read_buf, + unprocessed, conversion_buffer); coding.mode &= ~CODING_MODE_LAST_BLOCK; } @@ -3941,7 +3944,10 @@ here doesn't do any harm. */ immediate_quit = 1; QUIT; - this = emacs_read (fd, BEG_ADDR + PT_BYTE - BEG_BYTE + inserted, trytry); + this = emacs_read (fd, + ((char *) BEG_ADDR + PT_BYTE - BEG_BYTE + + inserted), + trytry); immediate_quit = 0; } @@ -4466,7 +4472,7 @@ register int desc; int failure; int save_errno = 0; - const unsigned char *fn; + const char *fn; struct stat st; int count = SPECPDL_INDEX (); int count1; @@ -4586,7 +4592,7 @@ encoded_filename = ENCODE_FILE (filename); - fn = SDATA (encoded_filename); + fn = SSDATA (encoded_filename); desc = -1; if (!NILP (append)) #ifdef DOS_NT ------------------------------------------------------------ revno: 103149 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 12:13:17 -0800 message: Merge: * minibuf.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 19:56:30 +0000 +++ src/ChangeLog 2011-02-06 20:12:53 +0000 @@ -18,6 +18,7 @@ * keyboard.c (echo_char, MULTI_LETTER_MOD, tty_read_avail_input): Likewise. * keymap.c (Ftext_char_description): Likewise. + * minibuf.c (Fread_buffer): Likewise. * insdel.c (insert, insert_and_inherit, insert_before_markers): (insert_before_markers_and_inherit, insert_1, insert_1_both): Likewise. This changes these functions' signatures, which is === modified file 'src/minibuf.c' --- src/minibuf.c 2011-01-30 22:17:44 +0000 +++ src/minibuf.c 2011-02-06 20:12:53 +0000 @@ -1091,7 +1091,7 @@ (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match) { Lisp_Object args[4], result; - unsigned char *s; + char *s; int len; int count = SPECPDL_INDEX (); @@ -1113,7 +1113,7 @@ if (STRINGP (prompt)) { - s = SDATA (prompt); + s = SSDATA (prompt); len = strlen (s); if (len >= 2 && s[len - 2] == ':' && s[len - 1] == ' ') len = len - 2; ------------------------------------------------------------ revno: 103148 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 11:56:59 -0800 message: Merge: * keymap.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 19:44:36 +0000 +++ src/ChangeLog 2011-02-06 19:56:30 +0000 @@ -17,6 +17,7 @@ * image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load): Likewise. * keyboard.c (echo_char, MULTI_LETTER_MOD, tty_read_avail_input): Likewise. + * keymap.c (Ftext_char_description): Likewise. * insdel.c (insert, insert_and_inherit, insert_before_markers): (insert_before_markers_and_inherit, insert_1, insert_1_both): Likewise. This changes these functions' signatures, which is @@ -24,6 +25,9 @@ callers changed. * editfns.c (general_insert_function): Change signature to match changes to insert functions' signatures. + * keymap.c (map_keymap_char_table_item, map_keymap_internal): Use + explicit cast when converting between void * and function pointer + types, as C89 requires this. 2011-02-05 Paul Eggert === modified file 'src/keymap.c' --- src/keymap.c 2011-01-25 04:08:28 +0000 +++ src/keymap.c 2011-02-06 19:56:30 +0000 @@ -584,7 +584,8 @@ { if (!NILP (val)) { - map_keymap_function_t fun = XSAVE_VALUE (XCAR (args))->pointer; + map_keymap_function_t fun = + (map_keymap_function_t) XSAVE_VALUE (XCAR (args))->pointer; args = XCDR (args); /* If the key is a range, make a copy since map_char_table modifies it in place. */ @@ -629,7 +630,7 @@ else if (CHAR_TABLE_P (binding)) { map_char_table (map_keymap_char_table_item, Qnil, binding, - Fcons (make_save_value (fun, 0), + Fcons (make_save_value ((void *) fun, 0), Fcons (make_save_value (data, 0), args))); } @@ -2474,7 +2475,7 @@ (Lisp_Object character) { /* Currently MAX_MULTIBYTE_LENGTH is 4 (< 6). */ - unsigned char str[6]; + char str[6]; int c; CHECK_NUMBER (character); @@ -2482,7 +2483,7 @@ c = XINT (character); if (!ASCII_CHAR_P (c)) { - int len = CHAR_STRING (c, str); + int len = CHAR_STRING (c, (unsigned char *) str); return make_multibyte_string (str, 1, len); } @@ -3975,4 +3976,3 @@ initial_define_key (global_map, 033, "ESC-prefix"); initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); } - ------------------------------------------------------------ revno: 103147 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 11:45:23 -0800 message: Merge: * insdel.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 09:03:25 +0000 +++ src/ChangeLog 2011-02-06 19:44:36 +0000 @@ -17,6 +17,13 @@ * image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load): Likewise. * keyboard.c (echo_char, MULTI_LETTER_MOD, tty_read_avail_input): Likewise. + * insdel.c (insert, insert_and_inherit, insert_before_markers): + (insert_before_markers_and_inherit, insert_1, insert_1_both): + Likewise. This changes these functions' signatures, which is + more convenient since most callers use char *. All remaining + callers changed. + * editfns.c (general_insert_function): Change signature to + match changes to insert functions' signatures. 2011-02-05 Paul Eggert === modified file 'src/buffer.c' --- src/buffer.c 2011-01-30 22:17:44 +0000 +++ src/buffer.c 2011-02-06 19:44:36 +0000 @@ -2401,7 +2401,7 @@ *p = tmp[0]; TEMP_SET_PT_BOTH (pos + 1, pos + 1); bytes--; - insert_1_both (tmp + 1, bytes, bytes, 1, 0, 0); + insert_1_both ((char *) tmp + 1, bytes, bytes, 1, 0, 0); /* Now the gap is after the just inserted data. */ pos = GPT; p = GAP_END_ADDR; === modified file 'src/cmds.c' --- src/cmds.c 2011-01-26 08:36:39 +0000 +++ src/cmds.c 2011-02-06 19:44:36 +0000 @@ -466,15 +466,15 @@ else if (n > 1) { USE_SAFE_ALLOCA; - unsigned char *strn, *p; - SAFE_ALLOCA (strn, unsigned char*, n * len); + char *strn, *p; + SAFE_ALLOCA (strn, char *, n * len); for (p = strn; n > 0; n--, p += len) memcpy (p, str, len); insert_and_inherit (strn, p - strn); SAFE_FREE (); } else if (n > 0) - insert_and_inherit (str, len); + insert_and_inherit ((char *) str, len); if ((CHAR_TABLE_P (Vauto_fill_chars) ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) @@ -559,4 +559,3 @@ initial_define_key (global_map, Ctl ('E'), "end-of-line"); initial_define_key (global_map, Ctl ('F'), "forward-char"); } - === modified file 'src/coding.c' --- src/coding.c 2011-01-25 04:08:28 +0000 +++ src/coding.c 2011-02-06 19:44:36 +0000 @@ -7880,7 +7880,7 @@ else if (BUFFERP (src_object)) insert_from_buffer (XBUFFER (src_object), from, chars, 0); else - insert_1_both (coding->source + from, chars, bytes, 0, 0, 0); + insert_1_both ((char *) coding->source + from, chars, bytes, 0, 0, 0); if (EQ (src_object, dst_object)) { === modified file 'src/editfns.c' --- src/editfns.c 2011-02-05 22:30:14 +0000 +++ src/editfns.c 2011-02-06 19:44:36 +0000 @@ -94,7 +94,7 @@ static Lisp_Object region_limit (int); static size_t emacs_nmemftime (char *, size_t, const char *, size_t, const struct tm *, int, int); -static void general_insert_function (void (*) (const unsigned char *, EMACS_INT), +static void general_insert_function (void (*) (const char *, EMACS_INT), void (*) (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int), @@ -2118,7 +2118,7 @@ static void general_insert_function (void (*insert_func) - (const unsigned char *, EMACS_INT), + (const char *, EMACS_INT), void (*insert_from_string_func) (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int), @@ -2144,7 +2144,7 @@ : multibyte_char_to_unibyte (XINT (val), Qnil)); len = 1; } - (*insert_func) (str, len); + (*insert_func) ((char *) str, len); } else if (STRINGP (val)) { @@ -2257,7 +2257,7 @@ from adjoining text, if those properties are sticky. */) (Lisp_Object character, Lisp_Object count, Lisp_Object inherit) { - register unsigned char *string; + register char *string; register EMACS_INT strlen; register int i; register EMACS_INT n; @@ -2277,7 +2277,7 @@ if (n <= 0) return Qnil; strlen = min (n, 256 * len); - string = (unsigned char *) alloca (strlen); + string = (char *) alloca (strlen); for (i = 0; i < strlen; i++) string[i] = str[i % len]; while (n >= strlen) === modified file 'src/fileio.c' --- src/fileio.c 2011-01-30 22:17:44 +0000 +++ src/fileio.c 2011-02-06 19:44:36 +0000 @@ -3412,7 +3412,7 @@ Ferase_buffer (); buf->enable_multibyte_characters = Qnil; - insert_1_both (read_buf, nread, nread, 0, 0, 0); + insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); TEMP_SET_PT_BOTH (BEG, BEG_BYTE); coding_system = call2 (Vset_auto_coding_function, filename, make_number (nread)); === modified file 'src/insdel.c' --- src/insdel.c 2011-01-25 04:08:28 +0000 +++ src/insdel.c 2011-02-06 19:44:36 +0000 @@ -668,11 +668,11 @@ prepare_to_modify_buffer could relocate the text. */ void -insert (const unsigned char *string, EMACS_INT nbytes) +insert (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 0, 1, 0); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -683,11 +683,11 @@ /* Likewise, but inherit text properties from neighboring characters. */ void -insert_and_inherit (const unsigned char *string, EMACS_INT nbytes) +insert_and_inherit (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 1, 1, 0); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -711,7 +711,7 @@ str[0] = c; } - insert (str, len); + insert ((char *) str, len); } /* Insert the null-terminated string S before point. */ @@ -728,11 +728,11 @@ since gc could happen and relocate it. */ void -insert_before_markers (const unsigned char *string, EMACS_INT nbytes) +insert_before_markers (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 0, 1, 1); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -743,12 +743,12 @@ /* Likewise, but inherit text properties from neighboring characters. */ void -insert_before_markers_and_inherit (const unsigned char *string, +insert_before_markers_and_inherit (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 1, 1, 1); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -759,11 +759,11 @@ /* Subroutine used by the insert functions above. */ void -insert_1 (const unsigned char *string, EMACS_INT nbytes, +insert_1 (const char *string, EMACS_INT nbytes, int inherit, int prepare, int before_markers) { - insert_1_both (string, chars_in_text (string, nbytes), nbytes, - inherit, prepare, before_markers); + insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes), + nbytes, inherit, prepare, before_markers); } @@ -884,7 +884,7 @@ are the same as in insert_1. */ void -insert_1_both (const unsigned char *string, +insert_1_both (const char *string, EMACS_INT nchars, EMACS_INT nbytes, int inherit, int prepare, int before_markers) { @@ -2382,4 +2382,3 @@ defsubr (&Scombine_after_change_execute); } - === modified file 'src/lisp.h' --- src/lisp.h 2011-01-25 04:08:28 +0000 +++ src/lisp.h 2011-02-06 19:44:36 +0000 @@ -2555,10 +2555,10 @@ EMACS_INT, EMACS_INT, EMACS_INT); extern int count_combining_after (const unsigned char *, EMACS_INT, EMACS_INT, EMACS_INT); -extern void insert (const unsigned char *, EMACS_INT); -extern void insert_and_inherit (const unsigned char *, EMACS_INT); -extern void insert_1 (const unsigned char *, EMACS_INT, int, int, int); -extern void insert_1_both (const unsigned char *, EMACS_INT, EMACS_INT, +extern void insert (const char *, EMACS_INT); +extern void insert_and_inherit (const char *, EMACS_INT); +extern void insert_1 (const char *, EMACS_INT, int, int, int); +extern void insert_1_both (const char *, EMACS_INT, EMACS_INT, int, int, int); extern void insert_from_gap (EMACS_INT, EMACS_INT); extern void insert_from_string (Lisp_Object, EMACS_INT, EMACS_INT, @@ -2566,9 +2566,8 @@ extern void insert_from_buffer (struct buffer *, EMACS_INT, EMACS_INT, int); extern void insert_char (int); extern void insert_string (const char *); -extern void insert_before_markers (const unsigned char *, EMACS_INT); -extern void insert_before_markers_and_inherit (const unsigned char *, - EMACS_INT); +extern void insert_before_markers (const char *, EMACS_INT); +extern void insert_before_markers_and_inherit (const char *, EMACS_INT); extern void insert_from_string_before_markers (Lisp_Object, EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, int); === modified file 'src/print.c' --- src/print.c 2011-01-30 22:17:44 +0000 +++ src/print.c 2011-02-06 19:44:36 +0000 @@ -179,7 +179,7 @@ = (unsigned char *) alloca (print_buffer_pos + 1); \ copy_text (print_buffer, temp, print_buffer_pos_byte, \ 1, 0); \ - insert_1_both (temp, print_buffer_pos, \ + insert_1_both ((char *) temp, print_buffer_pos, \ print_buffer_pos, 0, 1, 0); \ } \ else \ === modified file 'src/xdisp.c' --- src/xdisp.c 2011-02-05 09:26:46 +0000 +++ src/xdisp.c 2011-02-06 19:44:36 +0000 @@ -7930,7 +7930,7 @@ { EMACS_INT i; int c, char_bytes; - unsigned char work[1]; + char work[1]; /* Convert a multibyte string to single-byte for the *Message* buffer. */ @@ -7956,17 +7956,17 @@ c = msg[i]; MAKE_CHAR_MULTIBYTE (c); char_bytes = CHAR_STRING (c, str); - insert_1_both (str, 1, char_bytes, 1, 0, 0); + insert_1_both ((char *) str, 1, char_bytes, 1, 0, 0); } } else if (nbytes) - insert_1 (msg, nbytes, 1, 0, 0); + insert_1 (m, nbytes, 1, 0, 0); if (nlflag) { EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte; int dup; - insert_1 ((const unsigned char *) "\n", 1, 1, 0, 0); + insert_1 ("\n", 1, 1, 0, 0); scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); this_bol = PT; @@ -7996,7 +7996,7 @@ sprintf (dupstr, " [%d times]", dup); duplen = strlen (dupstr); TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1); - insert_1 ((unsigned char *) dupstr, duplen, 1, 0, 1); + insert_1 (dupstr, duplen, 1, 0, 1); } } } @@ -9193,7 +9193,7 @@ /* Convert from multi-byte to single-byte. */ EMACS_INT i; int c, n; - unsigned char work[1]; + char work[1]; /* Convert a multibyte string to single-byte. */ for (i = 0; i < nbytes; i += n) @@ -9219,11 +9219,11 @@ c = msg[i]; MAKE_CHAR_MULTIBYTE (c); n = CHAR_STRING (c, str); - insert_1_both (str, 1, n, 1, 0, 0); + insert_1_both ((char *) str, 1, n, 1, 0, 0); } } else - insert_1 (msg, nbytes, 1, 0, 0); + insert_1 (s, nbytes, 1, 0, 0); } return 0; ------------------------------------------------------------ revno: 103146 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-02-06 10:04:31 -0500 message: Remove the check for non-ASCII in report-emacs-bug-hook (Bug#7925). * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for non-ASCII characters. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-05 22:30:14 +0000 +++ lisp/ChangeLog 2011-02-06 15:04:31 +0000 @@ -1,3 +1,8 @@ +2011-02-06 Chong Yidong + + * mail/emacsbug.el (report-emacs-bug-hook): Remove the check for + non-ASCII characters (Bug#7925). + 2011-02-05 Glenn Morris * emacs-lisp/cl-macs.el (return-from): Fix doc typo. === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2011-01-30 18:59:58 +0000 +++ lisp/mail/emacsbug.el 2011-02-06 15:04:31 +0000 @@ -340,18 +340,6 @@ (string-equal (buffer-substring-no-properties (point-min) (point)) report-emacs-bug-orig-text) (error "No text entered in bug report")) - ;; Check the buffer contents and reject non-English letters. - ;; FIXME message-mode probably does this anyway. - (goto-char (point-min)) - (skip-chars-forward "\0-\177") - (unless (eobp) - (if (or report-emacs-bug-no-confirmation - (y-or-n-p "Convert non-ASCII letters to hexadecimal? ")) - (while (progn (skip-chars-forward "\0-\177") - (not (eobp))) - (let ((ch (following-char))) - (delete-char 1) - (insert (format "=%02x" ch)))))) ;; The last warning for novice users. (unless (or report-emacs-bug-no-confirmation ------------------------------------------------------------ revno: 103145 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2011-02-06 12:48:19 +0000 message: message.el (message-setup-1): Handle message-generate-headers-first set to t. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-05 00:11:16 +0000 +++ lisp/gnus/ChangeLog 2011-02-06 12:48:19 +0000 @@ -1,3 +1,8 @@ +2011-02-06 Julien Danjou + + * message.el (message-setup-1): Handle message-generate-headers-first + set to t. + 2011-02-04 Lars Ingebrigtsen * message.el (message-setup-1): Remove the read-only stuff, since it === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-02-05 00:11:16 +0000 +++ lisp/gnus/message.el 2011-02-06 12:48:19 +0000 @@ -6417,7 +6417,9 @@ ;; `References:' header if `message-generate-headers-first' was nil. ;; Therefore, always generate it first. (let ((message-generate-headers-first - (append message-generate-headers-first '(References)))) + (if (eq message-generate-headers-first t) + t + (append message-generate-headers-first '(References))))) (when (message-news-p) (when message-default-news-headers (insert message-default-news-headers) ------------------------------------------------------------ revno: 103144 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 01:04:15 -0800 message: Merge: * keyboard.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 08:51:35 +0000 +++ src/ChangeLog 2011-02-06 09:03:25 +0000 @@ -15,6 +15,8 @@ * xfns.c (Fx_open_connection, Fx_window_property): Likewise. * bitmaps/gray.xbm (gray_bits): Likewise. * image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load): Likewise. + * keyboard.c (echo_char, MULTI_LETTER_MOD, tty_read_avail_input): + Likewise. 2011-02-05 Paul Eggert === modified file 'src/keyboard.c' --- src/keyboard.c 2011-01-30 22:17:44 +0000 +++ src/keyboard.c 2011-02-06 09:03:25 +0000 @@ -483,7 +483,7 @@ ptr = buffer + offset; } - ptr += copy_text (SDATA (name), ptr, nbytes, + ptr += copy_text (SDATA (name), (unsigned char *) ptr, nbytes, STRING_MULTIBYTE (name), 1); } @@ -6518,7 +6518,7 @@ #define MULTI_LETTER_MOD(BIT, NAME, LEN) \ if (LEN == SBYTES (name) \ - && ! strncmp (SDATA (name), NAME, LEN)) \ + && ! strncmp (SSDATA (name), NAME, LEN)) \ return BIT; case 'A': @@ -6949,7 +6949,7 @@ NREAD is set to the number of chars read. */ do { - nread = emacs_read (fileno (tty->input), cbuf, n_to_read); + nread = emacs_read (fileno (tty->input), (char *) cbuf, n_to_read); /* POSIX infers that processes which are not in the session leader's process group won't get SIGHUP's at logout time. BSDI adheres to this part standard and returns -1 from read (0) with errno==EIO ------------------------------------------------------------ revno: 103143 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 00:52:27 -0800 message: Merge: * image.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 03:48:28 +0000 +++ src/ChangeLog 2011-02-06 08:51:35 +0000 @@ -14,6 +14,7 @@ (Fsubstitute_command_keys): Likewise. * xfns.c (Fx_open_connection, Fx_window_property): Likewise. * bitmaps/gray.xbm (gray_bits): Likewise. + * image.c (xbm_read_bitmap_data, xbm_load_image, xbm_load): Likewise. 2011-02-05 Paul Eggert === modified file 'src/image.c' --- src/image.c 2011-02-05 10:20:15 +0000 +++ src/image.c 2011-02-06 08:51:35 +0000 @@ -2226,7 +2226,7 @@ static int xbm_image_p (Lisp_Object object); static int xbm_read_bitmap_data (struct frame *f, unsigned char *, unsigned char *, - int *, int *, unsigned char **, int); + int *, int *, char **, int); static int xbm_file_p (Lisp_Object); @@ -2614,7 +2614,7 @@ static int xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *end, - int *width, int *height, unsigned char **data, + int *width, int *height, char **data, int inhibit_image_error) { unsigned char *s = contents; @@ -2622,7 +2622,7 @@ int padding_p = 0; int v10 = 0; int bytes_per_line, i, nbytes; - unsigned char *p; + char *p; int value; int LA1; @@ -2706,7 +2706,7 @@ bytes_per_line = (*width + 7) / 8 + padding_p; nbytes = bytes_per_line * *height; - p = *data = (unsigned char *) xmalloc (nbytes); + p = *data = (char *) xmalloc (nbytes); if (v10) { @@ -2768,7 +2768,7 @@ unsigned char *end) { int rc; - unsigned char *data; + char *data; int success_p = 0; rc = xbm_read_bitmap_data (f, contents, end, &img->width, &img->height, @@ -2936,7 +2936,7 @@ else if (STRINGP (data)) bits = SSDATA (data); else - bits = XBOOL_VECTOR (data)->data; + bits = (char *) XBOOL_VECTOR (data)->data; #ifdef WINDOWSNT { ------------------------------------------------------------ revno: 103142 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sun 2011-02-06 00:29:50 -0800 message: [merge] gnulib: adjust to upstream _HEADERS change diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-05 05:07:22 +0000 +++ ChangeLog 2011-02-06 08:28:30 +0000 @@ -1,3 +1,14 @@ +2011-02-06 Paul Eggert + + gnulib: adjust to upstream _HEADERS change + * lib/Makefile.am (EXTRA_HEADERS, nodist_pkginclude_HEADERS): + New empty macros, to accommodate recent changes to gnulib. See + . + * c++defs.h, lib/Makefile.in, lib/ftoastr.h, lib/getopt.in.h: + * lib/gnulib.mk, lib/ignore-value.h, lib/stdbool.in.h, lib/stddef.in.h: + * lib/time.in.h, lib/unistd.in.h: + Regenerate. + 2011-02-05 Paul Eggert sync from gnulib to remove HAVE_STDBOOL_H === modified file 'c++defs.h' --- c++defs.h 2011-01-09 06:57:07 +0000 +++ c++defs.h 2011-02-06 08:28:30 +0000 @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _GL_CXXDEFS_H -#define _GL_CXXDEFS_H +#ifndef _gl_GL_CXXDEFS_H +#define _gl_GL_CXXDEFS_H /* The three most frequent use cases of these macros are: @@ -268,4 +268,4 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif -#endif /* _GL_CXXDEFS_H */ +#endif /* _gl_GL_CXXDEFS_H */ === modified file 'lib/Makefile.am' --- lib/Makefile.am 2011-01-08 21:02:38 +0000 +++ lib/Makefile.am 2011-02-06 08:28:30 +0000 @@ -1,6 +1,8 @@ BUILT_SOURCES = EXTRA_DIST = +EXTRA_HEADERS = MOSTLYCLEANFILES = +nodist_pkginclude_HEADERS = noinst_LIBRARIES = DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src === modified file 'lib/Makefile.in' --- lib/Makefile.in 2011-02-03 19:29:35 +0000 +++ lib/Makefile.in 2011-02-06 08:28:30 +0000 @@ -26,6 +26,7 @@ # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files dtoastr getopt-gnu ignore-value mktime strftime + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -81,6 +82,29 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) DIST_SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +HEADERS = $(nodist_pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -477,10 +501,13 @@ getopt_int.h intprops.h mktime-internal.h mktime.c \ stdbool.in.h stddef.in.h strftime.c strftime.h time.in.h \ time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h +EXTRA_HEADERS = getopt.h stdbool.h stddef.h MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ c++defs.h c++defs.h-t getopt.h getopt.h-t stdbool.h \ stdbool.h-t stddef.h stddef.h-t time.h time.h-t unistd.h \ unistd.h-t warn-on-use.h warn-on-use.h-t +nodist_pkginclude_HEADERS = arg-nonnull.h c++defs.h $(GETOPT_H) \ + $(STDBOOL_H) $(STDDEF_H) time.h unistd.h warn-on-use.h noinst_LIBRARIES = libgnu.a DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src libgnu_a_SOURCES = dtoastr.c gettext.h ignore-value.h @@ -561,6 +588,26 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -647,8 +694,11 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LIBRARIES) +all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am @@ -699,7 +749,7 @@ info-am: -install-data-am: +install-data-am: install-nodist_pkgincludeHEADERS install-dvi: install-dvi-am @@ -745,7 +795,7 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-nodist_pkgincludeHEADERS .MAKE: all check install install-am install-strip @@ -755,12 +805,13 @@ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \ - uninstall uninstall-am + install-info-am install-man install-nodist_pkgincludeHEADERS \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \ + pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-nodist_pkgincludeHEADERS # The arg-nonnull.h that gets inserted into generated .h files is the same as # build-aux/arg-nonnull.h, except that it has the copyright header cut off. === modified file 'lib/ftoastr.h' --- lib/ftoastr.h 2011-01-09 01:20:28 +0000 +++ lib/ftoastr.h 2011-02-06 08:28:30 +0000 @@ -17,7 +17,7 @@ /* Written by Paul Eggert. */ -#ifndef _GL_FTOASTR_H +#ifndef _gl_GL_FTOASTR_H #include "intprops.h" #include @@ -141,4 +141,4 @@ #define DBL_BUFSIZE_BOUND ( DBL_STRLEN_BOUND + 1) #define LDBL_BUFSIZE_BOUND (LDBL_STRLEN_BOUND + 1) -#endif /* _GL_FTOASTR_H */ +#endif /* _gl_GL_FTOASTR_H */ === modified file 'lib/getopt.in.h' --- lib/getopt.in.h 2011-01-09 07:33:50 +0000 +++ lib/getopt.in.h 2011-02-06 08:28:30 +0000 @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _GL_GETOPT_H +#ifndef _gl_GL_GETOPT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -32,10 +32,10 @@ # undef _GL_SYSTEM_GETOPT #endif -#ifndef _GL_GETOPT_H +#ifndef _gl_GL_GETOPT_H #ifndef __need_getopt -# define _GL_GETOPT_H 1 +# define _gl_GL_GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2011-02-03 19:29:35 +0000 +++ lib/gnulib.mk 2011-02-06 08:28:30 +0000 @@ -23,6 +23,8 @@ ## begin gnulib module arg-nonnull +nodist_pkginclude_HEADERS += arg-nonnull.h + # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability @@ -47,6 +49,8 @@ ## begin gnulib module c++defs +nodist_pkginclude_HEADERS += c++defs.h + # The BUILT_SOURCES created by this Makefile snippet are not used via #include # statements but through direct file reference. Therefore this snippet must be # present in all Makefile.am that need it. This is ensured by the applicability @@ -81,6 +85,9 @@ ## begin gnulib module getopt-posix +nodist_pkginclude_HEADERS += $(GETOPT_H) +EXTRA_HEADERS += getopt.h + BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system @@ -135,6 +142,9 @@ ## begin gnulib module stdbool +nodist_pkginclude_HEADERS += $(STDBOOL_H) +EXTRA_HEADERS += stdbool.h + BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system @@ -153,6 +163,9 @@ ## begin gnulib module stddef +nodist_pkginclude_HEADERS += $(STDDEF_H) +EXTRA_HEADERS += stddef.h + BUILT_SOURCES += $(STDDEF_H) # We need the following in order to create when the system @@ -186,6 +199,8 @@ ## begin gnulib module time +nodist_pkginclude_HEADERS += time.h + BUILT_SOURCES += time.h # We need the following in order to create when the system @@ -236,6 +251,8 @@ ## begin gnulib module unistd +nodist_pkginclude_HEADERS += unistd.h + BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for @@ -367,6 +384,8 @@ ## begin gnulib module warn-on-use +nodist_pkginclude_HEADERS += warn-on-use.h + BUILT_SOURCES += warn-on-use.h # The warn-on-use.h that gets inserted into generated .h files is the same as # build-aux/warn-on-use.h, except that it has the copyright header cut off. === modified file 'lib/ignore-value.h' --- lib/ignore-value.h 2011-02-03 21:38:05 +0000 +++ lib/ignore-value.h 2011-02-06 08:28:30 +0000 @@ -32,8 +32,8 @@ "copy.c:233: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result". */ -#ifndef _GL_IGNORE_VALUE_H -# define _GL_IGNORE_VALUE_H +#ifndef _gl_GL_IGNORE_VALUE_H +# define _gl_GL_IGNORE_VALUE_H # ifndef ATTRIBUTE_DEPRECATED /* The __attribute__((__deprecated__)) feature === modified file 'lib/stdbool.in.h' --- lib/stdbool.in.h 2011-01-30 23:34:18 +0000 +++ lib/stdbool.in.h 2011-02-06 08:28:30 +0000 @@ -15,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _GL_STDBOOL_H -#define _GL_STDBOOL_H +#ifndef _gl_GL_STDBOOL_H +#define _gl_GL_STDBOOL_H /* ISO C 99 for platforms that lack it. */ @@ -119,4 +119,4 @@ #define true 1 #define __bool_true_false_are_defined 1 -#endif /* _GL_STDBOOL_H */ +#endif /* _gl_GL_STDBOOL_H */ === modified file 'lib/stddef.in.h' --- lib/stddef.in.h 2011-01-09 06:57:07 +0000 +++ lib/stddef.in.h 2011-02-06 08:28:30 +0000 @@ -38,9 +38,9 @@ remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ -# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T) +# if !(defined _gl_GL_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _GL_STDDEF_H +# undef _gl_GL_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -49,14 +49,14 @@ #else /* Normal invocation convention. */ -# ifndef _GL_STDDEF_H +# ifndef _gl_GL_STDDEF_H /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _GL_STDDEF_H -# define _GL_STDDEF_H +# ifndef _gl_GL_STDDEF_H +# define _gl_GL_STDDEF_H /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ #if @REPLACE_NULL@ @@ -82,6 +82,6 @@ # define wchar_t int #endif -# endif /* _GL_STDDEF_H */ -# endif /* _GL_STDDEF_H */ +# endif /* _gl_GL_STDDEF_H */ +# endif /* _gl_GL_STDDEF_H */ #endif /* __need_XXX */ === modified file 'lib/time.in.h' --- lib/time.in.h 2011-01-09 06:57:07 +0000 +++ lib/time.in.h 2011-02-06 08:28:30 +0000 @@ -28,13 +28,13 @@ without adding our own declarations. */ #if (defined __need_time_t || defined __need_clock_t \ || defined __need_timespec \ - || defined _GL_TIME_H) + || defined _gl_GL_TIME_H) # @INCLUDE_NEXT@ @NEXT_TIME_H@ #else -# define _GL_TIME_H +# define _gl_GL_TIME_H # @INCLUDE_NEXT@ @NEXT_TIME_H@ === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2011-01-09 07:33:50 +0000 +++ lib/unistd.in.h 2011-02-06 08:28:30 +0000 @@ -25,7 +25,7 @@ but we need to ensure that both the system and are completely included before we replace gethostname. */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ - && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H + && !defined _gl_GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H /* is being indirectly included for the first time from ; avoid declaring any overrides. */ # if @HAVE_UNISTD_H@ @@ -33,10 +33,10 @@ # else # error unexpected; report this to bug-gnulib@gnu.org # endif -# define _GL_WINSOCK2_H_WITNESS +# define _gl_GL_WINSOCK2_H_WITNESS /* Normal invocation. */ -#elif !defined _GL_UNISTD_H +#elif !defined _gl_GL_UNISTD_H /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -45,14 +45,14 @@ /* Get all possible declarations of gethostname(). */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \ - && !defined _GL_INCLUDING_WINSOCK2_H -# define _GL_INCLUDING_WINSOCK2_H + && !defined _gl_GL_INCLUDING_WINSOCK2_H +# define _gl_GL_INCLUDING_WINSOCK2_H # include -# undef _GL_INCLUDING_WINSOCK2_H +# undef _gl_GL_INCLUDING_WINSOCK2_H #endif -#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H -#define _GL_UNISTD_H +#if !defined _gl_GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _gl_GL_UNISTD_H /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ #include @@ -119,7 +119,7 @@ #if @GNULIB_GETHOSTNAME@ /* Get all possible declarations of gethostname(). */ # if @UNISTD_H_HAVE_WINSOCK2_H@ -# if !defined _GL_SYS_SOCKET_H +# if !defined _gl_GL_SYS_SOCKET_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef socket # define socket socket_used_without_including_sys_socket_h @@ -180,7 +180,7 @@ "shutdown() used without including "); # endif # endif -# if !defined _GL_SYS_SELECT_H +# if !defined _gl_GL_SYS_SELECT_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef select # define select select_used_without_including_sys_select_h @@ -1374,5 +1374,5 @@ #endif -#endif /* _GL_UNISTD_H */ -#endif /* _GL_UNISTD_H */ +#endif /* _gl_GL_UNISTD_H */ +#endif /* _gl_GL_UNISTD_H */ ------------------------------------------------------------ revno: 103141 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sat 2011-02-05 19:49:08 -0800 message: Merge: * xfns.c: conform to C89 pointer rules diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-06 03:13:16 +0000 +++ src/ChangeLog 2011-02-06 03:48:28 +0000 @@ -12,6 +12,8 @@ rules about pointer type compatibility. * doc.c (get_doc_string, Fsnarf_documentation): (Fsubstitute_command_keys): Likewise. + * xfns.c (Fx_open_connection, Fx_window_property): Likewise. + * bitmaps/gray.xbm (gray_bits): Likewise. 2011-02-05 Paul Eggert === modified file 'src/bitmaps/gray.xbm' --- src/bitmaps/gray.xbm 1999-09-29 16:37:29 +0000 +++ src/bitmaps/gray.xbm 2011-02-06 03:48:28 +0000 @@ -1,4 +1,4 @@ #define gray_width 2 #define gray_height 2 -static unsigned char gray_bits[] = { +static char gray_bits[] = { 0x01, 0x02}; === modified file 'src/xfns.c' --- src/xfns.c 2011-01-30 22:17:44 +0000 +++ src/xfns.c 2011-02-06 03:48:28 +0000 @@ -4067,7 +4067,7 @@ \(In the Nextstep version, the last two arguments are currently ignored.) */) (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed) { - unsigned char *xrm_option; + char *xrm_option; struct x_display_info *dpyinfo; CHECK_STRING (display); @@ -4080,9 +4080,9 @@ #endif if (! NILP (xrm_string)) - xrm_option = SDATA (xrm_string); + xrm_option = SSDATA (xrm_string); else - xrm_option = (unsigned char *) 0; + xrm_option = (char *) 0; validate_x_resource_name (); @@ -4394,7 +4394,7 @@ } if (NILP (vector_ret_p)) - prop_value = make_string (tmp_data, size); + prop_value = make_string ((char *) tmp_data, size); else prop_value = x_property_data_to_lisp (f, tmp_data, ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.