aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
authorPaul Eggert2012-09-11 15:59:50 -0700
committerPaul Eggert2012-09-11 15:59:50 -0700
commitae1d87e24edc6a5fa4bc291e1b2ea20d7853127c (patch)
tree200f48e41018df77fb2f63e55e0d22c829968ebe /src/bidi.c
parent5779a1dc62593be8294edaecfecca4359be9ab4e (diff)
downloademacs-ae1d87e24edc6a5fa4bc291e1b2ea20d7853127c.tar.gz
emacs-ae1d87e24edc6a5fa4bc291e1b2ea20d7853127c.zip
Prefer assignment to memcpy when either will do.
* lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: * src/bidi.c (bidi_push_it, bidi_pop_it): * src/fns.c (copy_hash_table): * src/image.c (define_image_type): * src/keyboard.c (kbd_buffer_store_event_hold): * src/process.c (Fprocess_send_eof): * src/xfaces.c (x_create_gc) [HAVE_NS]: * src/xgselect.c (xg_select): Use assignment, not memcpy, as either will do here, and assignment is more likely to catch type errors.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 73fec3533a4..4186a46e19e 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -612,7 +612,7 @@ bidi_push_it (struct bidi_it *bidi_it)
612 /* Save the current iterator state in its entirety after the last 612 /* Save the current iterator state in its entirety after the last
613 used cache slot. */ 613 used cache slot. */
614 bidi_cache_ensure_space (bidi_cache_idx); 614 bidi_cache_ensure_space (bidi_cache_idx);
615 memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it)); 615 bidi_cache[bidi_cache_idx++] = *bidi_it;
616 616
617 /* Push the current cache start onto the stack. */ 617 /* Push the current cache start onto the stack. */
618 eassert (bidi_cache_sp < IT_STACK_SIZE); 618 eassert (bidi_cache_sp < IT_STACK_SIZE);
@@ -636,7 +636,7 @@ bidi_pop_it (struct bidi_it *bidi_it)
636 bidi_cache_idx = bidi_cache_start - 1; 636 bidi_cache_idx = bidi_cache_start - 1;
637 637
638 /* Restore the bidi iterator state saved in the cache. */ 638 /* Restore the bidi iterator state saved in the cache. */
639 memcpy (bidi_it, &bidi_cache[bidi_cache_idx], sizeof (struct bidi_it)); 639 *bidi_it = bidi_cache[bidi_cache_idx];
640 640
641 /* Pop the previous cache start from the stack. */ 641 /* Pop the previous cache start from the stack. */
642 if (bidi_cache_sp <= 0) 642 if (bidi_cache_sp <= 0)