From 838d9fefa4bef2469cf2c6e8ec908e949215d8ee Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Tue, 28 Apr 2015 18:07:54 -0700 Subject: Revert "Copy structs using assignment, not memcpy()." This reverts commit d1965788249d7e22cdde4021d452cf0dc6c6b9bd. This breaks my build on Gentoo running gcc 4.9.2 libgps_shm.c: In function 'int gps_shm_read(gps_data_t*)': libgps_shm.c:122:12: error: no match for 'operator=' (operand types are 'gps_data_t' and 'volatile gps_data_t') noclobber = shared->gpsdata; ^ libgps_shm.c:122:12: note: candidate is: In file included from gpsd.h:350:0, from libgps_shm.c:30: gps.h:1918:8: note: gps_data_t& gps_data_t::operator=(const gps_data_t&) struct gps_data_t { ^ gps.h:1918:8: note: no known conversion for argument 1 from 'volatile gps_data_t' to 'const gps_data_t&' --- libgpsd_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgpsd_core.c') diff --git a/libgpsd_core.c b/libgpsd_core.c index 4c877aa9..c6ced73d 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -985,7 +985,7 @@ static void gpsd_error_model(struct gps_device_t *session, /* save old fix for later error computations */ if (fix->mode >= MODE_2D) - *oldfix = *fix; + (void)memcpy(oldfix, fix, sizeof(struct gps_fix_t)); } #endif /* NOFLOATS_ENABLE */ @@ -999,7 +999,7 @@ int gpsd_await_data(fd_set *rfds, int status; FD_ZERO(efds); - *rfds = *all_fds; + (void)memcpy((char *)rfds, (char *)all_fds, sizeof(fd_set)); gpsd_log(errout, LOG_RAW + 2, "select waits\n"); /* * Poll for user commands or GPS data. The timeout doesn't -- cgit v1.2.1