From: Paul Eggert Date: Wed, 21 Sep 2011 23:22:29 +0000 (-0700) Subject: Fix ptrdiff_t/EMACS_INT confusion. X-Git-Tag: emacs-24.2.90~471^2~6^2~198 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c85f529fd12a8cb12eb85944877d0a52b6380a7;p=emacs.git Fix ptrdiff_t/EMACS_INT confusion. --- diff --git a/src/bidi.c b/src/bidi.c index cac12854f33..fc42a0f6bdb 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -2411,6 +2411,6 @@ bidi_dump_cached_states (void) fputs ("\n", stderr); fputs ("pos ", stderr); for (i = 0; i < bidi_cache_idx; i++) - fprintf (stderr, "%*"pI"d", ndigits, bidi_cache[i].charpos); + fprintf (stderr, "%*"pD"d", ndigits, bidi_cache[i].charpos); fputs ("\n", stderr); } diff --git a/src/fns.c b/src/fns.c index 5d75c42aea0..3d4de6ae691 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1108,7 +1108,7 @@ an error is signaled. */) ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars, 0); if (converted < chars) - error ("Can't convert the %"pI"dth character to unibyte", converted); + error ("Can't convert the %"pD"dth character to unibyte", converted); string = make_unibyte_string ((char *) str, chars); xfree (str); } diff --git a/src/indent.h b/src/indent.h index 4731bf0994b..fe5f60b0df5 100644 --- a/src/indent.h +++ b/src/indent.h @@ -26,13 +26,13 @@ struct position int contin; }; -struct position *compute_motion (ptrdiff_t from, ptrdiff_t fromvpos, - ptrdiff_t fromhpos, int did_motion, - ptrdiff_t to, ptrdiff_t tovpos, - ptrdiff_t tohpos, - ptrdiff_t width, ptrdiff_t hscroll, +struct position *compute_motion (ptrdiff_t from, EMACS_INT fromvpos, + EMACS_INT fromhpos, int did_motion, + ptrdiff_t to, EMACS_INT tovpos, + EMACS_INT tohpos, + EMACS_INT width, ptrdiff_t hscroll, int tab_offset, struct window *); -struct position *vmotion (ptrdiff_t from, ptrdiff_t vtarget, +struct position *vmotion (ptrdiff_t from, EMACS_INT vtarget, struct window *); ptrdiff_t skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p, ptrdiff_t to, Lisp_Object window); diff --git a/src/intervals.c b/src/intervals.c index 54b98804d3c..dd511252b28 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -774,7 +774,7 @@ update_interval (register INTERVAL i, ptrdiff_t pos) i = i->right; /* Move to the right child */ } else if (NULL_PARENT (i)) - error ("Point %"pI"d after end of properties", pos); + error ("Point %"pD"d after end of properties", pos); else i = INTERVAL_PARENT (i); continue; diff --git a/src/keyboard.c b/src/keyboard.c index 318ada35eb3..a771c9c4187 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6493,7 +6493,7 @@ modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kin if (NILP (value)) { char buf[sizeof "key-" + INT_STRLEN_BOUND (EMACS_INT)]; - sprintf (buf, "key-%"pI"d", symbol_num); + sprintf (buf, "key-%"pD"d", symbol_num); value = intern (buf); } diff --git a/src/print.c b/src/print.c index 28b3dd7cba5..b91e8d7cf20 100644 --- a/src/print.c +++ b/src/print.c @@ -1807,7 +1807,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag /* Implement a readable output, e.g.: #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ /* Always print the size. */ - sprintf (buf, "#s(hash-table size %"pI"d", ASIZE (h->next)); + sprintf (buf, "#s(hash-table size %"pD"d", ASIZE (h->next)); strout (buf, -1, -1, printcharfun); if (!NILP (h->test)) @@ -1982,7 +1982,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag strout ("in no buffer", -1, -1, printcharfun); else { - sprintf (buf, "at %"pI"d", marker_position (obj)); + sprintf (buf, "at %"pD"d", marker_position (obj)); strout (buf, -1, -1, printcharfun); strout (" in ", -1, -1, printcharfun); print_string (BVAR (XMARKER (obj)->buffer, name), printcharfun); @@ -1996,7 +1996,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag strout ("in no buffer", -1, -1, printcharfun); else { - sprintf (buf, "from %"pI"d to %"pI"d in ", + sprintf (buf, "from %"pD"d to %"pD"d in ", marker_position (OVERLAY_START (obj)), marker_position (OVERLAY_END (obj))); strout (buf, -1, -1, printcharfun); @@ -2035,7 +2035,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag if (MISCP (obj)) sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj)); else if (VECTORLIKEP (obj)) - sprintf (buf, "(PVEC 0x%08"pI"x)", ASIZE (obj)); + sprintf (buf, "(PVEC 0x%08"pD"x)", ASIZE (obj)); else sprintf (buf, "(0x%02x)", (int) XTYPE (obj)); strout (buf, -1, -1, printcharfun); diff --git a/src/syntax.c b/src/syntax.c index 2556a04498e..c76ffd95bf3 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2251,7 +2251,7 @@ between them, return t; otherwise return nil. */) int found; EMACS_INT count1; ptrdiff_t out_charpos, out_bytepos; - ptrdiff_t dummy; + EMACS_INT dummy; CHECK_NUMBER (count); count1 = XINT (count); @@ -2473,7 +2473,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf ptrdiff_t from_byte; ptrdiff_t out_bytepos, out_charpos; int temp; - ptrdiff_t dummy; + EMACS_INT dummy; int multibyte_symbol_p = sexpflag && multibyte_syntax_as_symbol; if (depth > 0) min_depth = 0; diff --git a/src/xdisp.c b/src/xdisp.c index 49c4b74c828..7b174ff987b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20793,7 +20793,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, so get us a 2-digit number that is close. */ if (total == 100) total = 99; - sprintf (decode_mode_spec_buf, "%2"pI"d%%", total); + sprintf (decode_mode_spec_buf, "%2"pD"d%%", total); return decode_mode_spec_buf; } } @@ -20824,9 +20824,9 @@ decode_mode_spec (struct window *w, register int c, int field_width, if (total == 100) total = 99; if (toppos <= BUF_BEGV (b)) - sprintf (decode_mode_spec_buf, "Top%2"pI"d%%", total); + sprintf (decode_mode_spec_buf, "Top%2"pD"d%%", total); else - sprintf (decode_mode_spec_buf, "%2"pI"d%%", total); + sprintf (decode_mode_spec_buf, "%2"pD"d%%", total); return decode_mode_spec_buf; } }