aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-10-01 23:55:27 -0700
committerPaul Eggert2012-10-01 23:55:27 -0700
commit0a99eee11b09820a5ab78dadae4ccbdc7e16ccb3 (patch)
treec4cd419380d4a5afa19418dd0ada4b6dc44e6719
parentdac009a4c65233e6c6fc6d3c30c2ec34129362be (diff)
downloademacs-0a99eee11b09820a5ab78dadae4ccbdc7e16ccb3.tar.gz
emacs-0a99eee11b09820a5ab78dadae4ccbdc7e16ccb3.zip
Prefer plain 'static' to 'static inline'.
* bidi.c (bidi_get_type, bidi_check_type, bidi_get_category) (bidi_set_sor_type, bidi_push_embedding_level) (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it) (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state) (bidi_cache_search, bidi_cache_ensure_space) (bidi_cache_iterator_state, bidi_cache_find) (bidi_peek_at_next_level, bidi_set_paragraph_end) (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char) (bidi_explicit_dir_char, bidi_resolve_neutral_1): Now 'static', not 'static inline'. Fixes: debbugs:12541
-rw-r--r--src/ChangeLog12
-rw-r--r--src/bidi.c44
2 files changed, 34 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a7b35a8572d..df4dc76aa07 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,17 @@
12012-10-02 Paul Eggert <eggert@cs.ucla.edu> 12012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Prefer plain 'static' to 'static inline' (Bug#12541).
4 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5 (bidi_set_sor_type, bidi_push_embedding_level)
6 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
7 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
8 (bidi_cache_search, bidi_cache_ensure_space)
9 (bidi_cache_iterator_state, bidi_cache_find)
10 (bidi_peek_at_next_level, bidi_set_paragraph_end)
11 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
13 Now 'static', not 'static inline'.
14
3 Count overruns when profiling; change units to ns. 15 Count overruns when profiling; change units to ns.
4 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms. 16 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5 Give extra weight to samples after overruns, to attempt to count 17 Give extra weight to samples after overruns, to attempt to count
diff --git a/src/bidi.c b/src/bidi.c
index deb01c76496..6f3d749ef22 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -96,7 +96,7 @@ static Lisp_Object Qparagraph_start, Qparagraph_separate;
96 96
97/* Return the bidi type of a character CH, subject to the current 97/* Return the bidi type of a character CH, subject to the current
98 directional OVERRIDE. */ 98 directional OVERRIDE. */
99static inline bidi_type_t 99static bidi_type_t
100bidi_get_type (int ch, bidi_dir_t override) 100bidi_get_type (int ch, bidi_dir_t override)
101{ 101{
102 bidi_type_t default_type; 102 bidi_type_t default_type;
@@ -145,14 +145,14 @@ bidi_get_type (int ch, bidi_dir_t override)
145 } 145 }
146} 146}
147 147
148static inline void 148static void
149bidi_check_type (bidi_type_t type) 149bidi_check_type (bidi_type_t type)
150{ 150{
151 eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); 151 eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON);
152} 152}
153 153
154/* Given a bidi TYPE of a character, return its category. */ 154/* Given a bidi TYPE of a character, return its category. */
155static inline bidi_category_t 155static bidi_category_t
156bidi_get_category (bidi_type_t type) 156bidi_get_category (bidi_type_t type)
157{ 157{
158 switch (type) 158 switch (type)
@@ -226,7 +226,7 @@ bidi_mirror_char (int c)
226 embedding levels on either side of the run boundary. Also, update 226 embedding levels on either side of the run boundary. Also, update
227 the saved info about previously seen characters, since that info is 227 the saved info about previously seen characters, since that info is
228 generally valid for a single level run. */ 228 generally valid for a single level run. */
229static inline void 229static void
230bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) 230bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
231{ 231{
232 int higher_level = (level_before > level_after ? level_before : level_after); 232 int higher_level = (level_before > level_after ? level_before : level_after);
@@ -257,7 +257,7 @@ bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
257 257
258/* Push the current embedding level and override status; reset the 258/* Push the current embedding level and override status; reset the
259 current level to LEVEL and the current override status to OVERRIDE. */ 259 current level to LEVEL and the current override status to OVERRIDE. */
260static inline void 260static void
261bidi_push_embedding_level (struct bidi_it *bidi_it, 261bidi_push_embedding_level (struct bidi_it *bidi_it,
262 int level, bidi_dir_t override) 262 int level, bidi_dir_t override)
263{ 263{
@@ -269,7 +269,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it,
269 269
270/* Pop the embedding level and directional override status from the 270/* Pop the embedding level and directional override status from the
271 stack, and return the new level. */ 271 stack, and return the new level. */
272static inline int 272static int
273bidi_pop_embedding_level (struct bidi_it *bidi_it) 273bidi_pop_embedding_level (struct bidi_it *bidi_it)
274{ 274{
275 /* UAX#9 says to ignore invalid PDFs. */ 275 /* UAX#9 says to ignore invalid PDFs. */
@@ -279,7 +279,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it)
279} 279}
280 280
281/* Record in SAVED_INFO the information about the current character. */ 281/* Record in SAVED_INFO the information about the current character. */
282static inline void 282static void
283bidi_remember_char (struct bidi_saved_info *saved_info, 283bidi_remember_char (struct bidi_saved_info *saved_info,
284 struct bidi_it *bidi_it) 284 struct bidi_it *bidi_it)
285{ 285{
@@ -295,7 +295,7 @@ bidi_remember_char (struct bidi_saved_info *saved_info,
295 295
296/* Copy the bidi iterator from FROM to TO. To save cycles, this only 296/* Copy the bidi iterator from FROM to TO. To save cycles, this only
297 copies the part of the level stack that is actually in use. */ 297 copies the part of the level stack that is actually in use. */
298static inline void 298static void
299bidi_copy_it (struct bidi_it *to, struct bidi_it *from) 299bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
300{ 300{
301 /* Copy everything from the start through the active part of 301 /* Copy everything from the start through the active part of
@@ -340,7 +340,7 @@ enum
340 intact. This is called when the cached information is no more 340 intact. This is called when the cached information is no more
341 useful for the current iteration, e.g. when we were reseated to a 341 useful for the current iteration, e.g. when we were reseated to a
342 new position on the same object. */ 342 new position on the same object. */
343static inline void 343static void
344bidi_cache_reset (void) 344bidi_cache_reset (void)
345{ 345{
346 bidi_cache_idx = bidi_cache_start; 346 bidi_cache_idx = bidi_cache_start;
@@ -351,7 +351,7 @@ bidi_cache_reset (void)
351 iterator for reordering a buffer or a string that does not come 351 iterator for reordering a buffer or a string that does not come
352 from display properties, because that means all the previously 352 from display properties, because that means all the previously
353 cached info is of no further use. */ 353 cached info is of no further use. */
354static inline void 354static void
355bidi_cache_shrink (void) 355bidi_cache_shrink (void)
356{ 356{
357 if (bidi_cache_size > BIDI_CACHE_CHUNK) 357 if (bidi_cache_size > BIDI_CACHE_CHUNK)
@@ -362,7 +362,7 @@ bidi_cache_shrink (void)
362 bidi_cache_reset (); 362 bidi_cache_reset ();
363} 363}
364 364
365static inline void 365static void
366bidi_cache_fetch_state (ptrdiff_t idx, struct bidi_it *bidi_it) 366bidi_cache_fetch_state (ptrdiff_t idx, struct bidi_it *bidi_it)
367{ 367{
368 int current_scan_dir = bidi_it->scan_dir; 368 int current_scan_dir = bidi_it->scan_dir;
@@ -379,7 +379,7 @@ bidi_cache_fetch_state (ptrdiff_t idx, struct bidi_it *bidi_it)
379 level less or equal to LEVEL. if LEVEL is -1, disregard the 379 level less or equal to LEVEL. if LEVEL is -1, disregard the
380 resolved levels in cached states. DIR, if non-zero, means search 380 resolved levels in cached states. DIR, if non-zero, means search
381 in that direction from the last cache hit. */ 381 in that direction from the last cache hit. */
382static inline ptrdiff_t 382static ptrdiff_t
383bidi_cache_search (ptrdiff_t charpos, int level, int dir) 383bidi_cache_search (ptrdiff_t charpos, int level, int dir)
384{ 384{
385 ptrdiff_t i, i_start; 385 ptrdiff_t i, i_start;
@@ -484,7 +484,7 @@ bidi_cache_find_level_change (int level, int dir, bool before)
484 return -1; 484 return -1;
485} 485}
486 486
487static inline void 487static void
488bidi_cache_ensure_space (ptrdiff_t idx) 488bidi_cache_ensure_space (ptrdiff_t idx)
489{ 489{
490 /* Enlarge the cache as needed. */ 490 /* Enlarge the cache as needed. */
@@ -506,7 +506,7 @@ bidi_cache_ensure_space (ptrdiff_t idx)
506 } 506 }
507} 507}
508 508
509static inline void 509static void
510bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved) 510bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved)
511{ 511{
512 ptrdiff_t idx; 512 ptrdiff_t idx;
@@ -563,7 +563,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved)
563 bidi_cache_idx = idx + 1; 563 bidi_cache_idx = idx + 1;
564} 564}
565 565
566static inline bidi_type_t 566static bidi_type_t
567bidi_cache_find (ptrdiff_t charpos, int level, struct bidi_it *bidi_it) 567bidi_cache_find (ptrdiff_t charpos, int level, struct bidi_it *bidi_it)
568{ 568{
569 ptrdiff_t i = bidi_cache_search (charpos, level, bidi_it->scan_dir); 569 ptrdiff_t i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
@@ -583,7 +583,7 @@ bidi_cache_find (ptrdiff_t charpos, int level, struct bidi_it *bidi_it)
583 return UNKNOWN_BT; 583 return UNKNOWN_BT;
584} 584}
585 585
586static inline int 586static int
587bidi_peek_at_next_level (struct bidi_it *bidi_it) 587bidi_peek_at_next_level (struct bidi_it *bidi_it)
588{ 588{
589 if (bidi_cache_idx == bidi_cache_start || bidi_cache_last_idx == -1) 589 if (bidi_cache_idx == bidi_cache_start || bidi_cache_last_idx == -1)
@@ -786,7 +786,7 @@ bidi_initialize (void)
786 786
787/* Do whatever UAX#9 clause X8 says should be done at paragraph's 787/* Do whatever UAX#9 clause X8 says should be done at paragraph's
788 end. */ 788 end. */
789static inline void 789static void
790bidi_set_paragraph_end (struct bidi_it *bidi_it) 790bidi_set_paragraph_end (struct bidi_it *bidi_it)
791{ 791{
792 bidi_it->invalid_levels = 0; 792 bidi_it->invalid_levels = 0;
@@ -868,7 +868,7 @@ bidi_line_init (struct bidi_it *bidi_it)
868/* Count bytes in string S between BEG/BEGBYTE and END. BEG and END 868/* Count bytes in string S between BEG/BEGBYTE and END. BEG and END
869 are zero-based character positions in S, BEGBYTE is byte position 869 are zero-based character positions in S, BEGBYTE is byte position
870 corresponding to BEG. UNIBYTE means S is a unibyte string. */ 870 corresponding to BEG. UNIBYTE means S is a unibyte string. */
871static inline ptrdiff_t 871static ptrdiff_t
872bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, 872bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg,
873 const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) 873 const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte)
874{ 874{
@@ -896,7 +896,7 @@ bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg,
896 non-NULL, fetch the character from string S; otherwise fetch the 896 non-NULL, fetch the character from string S; otherwise fetch the
897 character from the current buffer. UNIBYTE means S is a 897 character from the current buffer. UNIBYTE means S is a
898 unibyte string. */ 898 unibyte string. */
899static inline int 899static int
900bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) 900bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte)
901{ 901{
902 if (s) 902 if (s)
@@ -924,7 +924,7 @@ bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte)
924 u+2029 to handle it as a paragraph separator. STRING->s is the C 924 u+2029 to handle it as a paragraph separator. STRING->s is the C
925 string to iterate, or NULL if iterating over a buffer or a Lisp 925 string to iterate, or NULL if iterating over a buffer or a Lisp
926 string; in the latter case, STRING->lstring is the Lisp string. */ 926 string; in the latter case, STRING->lstring is the Lisp string. */
927static inline int 927static int
928bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos, 928bidi_fetch_char (ptrdiff_t bytepos, ptrdiff_t charpos, ptrdiff_t *disp_pos,
929 int *disp_prop, struct bidi_string_data *string, 929 int *disp_prop, struct bidi_string_data *string,
930 bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars) 930 bool frame_window_p, ptrdiff_t *ch_len, ptrdiff_t *nchars)
@@ -1314,7 +1314,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, bool no_default_p)
1314 The rest of this file constitutes the core of the UBA implementation. 1314 The rest of this file constitutes the core of the UBA implementation.
1315 ***********************************************************************/ 1315 ***********************************************************************/
1316 1316
1317static inline bool 1317static bool
1318bidi_explicit_dir_char (int ch) 1318bidi_explicit_dir_char (int ch)
1319{ 1319{
1320 bidi_type_t ch_type; 1320 bidi_type_t ch_type;
@@ -1837,7 +1837,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
1837 1837
1838/* Resolve the type of a neutral character according to the type of 1838/* Resolve the type of a neutral character according to the type of
1839 surrounding strong text and the current embedding level. */ 1839 surrounding strong text and the current embedding level. */
1840static inline bidi_type_t 1840static bidi_type_t
1841bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) 1841bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
1842{ 1842{
1843 /* N1: European and Arabic numbers are treated as though they were R. */ 1843 /* N1: European and Arabic numbers are treated as though they were R. */